Skip to content

Commit

Permalink
Add integration test for hostgroup rules
Browse files Browse the repository at this point in the history
The integration test should cover all use cases in
the Automember > Hostgroup rules page.

Signed-off-by: Carla Martinez <[email protected]>
  • Loading branch information
carma12 committed Feb 7, 2025
1 parent f910d71 commit 66676ff
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions tests/features/automem_hostgroup.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Feature: Automember > Host group rules
Create and delete automember host group rules. Change default host group rule.

Background:
Given I am logged in as "Administrator"
Given I am on "host-group-rules" page

# Prep: Create a new host group to work with
Scenario: Create a new host group to work with
Given I am on "host-groups" page
When I click on "Add" button
* I type in the field "Group name" text "my_automember_hostgroup"
When in the modal dialog I click on "Add" button
* I should see "success" alert with text "New host group added"
Then I should see "my_automember_hostgroup" entry in the data table

# Host group rules operations
Scenario: Add a new automember host group rule
Given I am on "host-group-rules" page
When I click on "Add" button
* I click in the "Automember" selector field
* I select "my_automember_hostgroup" option in the "Automember" selector
* in the modal dialog I click on "Add" button
* I should see "success" alert with text "Entry successfully added"
Then I should see "my_automember_hostgroup" entry in the data table

Scenario: Add another automember host group rule
Given I am on "host-group-rules" page
When I click on "Add" button
* I click in the "Automember" selector field
* I select "ipaservers" option in the "Automember" selector
* in the modal dialog I click on "Add" button
* I should see "success" alert with text "Entry successfully added"
Then I should see "ipaservers" entry in the data table

Scenario: Delete an automember host group rule
Given I should see "my_automember_hostgroup" entry in the data table
Then I select entry "my_automember_hostgroup" in the data table
When I click on "Delete" button
* I see "Remove auto membership rules" modal
* I should see "my_automember_hostgroup" entry in the data table
When in the modal dialog I click on "Delete" button
* I should see "success" alert with text "The selected rules have been removed successfully"
Then I should not see "my_automember_hostgroup" entry in the data table

Scenario: Set default host group rule
Given I am on "host-group-rules" page
When I click in the selector field with ID "typeahead-select-input"
* I click toolbar dropdown item "ipaservers"
Then I see "Default hostgroup" modal
When in the modal dialog I click on "OK" button
Then I should see "success" alert with text "Default group updated"
* in the selector with ID "typeahead-select-input" I should see option "ipaservers" selected

# Cleanup: Delete the host group
Scenario: Delete the host group
Given I am on "host-groups" page
Given I should see "my_automember_hostgroup" entry in the data table
Then I select entry "my_automember_hostgroup" in the data table
When I click on "Delete" button
* I see "Remove host groups" modal
* I should see "my_automember_hostgroup" entry in the data table
When in the modal dialog I click on "Delete" button
* I should see "success" alert with text "Host groups removed"
Then I should not see "my_automember_hostgroup" entry in the data table

0 comments on commit 66676ff

Please sign in to comment.