Skip to content

Commit

Permalink
MDL-70196 navigation: Update to feature files.
Browse files Browse the repository at this point in the history
- Part of: MDL-69588
A lot of tests rely on the last element of the breadcrumb being
active. This updates feature files to not rely on this anymore.
  • Loading branch information
abgreeve authored and Chocolate-lightning committed Aug 23, 2021
1 parent dbc014b commit 7d435fb
Show file tree
Hide file tree
Showing 30 changed files with 106 additions and 105 deletions.
12 changes: 6 additions & 6 deletions admin/tool/customlang/tests/behat/customisation_create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ Feature: Within a moodle instance, an administrator should be able to modify lan
And I press "Open language pack for editing"
And I press "Continue"
And I set the field "Show strings of these components" to "moodle.php"
And I set the field "String identifier" to "administrationsite"
And I set the field "String identifier" to "moodledocslink"
And I press "Show strings"
And I set the field "core/administrationsite" to "Custom string example"
And I set the field "core/moodledocslink" to "moodle documents"

@javascript
Scenario: Edit an string but don't save it to lang pack.
When I press "Apply changes and continue editing"
Then I should see "Site administration" in the "page-header" "region"
And I should not see "Custom string example" in the "page-header" "region"
Then I should see "Help and documentation" in the ".helplink" "css_element"
And I should not see "moodle documents" in the ".helplink" "css_element"

@javascript
Scenario: Customize an string as admin and save it to lang pack.
Given I press "Save changes to the language pack"
And I should see "There are 1 modified strings."
When I click on "Continue" "button"
Then I should see "Custom string example" in the "page-header" "region"
And I should not see "Site administration" in the "page-header" "region"
Then I should see "moodle documents" in the ".helplink" "css_element"
And I should not see "Help and documentation" in the ".helplink" "css_element"
8 changes: 4 additions & 4 deletions admin/tool/customlang/tests/behat/import_files.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Feature: Within a moodle instance, an administrator should be able to import mod
And I should see "There are 1 modified strings."
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should see "An amazing import feature" in the "page-header" "region"
And I should see "An amazing import feature"

@javascript
Scenario: Try to import a PHP file from a non existent component
Expand All @@ -46,6 +46,6 @@ Feature: Within a moodle instance, an administrator should be able to import mod
And I should see "There are 3 modified strings."
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should see "Uploaded custom string" in the "page-header" "region"
And I should see "Another Uploaded string" in the "page-header" "region"
And I should see "An amazing import feature" in the "page-header" "region"
And I should see "Uploaded custom string"
And I should see "Another Uploaded string"
And I should see "An amazing import feature"
26 changes: 13 additions & 13 deletions admin/tool/customlang/tests/behat/import_mode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: Within a moodle instance, an administrator should be able to import lan
And I press "Save changes to the language pack"
And I should see "There are 1 modified strings."
And I click on "Continue" "button"
And I should see "Custom string example" in the "page-header" "region"
And I should see "Custom string example"

@javascript
Scenario: Update only customized strings
Expand All @@ -36,12 +36,12 @@ Feature: Within a moodle instance, an administrator should be able to import lan
And I should see "String core/nonexistentinvetedstring not found."
And I click on "Continue" "button"
And I should see "There are 1 modified strings."
And I should not see "Uploaded custom string" in the "page-header" "region"
And I should not see "Uploaded custom string"
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should not see "Custom string example" in the "page-header" "region"
And I should see "Uploaded custom string" in the "page-header" "region"
And I should not see "Another Uploaded string" in the "page-header" "region"
And I should not see "Custom string example"
And I should see "Uploaded custom string"
And I should not see "Another Uploaded string"

@javascript
Scenario: Create only new strings
Expand All @@ -56,12 +56,12 @@ Feature: Within a moodle instance, an administrator should be able to import lan
And I should see "String core/nonexistentinvetedstring not found."
And I click on "Continue" "button"
And I should see "There are 1 modified strings."
And I should not see "Uploaded custom string" in the "page-header" "region"
And I should not see "Uploaded custom string"
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should see "Custom string example" in the "page-header" "region"
And I should not see "Uploaded custom string" in the "page-header" "region"
And I should see "Another Uploaded string" in the "page-header" "region"
And I should see "Custom string example"
And I should not see "Uploaded custom string"
And I should see "Another Uploaded string"

@javascript
Scenario: Import all strings
Expand All @@ -76,9 +76,9 @@ Feature: Within a moodle instance, an administrator should be able to import lan
And I should see "String core/nonexistentinvetedstring not found."
And I click on "Continue" "button"
And I should see "There are 2 modified strings."
And I should not see "Uploaded custom string" in the "page-header" "region"
And I should not see "Uploaded custom string"
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should not see "Custom string example" in the "page-header" "region"
And I should see "Uploaded custom string" in the "page-header" "region"
And I should see "Another Uploaded string" in the "page-header" "region"
And I should not see "Custom string example"
And I should see "Uploaded custom string"
And I should see "Another Uploaded string"
2 changes: 1 addition & 1 deletion admin/tool/lp/tests/behat/plan_crud.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Feature: Manage plearning plan
And I set the field "Select cohorts to sync" to "cohort plan"
When I click on "Add cohorts" "button"
Then I should see "2 learning plans were created."
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I click on ".template-userplans" "css_element" in the "Science template cohort" "table_row"
And I should see "Student 1"
And I should see "Student 2"
Expand Down
3 changes: 0 additions & 3 deletions admin/tool/lp/tests/behat/plan_workflow.feature
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ Feature: Manage plan workflow
And I follow "User 1"
And I follow "Learning plans"
And I should see "List of learning plans"
And I follow "Learning plans"
When I click on "Send back to draft" of edit menu in the "Test-Plan3" row
And I follow "Test-Plan4"
And I follow "Send back to draft"
Expand All @@ -168,7 +167,6 @@ Feature: Manage plan workflow
And I follow "User 1"
And I follow "Learning plans"
And I should see "List of learning plans"
And I follow "Learning plans"
When I click on "Complete this learning plan" of edit menu in the "Test-Plan3" row
And I click on "Complete this learning plan" "button" in the "Confirm" "dialogue"
And I wait until the page is ready
Expand All @@ -190,7 +188,6 @@ Feature: Manage plan workflow
And I follow "User 1"
And I follow "Learning plans"
And I should see "List of learning plans"
And I follow "Learning plans"
When I click on "Reopen this learning plan" of edit menu in the "Test-Plan3" row
And I click on "Reopen this learning plan" "button" in the "Confirm" "dialogue"
And I follow "Test-Plan4"
Expand Down
32 changes: 16 additions & 16 deletions admin/tool/oauth2/tests/behat/basic_settings.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Feature: Basic OAuth2 functionality
And I click on "Configure endpoints" "link" in the "Testing service" "table_row"
And I should see "https://accounts.google.com/.well-known/openid-configuration" in the "discovery_endpoint" "table_row"
And I should see "authorization_endpoint"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Testing service" "table_row"
And I should see "firstname" in the "given_name" "table_row"
And I should see "middlename" in the "middle_name" "table_row"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Testing service" "table_row"
And I set the following fields to these values:
| Name | Testing service modified |
Expand Down Expand Up @@ -57,10 +57,10 @@ Feature: Basic OAuth2 functionality
And I click on "Configure endpoints" "link" in the "Testing service" "table_row"
And I should see "authorization_endpoint"
And I should not see "discovery_endpoint"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Testing service" "table_row"
And I should see "firstname" in the "givenName" "table_row"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Testing service" "table_row"
And I set the following fields to these values:
| Name | Testing service modified |
Expand Down Expand Up @@ -89,10 +89,10 @@ Feature: Basic OAuth2 functionality
And I click on "Configure endpoints" "link" in the "Testing service" "table_row"
And I should see "authorization_endpoint"
And I should not see "discovery_endpoint"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Testing service" "table_row"
And I should see "firstname" in the "first_name" "table_row"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Testing service" "table_row"
And I set the following fields to these values:
| Name | Testing service modified |
Expand Down Expand Up @@ -126,10 +126,10 @@ Feature: Basic OAuth2 functionality
And I click on "Configure endpoints" "link" in the "Testing service" "table_row"
And I should see "authorization_endpoint"
And I should not see "discovery_endpoint"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Testing service" "table_row"
And I should see "username" in the "ocs-data-id" "table_row"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Testing service" "table_row"
And I set the following fields to these values:
| Name | Testing service modified |
Expand Down Expand Up @@ -159,11 +159,11 @@ Feature: Basic OAuth2 functionality
And I click on "Configure endpoints" "link" in the "Open Badges" "table_row"
And I should see "https://dc.imsglobal.org/.well-known/badgeconnect.json" in the "discovery_endpoint" "table_row"
And I should see "authorization_endpoint"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Open Badges" "table_row"
And I should not see "given_name"
And I should not see "middle_name"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Open Badges" "table_row"
And I set the following fields to these values:
| Name | IMS Global |
Expand Down Expand Up @@ -194,11 +194,11 @@ Feature: Basic OAuth2 functionality
And I click on "Configure endpoints" "link" in the "Google custom" "table_row"
And I should see "https://accounts.google.com/.well-known/openid-configuration" in the "discovery_endpoint" "table_row"
And I should see "authorization_endpoint"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Google custom" "table_row"
And I should see "firstname" in the "given_name" "table_row"
And I should see "middlename" in the "middle_name" "table_row"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Google custom" "table_row"
And I set the following fields to these values:
| Name | Google custom modified |
Expand Down Expand Up @@ -227,11 +227,11 @@ Feature: Basic OAuth2 functionality
And I should see "-" in the "Invalid custom service" "table_row"
And I click on "Configure endpoints" "link" in the "Invalid custom service" "table_row"
And I should not see "discovery_endpoint"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Invalid custom service" "table_row"
And I should not see "given_name"
And I should not see "middle_name"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Invalid custom service" "table_row"
And I set the following fields to these values:
| Name | Valid custom service |
Expand Down Expand Up @@ -268,11 +268,11 @@ Feature: Basic OAuth2 functionality
And I should see "-" in the "Empty custom service" "table_row"
And I click on "Configure endpoints" "link" in the "Empty custom service" "table_row"
And I should not see "discovery_endpoint"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Empty custom service" "table_row"
And I should not see "given_name"
And I should not see "middle_name"
And I follow "OAuth 2 services"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Empty custom service" "table_row"
# Check it works as expected too without slash at the end of the service base URL.
And I set the following fields to these values:
Expand Down
2 changes: 1 addition & 1 deletion analytics/tests/behat/manage_models.feature
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Feature: Manage analytics models
And I click on "View" "link"
And I should see "Log extra info"
And I click on "Close" "button"
And I click on "Analytics models" "link"
And I navigate to "Analytics > Analytics models" in site administration
# Execute scheduled analysis
And I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
And I choose "Execute scheduled analysis" in the open action menu
Expand Down
6 changes: 3 additions & 3 deletions badges/tests/behat/add_badge.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Feature: Add badges to the system
And I should see "Issuer details"
And I should see "Test Badge Site"
And I should see "[email protected]"
And I follow "Manage badges"
And I navigate to "Badges > Manage badges" in site administration
And I should see "Number of badges available: 1"
And I should not see "There are no badges available."

Expand All @@ -61,7 +61,7 @@ Feature: Add badges to the system
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
And I press "Create badge"
And I wait until the page is ready
And I follow "Manage badges"
And I navigate to "Badges > Manage badges" in site administration
And I should see "Number of badges available: 1"
And I press "Add a new badge"
And I set the following fields to these values:
Expand Down Expand Up @@ -157,7 +157,7 @@ Feature: Add badges to the system
And I should see "Related badges (0)"
And I should see "Alignments (0)"
And I should not see "Create badge"
And I follow "Manage badges"
And I navigate to "Badges > Manage badges" in site administration
And I should see "Number of badges available: 1"
And I should not see "There are no badges available."
# See buttons from the "Site badges" page.
Expand Down
Loading

0 comments on commit 7d435fb

Please sign in to comment.