forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-79496 webservice: Fix webservice behat tests
- Move all webservice related behat tests to the correct namespace. - Add missing @core_webservice tags - Fix behat scenarios after systemreport conversion.
- Loading branch information
Showing
4 changed files
with
41 additions
and
32 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@core @core_admin | ||
@core @core_admin @core_webservice | ||
Feature: Manage external services tokens | ||
In order to manage external service usage | ||
As an admin | ||
|
@@ -11,7 +11,6 @@ Feature: Manage external services tokens | |
| user2 | user2 | Firstname2 | Lastname2 | | ||
| user3 | user3 | Firstname3 | Lastname3 | | ||
| user4 | user4 | Firstname4 | Lastname4 | | ||
And I change window size to "small" | ||
|
||
@javascript | ||
Scenario: Add a token to user identified by name and then delete that token | ||
|
@@ -25,7 +24,7 @@ Feature: Manage external services tokens | |
And I set the field "IP restriction" to "127.0.0.1" | ||
When I press "Save changes" | ||
Then the following should exist in the "generaltable" table: | ||
| Name | First name | Service | IP restriction | Last access | | ||
| Name | User | Service | IP restriction | Last access | | ||
| Webservice1 | Firstname1 Lastname1 | Moodle mobile web service | 127.0.0.1 | Never | | ||
|
||
# Verify the message and the "Copy to clipboard" button. | ||
|
@@ -38,7 +37,7 @@ Feature: Manage external services tokens | |
And "Copy to clipboard" "button" should not exist | ||
|
||
# Delete token. | ||
And I click on "Delete" "link" in the "Webservice1" "table_row" | ||
And I press "Delete" action in the "Webservice1" report row | ||
And I should see "Do you really want to delete this web service token for Firstname1 Lastname1 on the service Moodle mobile web service?" | ||
And I press "Delete" | ||
And "Webservice1" "table_row" should not exist | ||
|
@@ -53,10 +52,10 @@ Feature: Manage external services tokens | |
| service | siteinfo | | ||
| functions | core_webservice_get_site_info | | ||
And the following "core_webservice > Tokens" exist: | ||
| user | service | name | | ||
| user2 | siteinfo | WEBservice1 | | ||
| user3 | moodle_mobile_app | webservicE3 | | ||
| user4 | siteinfo | New service2 | | ||
| user | service | name | validuntil | | ||
| user2 | siteinfo | WEBservice1 | ## yesterday ## | | ||
| user3 | moodle_mobile_app | webservicE3 | ## +1 year ## | | ||
| user4 | siteinfo | New service2 | ## +1 year ## | | ||
When I log in as "admin" | ||
And I navigate to "Server > Web services > Manage tokens" in site administration | ||
|
||
|
@@ -66,38 +65,48 @@ Feature: Manage external services tokens | |
And I should see "Moodle mobile web service" in the "Firstname3 Lastname3" "table_row" | ||
And I should see "Site information" in the "Firstname4 Lastname4" "table_row" | ||
|
||
# Filter tokens by by name (case-insensitive). | ||
And I click on "Tokens filter" "link" | ||
And I set the field "Name" to "webservice" | ||
And I press "Show only matching tokens" | ||
# Filter tokens by by name. | ||
And I click on "Filters" "button" | ||
And I set the following fields in the "Name" "core_reportbuilder > Filter" to these values: | ||
| Name operator | Contains | | ||
| Name value | webservice | | ||
And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" | ||
And I should see "Site information" in the "Firstname2 Lastname2" "table_row" | ||
And I should see "Moodle mobile web service" in the "Firstname3 Lastname3" "table_row" | ||
And "Firstname4 Lastname4" "table_row" should not exist | ||
And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element" | ||
|
||
# Reset the filter. | ||
And I press "Show all tokens" | ||
# Filter tokens by user. | ||
And I set the following fields in the "User" "core_reportbuilder > Filter" to these values: | ||
| User operator | Contains | | ||
| User value | Firstname2 | | ||
And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" | ||
Then "Firstname3 Lastname3" "table_row" should not exist | ||
And "Firstname4 Lastname4" "table_row" should not exist | ||
And I should see "Site information" in the "Firstname2 Lastname2" "table_row" | ||
And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element" | ||
|
||
# Filter tokens by service. | ||
And I set the following fields in the "Service" "core_reportbuilder > Filter" to these values: | ||
| Service value | Site information | | ||
And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" | ||
And I should see "Site information" in the "Firstname2 Lastname2" "table_row" | ||
And I should see "Moodle mobile web service" in the "Firstname3 Lastname3" "table_row" | ||
And I should see "Site information" in the "Firstname4 Lastname4" "table_row" | ||
And "Firstname3 Lastname3" "table_row" should not exist | ||
And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element" | ||
|
||
# Filter tokens by user (note we can select the user by the identity field here). | ||
When I click on "Tokens filter" "link" | ||
And I set the field "User" to "[email protected]" | ||
And I press "Show only matching tokens" | ||
# Filter tokens by valid date. | ||
And I set the following fields in the "Valid until" "core_reportbuilder > Filter" to these values: | ||
| Valid until operator | Last | | ||
| Valid until value | 2 | | ||
| Valid until unit | day(s) | | ||
And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" | ||
Then "Firstname3 Lastname3" "table_row" should not exist | ||
And "Firstname4 Lastname4" "table_row" should not exist | ||
And I should see "Site information" in the "Firstname2 Lastname2" "table_row" | ||
|
||
# Reset the filter. | ||
And I press "Show all tokens" | ||
# Reset the filters. | ||
And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element" | ||
And I should see "Site information" in the "Firstname2 Lastname2" "table_row" | ||
And I should see "Moodle mobile web service" in the "Firstname3 Lastname3" "table_row" | ||
And I should see "Site information" in the "Firstname4 Lastname4" "table_row" | ||
|
||
# Filter tokens by service. | ||
And I click on "Tokens filter" "link" | ||
And I set the field "Service" to "Site information" | ||
And I press "Show only matching tokens" | ||
And I should see "Site information" in the "Firstname2 Lastname2" "table_row" | ||
And I should see "Site information" in the "Firstname4 Lastname4" "table_row" | ||
And "Firstname3 Lastname3" "table_row" should not exist |
2 changes: 1 addition & 1 deletion
2
.../siteadmin_webservice_breadcrumbs.feature → .../siteadmin_webservice_breadcrumbs.feature
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
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
File renamed without changes.