-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port existing user tests from freeipa project to gherkin syntax. Signed-off-by: Michal Polovka <mpolovka@redhat.com>
- Loading branch information
Showing
6 changed files
with
145 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,36 @@ | ||
const { Given, When, Then } = require("cucumber"); | ||
|
||
Given( | ||
"an administrator account named {word} exists", | ||
function (admin_account_exists) { | ||
console.log("Admin exists, SUCCESS"); | ||
} | ||
); | ||
|
||
Given("I am logged in as {word}", function (admin_login) { | ||
console.log("Admin logged in, SUCCESS"); | ||
}); | ||
|
||
Given("I have a sample {word}", function (create_record) {}); | ||
|
||
When("I click on {} tab", function (tab_name) { | ||
document.getElementById(tab_name).click(); | ||
}); | ||
|
||
When("I click on {word} button", function (button_name) { | ||
document.getElementById(button_name).click(); | ||
}); | ||
|
||
When("there is only one existing user", function () {}); | ||
|
||
Then("I should see {word} entry in the result table", function (entry_id) {}); | ||
When("I type in the field {word} text {}", function (field_id, content) {}); | ||
Given("There is an entry {word}", function (entry_id) {}); | ||
When("I open details for entry {word}", function (entry_id) {}); | ||
Then( | ||
"I should see field {word} filled with {}", | ||
function (field_id, content) {} | ||
); | ||
When("I open the details for the entry {word}", function () {}); | ||
Then("I should see the detail page for {word}", function () {}); | ||
Then("Entry {word} should be enabled", function () {}); |
This file contains 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,80 @@ | ||
Feature: User manipulation | ||
Create, edit, delete, preserve and activate users | ||
|
||
Background: | ||
Given an administrator account named admin exists | ||
And I am logged in as admin | ||
|
||
Scenario: Navigate to users tab | ||
When I click on Users tab | ||
And there is only one existing user | ||
Then I should see admin entry in the result table | ||
|
||
Scenario Outline: Add a new user | ||
Given I have a sample group | ||
* I have a sample netgroup | ||
* I have a sample rbac | ||
* I have a sample hbac | ||
* I have a sample sudorule | ||
When I click on Add button | ||
* I type in the field user-login text <username> | ||
* I type in the field first-name text <firstname> | ||
* I type in the field last-name text <lastname> | ||
* I click on "Add" button | ||
Then I should see <username> entry in the result table | ||
* Entry <username> should be enabled | ||
Examples: | ||
| username | firstname | lastname | ||
| testuser1 | test | user1 | ||
| testuser2 | test | user2 | ||
| testuser3 | test | user3 | ||
Scenario: Open user details | ||
Given There is an entry testuser1 | ||
When I open the details for the entry testuser1 | ||
Then I should see the detail page for testuser1 | ||
Scenario: Fill in user details | ||
Given There is an entry testuser1 | ||
When I open the details for the entry testuser1 | ||
* I type in the field first-name text Testfirst | ||
* I type in the field last-name text Testlast | ||
* I type in the field full-name text "Testfirst Testlast" | ||
* I type in the field job-title text Testjobtitle | ||
* I type in the field class-field text Testclass | ||
* I type in the field gecos text "Testfirst Testlast, RandomOffice, 1234567, The Earth" | ||
When I click on save button | ||
Then I should see the detail page for testuser1 | ||
* I should see field first-name filled with Testfirst | ||
* I should see field last-name filled with Testlast | ||
* I should see field full-name filled with "Testfirst Testlast" | ||
* I should see field job-title filled with Testjobtitle | ||
* I should see field class-field filled with Testclass | ||
* I should see field gecos filled with "Testfirst Testlast, RandomOffice, 1234567, The Earth" | ||
Scenario: Add ssh key to a user | ||
Given There is an entry testuser1 | ||
When I open details for entry testuser1 | ||
* I click on add_ssh_key button | ||
* I type in the field ssh-key text "LONG SSH KEY HERE" | ||
* I click on set button | ||
Then I should see field "ssh_pubkey" filled with "SHORT_SSH_KEY_HERE" | ||
Scenario: Add certificate to a user | ||
Given There is an entry testuser1 | ||
When I open details for entry testuser1 | ||
* I click on add_certificate button | ||
* I type in the field certificate text "CR_CONTENT_HERE" | ||
* I click on set button | ||
Then I should see field "certificate" filled with "CR_CONTENT_HERE" | ||
Scenario: Add certificate mapping data to a user | ||
Given There is an entry testuser1 | ||
When I open details for entry testuser1 | ||
* I click on add_certificate_mapping button | ||
* I type in the field certificate_mapping text "CR MAPPING CONTENT" | ||
* I click on set button | ||
Then I should see field certificate_mapping filled with "CR MAPPING CONTENT" | ||
This file contains 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 @@ | ||
Feature: User association | ||
Test association of user with user groups, netgroups, roles, HBAC roles and | ||
Sudo rules | ||
|
||
Background: | ||
Given an administrator account named admin exists | ||
And I am logged in as admin | ||
* I click on "Member of" tab | ||
* I have a sample netgroup | ||
* I have a sample rbac | ||
* I have a sample hbac | ||
* I have a sample sudorule | ||
|
||
Scenario: # Enter scenario name here | ||
# Enter steps here |
This file was deleted.
Oops, something went wrong.