Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for Group Management #240

Merged
merged 7 commits into from
Dec 18, 2020

Conversation

ZitaNemeckova
Copy link
Member

@ZitaNemeckova ZitaNemeckova commented Nov 13, 2020

TODO:

  • create group
  • delete group
  • add permissions to a group
  • add all permissions to a group
  • remove permissions from a group
  • add user to a group
  • remove user from a group

Sorry, something went wrong.

@ZitaNemeckova ZitaNemeckova changed the title [WIP] Add test for Group Management Add test for Group Management Dec 18, 2020
@ZitaNemeckova
Copy link
Member Author

@hendersonreed please review. Thanks :)

Copy link
Contributor

@hendersonreed hendersonreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that it runs on my machine in both FF and Chromium!

cy.contains(name).should('exist');
cy.addAllPermissions(name);
[ 'namespaces', 'collections', 'users', 'groups', 'remotes' ].forEach(permGroup => cy.get(`.pf-l-flex.pf-m-align-items-center.${permGroup} [placeholder="No permission"]`).should('not.exist'));;
cy.removePermissions(name, [{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just use removeAllPermissions here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed :)

@hendersonreed
Copy link
Contributor

Looks good to me! They continue to pass on my machine as well.

@ZitaNemeckova ZitaNemeckova merged commit 2a66eaa into ansible:master Dec 18, 2020
@ZitaNemeckova ZitaNemeckova deleted the group_tests branch December 18, 2020 17:48
@himdel himdel added the backport-4.2 This PR should be backported to stable-4.2 (1.2) label Apr 19, 2021
@patchback
Copy link

patchback bot commented Apr 19, 2021

Backport to stable-4.2: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 2a66eaa on top of patchback/backports/stable-4.2/2a66eaa5d50055c0e763f663bd6f26dcd65b63bd/pr-240

Backporting merged PR #240 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git add remote upstream https://github.com/ansible/ansible-hub-ui.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-4.2/2a66eaa5d50055c0e763f663bd6f26dcd65b63bd/pr-240 upstream/stable-4.2
  4. Now, cherry-pick PR Add test for Group Management #240 contents into that branch:
    $ git cherry-pick -x 2a66eaa5d50055c0e763f663bd6f26dcd65b63bd
    If it'll yell at you with something like fatal: Commit 2a66eaa5d50055c0e763f663bd6f26dcd65b63bd is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 2a66eaa5d50055c0e763f663bd6f26dcd65b63bd
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Add test for Group Management #240 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-4.2/2a66eaa5d50055c0e763f663bd6f26dcd65b63bd/pr-240
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@himdel
Copy link
Collaborator

himdel commented Apr 19, 2021

Backporting because #305 (backported) depends on createGroup from this one + #301 (which conflicts without it).

(=> Backported via #354)

@himdel himdel mentioned this pull request Apr 19, 2021
himdel pushed a commit to himdel/ansible-hub-ui that referenced this pull request Apr 19, 2021
* Add test for Group Management

* Add permissions to a group

* Add waiting for delete of a user/group to end and check that it ends with 204

* Admin user can add and remove users from a group

* Remove use of .click({force: true}) and fix it to make it work

* Add some waits and checks

* Use removeAllPermissions and use variable for types of permission

(cherry picked from commit 2a66eaa)
himdel pushed a commit to himdel/ansible-hub-ui that referenced this pull request Apr 20, 2021
* Add test for Group Management

* Add permissions to a group

* Add waiting for delete of a user/group to end and check that it ends with 204

* Admin user can add and remove users from a group

* Remove use of .click({force: true}) and fix it to make it work

* Add some waits and checks

* Use removeAllPermissions and use variable for types of permission

(cherry picked from commit 2a66eaa)
himdel added a commit that referenced this pull request Apr 20, 2021

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
…port multiple test PRs (#354)

* Add test for Group Management (#240)

* Add test for Group Management

* Add permissions to a group

* Add waiting for delete of a user/group to end and check that it ends with 204

* Admin user can add and remove users from a group

* Remove use of .click({force: true}) and fix it to make it work

* Add some waits and checks

* Use removeAllPermissions and use variable for types of permission

(cherry picked from commit 2a66eaa)

* Add test for AAH-160 (#301)

The change in commands.js was simply a missing parenthesis, and the
change in package.json is just whitespace (seems like it was automated,
I don't remember making that change.)

(cherry picked from commit 564c41e)

Co-authored-by: ZitaNemeckova <znemecko@redhat.com>
Co-authored-by: Henderson Hummel <hhummel@redhat.com>
@himdel himdel added the backported-4.2 This PR has been backported to stable-4.2 (1.2) label Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-4.2 This PR should be backported to stable-4.2 (1.2) backported-4.2 This PR has been backported to stable-4.2 (1.2)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants