-
Notifications
You must be signed in to change notification settings - Fork 24
Integration tests: Add new test for privileges main page #1135
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
Merged
veronnicka
merged 1 commit into
freeipa:main
from
veronnicka:intergation-test-privilege
Jul 16, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| Feature: Privileges manipulation | ||
| Create and delete privileges | ||
|
|
||
| @test | ||
| Scenario: Add a new privilege | ||
| Given I am logged in as admin | ||
| And I am on "privileges" page | ||
|
|
||
| When I click on the "privileges-button-add" button | ||
| Then I should see "add-privilege-modal" modal | ||
|
|
||
| When I type in the "modal-textbox-privilege-name" textbox text "a_privilege1" | ||
| Then I should see "a_privilege1" in the "modal-textbox-privilege-name" textbox | ||
|
|
||
| When I type in the "modal-textbox-description" textbox text "my description" | ||
| Then I should see "my description" in the "modal-textbox-description" textbox | ||
|
|
||
| When I click on the "modal-button-add" button | ||
| Then I should not see "add-privilege-modal" modal | ||
| And I should see "add-privilege-success" alert | ||
|
|
||
| When I search for "a_privilege1" in the data table | ||
| Then I should see "a_privilege1" entry in the data table | ||
| And I should see "a_privilege1" entry in the data table with attribute "description" set to "my description" | ||
|
|
||
| @cleanup | ||
| Scenario: Cleanup: Delete a privilege | ||
| Given I delete privilege "a_privilege1" | ||
|
|
||
| @seed | ||
| Scenario: Seed: Create privileges used in tests | ||
| Given privilege "a_privilege2" exists | ||
|
|
||
| @test | ||
| Scenario: Search for a privilege | ||
| Given I am logged in as admin | ||
| And I am on "privileges" page | ||
|
|
||
| When I search for "a_privilege2" in the data table | ||
| Then I should see "a_privilege2" entry in the data table | ||
| And I should not see "a_privilege1" entry in the data table | ||
|
|
||
| @cleanup | ||
| Scenario: Cleanup: Delete seeded privileges | ||
| Given I delete privilege "a_privilege2" | ||
|
|
||
| @seed | ||
| Scenario: Seed: Create privileges used in tests | ||
| Given privilege "a_privilege1" exists | ||
|
|
||
| @test | ||
| Scenario: Delete a privilege | ||
| Given I am logged in as admin | ||
| And I am on "privileges" page | ||
|
|
||
| When I search for "a_privilege1" in the data table | ||
| Then I should see "a_privilege1" entry in the data table | ||
| When I select entry "a_privilege1" in the data table | ||
| Then I should see "a_privilege1" entry selected in the data table | ||
|
|
||
| When I click on the "privileges-button-delete" button | ||
| Then I should see "delete-privileges-modal" modal | ||
| And I should see "a_privilege1" entry in the data table | ||
|
|
||
| When I click on the "modal-button-delete" button | ||
| Then I should see "remove-privileges-success" alert | ||
| And I should not see "delete-privileges-modal" modal | ||
| And I should not see "a_privilege1" entry in the data table | ||
|
|
||
| @seed | ||
| Scenario: Seed: Create privileges used in tests | ||
| Given privilege "a_privilege2" exists | ||
| And privilege "a_privilege3" exists | ||
|
|
||
| @test | ||
| Scenario: Delete many privileges | ||
| Given I am logged in as admin | ||
| And I am on "privileges" page | ||
|
|
||
| When I search for "a_privilege2" in the data table | ||
| Then I should see "a_privilege2" entry in the data table | ||
| When I select entry "a_privilege2" in the data table | ||
| Then I should see "a_privilege2" entry selected in the data table | ||
|
|
||
| When I search for "a_privilege3" in the data table | ||
| Then I should see "a_privilege3" entry in the data table | ||
| When I select entry "a_privilege3" in the data table | ||
| Then I should see "a_privilege3" entry selected in the data table | ||
|
|
||
| When I click on the "privileges-button-delete" button | ||
| Then I should see "delete-privileges-modal" modal | ||
| And I should see "a_privilege2" entry in the data table | ||
| And I should see "a_privilege3" entry in the data table | ||
|
|
||
| When I click on the "modal-button-delete" button | ||
| Then I should see "remove-privileges-success" alert | ||
| And I should not see "delete-privileges-modal" modal | ||
| And I should not see "a_privilege2" entry in the data table | ||
| And I should not see "a_privilege3" entry in the data table | ||
|
|
||
| @test | ||
| Scenario: Cancel creation of a privilege | ||
| Given I am logged in as admin | ||
| And I am on "privileges" page | ||
|
|
||
| When I click on the "privileges-button-add" button | ||
| Then I should see "add-privilege-modal" modal | ||
|
|
||
| When I type in the "modal-textbox-privilege-name" textbox text "a_privilege_cancel" | ||
| Then I should see "a_privilege_cancel" in the "modal-textbox-privilege-name" textbox | ||
|
|
||
| When I click on the "modal-button-cancel" button | ||
| Then I should not see "add-privilege-modal" modal | ||
| And I should not see "a_privilege_cancel" entry in the data table | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { Given } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
|
||
| Given("privilege {string} exists", (privilegeName: string) => { | ||
| cy.ipa({ | ||
| command: "privilege-add", | ||
| name: privilegeName, | ||
| }); | ||
| }); | ||
|
|
||
| Given("I delete privilege {string}", (privilegeName: string) => { | ||
| cy.ipa({ | ||
| command: "privilege-del", | ||
| name: privilegeName, | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.