diff --git a/admin/tool/usertours/tests/behat/behat_tool_usertours.php b/admin/tool/usertours/tests/behat/behat_tool_usertours.php index 63afcbe0123..b08bc14fadd 100644 --- a/admin/tool/usertours/tests/behat/behat_tool_usertours.php +++ b/admin/tool/usertours/tests/behat/behat_tool_usertours.php @@ -62,7 +62,16 @@ class behat_tool_usertours extends behat_base { public function i_add_steps_to_the_named_tour($tourname, TableNode $table) { $this->execute('behat_tool_usertours::i_open_the_user_tour_settings_page'); $this->execute('behat_general::click_link', $this->escape($tourname)); + $this->execute('behat_tool_usertours::i_add_steps_to_the_tour', $table); + } + /** + * Add new steps to the current user tour. + * + * @Given /^I add steps to the tour:$/ + * @param TableNode $table + */ + public function i_add_steps_to_the_tour(TableNode $table) { foreach ($table->getHash() as $step) { $this->execute('behat_general::click_link', get_string('newstep', 'tool_usertours')); diff --git a/admin/tool/usertours/tests/behat/tour_accessibility.feature b/admin/tool/usertours/tests/behat/tour_accessibility.feature index 4bcf6bdc91a..2aedf5bd2e6 100644 --- a/admin/tool/usertours/tests/behat/tour_accessibility.feature +++ b/admin/tool/usertours/tests/behat/tour_accessibility.feature @@ -85,3 +85,34 @@ Feature: Apply accessibility to a tour Then the focused element is "Side panel" "button" When I press shift tab And the focused element is "End tour" "button" in the "Navigation" "dialogue" + + @javascript + Scenario: Aria tags should not exist + Given I log in as "admin" + And I add a new user tour with: + | Name | First tour | + | Description | My first tour | + | Apply to URL match | FRONTPAGE | + | Tour is enabled | 1 | + And I add steps to the "First tour" tour: + | targettype | Title | Content | + | Display in middle of page | Welcome | Welcome to your course tour. | + And I add steps to the tour: + | targettype | targetvalue_selector | Title | Content | + | Selector | input,button | Page 2 | Next page | + And I add steps to the tour: + | targettype | Title | Content | + | Display in middle of page | Page 3 | Final page. | + And I am on site homepage + When I click on "Next" "button" + Then "input[aria-describedby^='tour-step-tool_usertours'],button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist + And "input[tabindex],button[tabindex]" "css_element" should exist + When I click on "Next" "button" + Then "input[aria-describedby^='tour-step-tool_usertours'],button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist + And "input[tabindex],button[tabindex]" "css_element" should not exist + When I click on "Previous" "button" + Then "input[aria-describedby^='tour-step-tool_usertours'],button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist + And "input[tabindex],button[tabindex]" "css_element" should exist + When I click on "End tour" "button" + Then "input[aria-describedby^='tour-step-tool_usertours'],button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist + And "input[tabindex],button[tabindex]" "css_element" should not exist diff --git a/admin/tool/usertours/tests/behat/tour_filter.feature b/admin/tool/usertours/tests/behat/tour_filter.feature index 0bafb3433c5..fdcd28d38b7 100644 --- a/admin/tool/usertours/tests/behat/tour_filter.feature +++ b/admin/tool/usertours/tests/behat/tour_filter.feature @@ -157,23 +157,3 @@ Feature: Apply tour filters to a tour When I am on "Course 2" course homepage And I wait until the page is ready Then I should not see "Welcome to your course tour." - - @javascript - Scenario: Aria tags should not exist - Given I log in as "admin" - And I open the User tour settings page - # Turn on default tour for boost theme. - And I click on "Enable" "link" in the "Boost - administrator" "table_row" - And I am on site homepage - When I click on "Next" "button" - Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist - And "button[tabindex]" "css_element" should exist - When I click on "Next" "button" - Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist - And "button[tabindex]" "css_element" should not exist - When I click on "Previous" "button" - Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist - And "button[tabindex]" "css_element" should exist - When I click on "End tour" "button" - Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist - And "button[tabindex]" "css_element" should not exist