Commit b983003e authored by Mathew May's avatar Mathew May
Browse files

MDL-70197 navigation: Remove old navigation elements and migrate behat

parent 18b2af60
......@@ -59,7 +59,7 @@ if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and
}
}
$PAGE->has_secondary_navigation_setter(false);
$PAGE->set_primary_active_tab('siteadminnode');
// and finally, if we get here, then there are matching settings and we have to print a form
// to modify them
......
......@@ -385,6 +385,7 @@ Feature: Set up contextual data for tests
| enableoutcomes | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Grades" in current page administration
And I follow "Outcomes"
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
......
......@@ -49,7 +49,7 @@ Feature: Manage data registry defaults
And the field "categoryid" matches value "Not set (use the default value)"
And the field "purposeid" matches value "Not set (use the default value)"
And I should see "3 years"
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
......@@ -80,7 +80,7 @@ Feature: Manage data registry defaults
Then the field "categoryid" matches value "Category 2"
And the field "purposeid" matches value "Purpose 2"
And I should see "5 years"
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
# Physics 101 is also a category, so it will get the category default.
And I click on "Physics 101" "link"
......@@ -102,7 +102,7 @@ Feature: Manage data registry defaults
Then the field "categoryid" matches value "Category 2"
And the field "purposeid" matches value "Purpose 2"
And I should see "5 years"
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
# Physics 101 is also a category, so it will get the category default.
And I click on "Physics 101" "link"
......@@ -138,7 +138,7 @@ Feature: Manage data registry defaults
Given I set the category and purpose for the course "Physics 101" to "Category 2" and "Purpose 2"
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Set defaults" "link"
And I click on "Courses" "link"
And I click on "Courses" "link" in the "#region-main" "css_element"
And I should see "Inherit"
And I should not see "Add a new module default"
And I press "Edit"
......@@ -150,7 +150,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
......@@ -168,7 +168,7 @@ Feature: Manage data registry defaults
Given I set the category and purpose for the course "Physics 101" to "Category 2" and "Purpose 2"
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Set defaults" "link"
And I click on "Courses" "link"
And I click on "Courses" "link" in the "#region-main" "css_element"
And I should see "Inherit"
And I should not see "Add a new module default"
And I press "Edit"
......@@ -181,7 +181,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
......@@ -211,7 +211,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
......@@ -240,7 +240,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
......@@ -273,7 +273,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
......@@ -303,7 +303,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
......@@ -331,7 +331,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
......@@ -360,7 +360,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
And I click on "Courses" "link"
And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
......
......@@ -25,7 +25,7 @@ Feature: See the competencies for an activity on the course competencies page.
| page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 |
| page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 |
And I am on the "Course 1" course page logged in as admin
And I follow "Competencies"
And I navigate to "Competencies" in current page administration
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
And I select "Test-Comp1" of the competency tree
......
......@@ -152,7 +152,7 @@ Feature: Manage plearning plan
And I create a course with:
| Course full name | New course fullname |
| Course short name | New course shortname |
And I follow "Competencies"
And I navigate to "Competencies" in current page administration
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
And I select "comp1" of the competency tree
......
......@@ -22,7 +22,8 @@ Feature: In a course administration page, navigate through report page, test for
And I navigate to "Reports > Event monitoring rules" in site administration
And I click on "Enable" "link"
And I am on "Course 1" course homepage
When I navigate to "Reports > Event monitoring rules" in current page administration
When I navigate to "Reports" in current page administration
And I select "Event monitoring rules" from the "Report type" singleselect
Then "Report" "field" should exist
And the "Report" select box should contain "Event monitoring rules"
And the field "Report" matches value "Event monitoring rules"
......@@ -18,7 +18,8 @@ Feature: tool_monitor_rule
And I navigate to "Reports > Event monitoring rules" in site administration
And I click on "Enable" "link"
And I am on "Course 1" course homepage
And I navigate to "Reports > Event monitoring rules" in current page administration
And I navigate to "Reports" in current page administration
And I select "Event monitoring rules" from the "Report type" singleselect
And I press "Add a new rule"
And I set the following fields to these values:
| name | New rule course level |
......@@ -45,7 +46,8 @@ Feature: tool_monitor_rule
Scenario: Add a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Reports > Event monitoring rules" in current page administration
And I navigate to "Reports" in current page administration
And I select "Event monitoring rules" from the "Report type" singleselect
When I press "Add a new rule"
And I set the following fields to these values:
| name | New rule |
......@@ -65,7 +67,8 @@ Feature: tool_monitor_rule
Scenario: Delete a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Reports > Event monitoring rules" in current page administration
And I navigate to "Reports" in current page administration
And I select "Event monitoring rules" from the "Report type" singleselect
When I click on "Delete rule" "link"
Then I should see "Are you sure you want to delete the rule \"New rule course level\"?"
And I press "Continue"
......@@ -75,7 +78,8 @@ Feature: tool_monitor_rule
Scenario: Edit a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Reports > Event monitoring rules" in current page administration
And I navigate to "Reports" in current page administration
And I select "Event monitoring rules" from the "Report type" singleselect
When I click on "Edit rule" "link"
And I set the following fields to these values:
| name | New rule quiz |
......@@ -94,7 +98,8 @@ Feature: tool_monitor_rule
Scenario: Duplicate a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Reports > Event monitoring rules" in current page administration
And I navigate to "Reports" in current page administration
And I select "Event monitoring rules" from the "Report type" singleselect
When I click on "Duplicate rule" "link" in the "New rule course level" "table_row"
Then I should see "Rule successfully duplicated"
And "#toolmonitorrules_r1" "css_element" should appear before "#toolmonitorrules_r2" "css_element"
......@@ -153,7 +158,8 @@ Feature: tool_monitor_rule
Scenario: Duplicate a rule on site level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Reports > Event monitoring rules" in current page administration
And I navigate to "Reports" in current page administration
And I select "Event monitoring rules" from the "Report type" singleselect
When I click on "Duplicate rule" "link" in the "New rule site level" "table_row"
Then I should see "Rule successfully duplicated"
And "#toolmonitorrules_r2" "css_element" should appear after "#toolmonitorrules_r1" "css_element"
......
......@@ -23,7 +23,8 @@ Feature: tool_monitor_subscriptions
And I navigate to "Reports > Event monitoring rules" in site administration
And I click on "Enable" "link"
And I am on "Course 1" course homepage
And I navigate to "Reports > Event monitoring rules" in current page administration
And I navigate to "Reports" in current page administration
And I select "Event monitoring rules" from the "Report type" singleselect
And I press "Add a new rule"
And I set the following fields to these values:
| name | New rule course level |
......
......@@ -465,7 +465,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
When I press "Log in as a guest"
Then I should see "If you continue browsing this website, you agree to our policies"
# Confirm when navigating, the pop-up policies are displayed.
When I follow "Home"
When I am on the "My courses" page
Then I should see "If you continue browsing this website, you agree to our policies"
And I should see "This site policy"
And I should see "This guests policy"
......
......@@ -124,8 +124,7 @@ Feature: Basic recycle bin functionality
Scenario: Show recycle bin on category action menu
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I click on "Actions menu" "link"
And I click on "Recycle bin" "link"
And I navigate to "Recycle bin" in current page administration
Then I should see "There are no items in the recycle bin."
@javascript
......
......@@ -129,16 +129,14 @@ Feature: Upload users
And I press "Upload users"
And I should see "Users created: 4"
And I press "Continue"
And I log out
# Boost check.
And I log in as "jonest"
And I am on "Maths" course homepage
And "Calendar" "link" should be visible
And I log out
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on ".icon[title=Edit]" "css_element" in the "jonest@example.com" "table_row"
And I should see "Boost"
# Classic check.
And I log in as "reznor"
And I am on "Maths" course homepage
And "Calendar" "link" should not be visible
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on ".icon[title=Edit]" "css_element" in the "reznor@example.com" "table_row"
And I should see "Classic"
@javascript
Scenario: Upload users setting their user theme when allowuserthemes is false
......
......@@ -42,6 +42,7 @@ Feature: Confirm that availability_completion works with previous activity setti
# Remove Page 2 and check Page3 depends now on Page1.
When I turn editing mode on
And I change window size to "large"
And I delete "Page2" activity
And I turn editing mode off
Then I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"
......@@ -92,6 +93,7 @@ Feature: Confirm that availability_completion works with previous activity setti
# Test if I disable completion tracking on Page2 section 5 depends on Page2.
When I turn editing mode on
And I change window size to "large"
When I open "Page2" actions menu
And I click on "Edit settings" "link" in the "Page2" activity
And I set the following fields to these values:
......@@ -120,6 +122,7 @@ Feature: Confirm that availability_completion works with previous activity setti
# Remove Page 2 and check Section 4 depends now on Page1.
When I turn editing mode on
And I change window size to "large"
And I delete "Page2" activity
And I turn editing mode off
Then I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"
......@@ -160,6 +163,7 @@ Feature: Confirm that availability_completion works with previous activity setti
Scenario: Test previous activities on empty sections
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I change window size to "large"
# Set section 2 restriction to Previous Activity with completion.
When I edit the section "2"
......
......@@ -88,7 +88,7 @@ Feature: Award badges
# Teacher 1 should have access to manage/create badges in the Badges navigation section.
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Badges"
And I navigate to "Badges > Manage badges" in current page administration
Then I should see "Course Badge 1"
And I should see "Course Badge 2"
And I should see "Manage badges"
......
......@@ -27,8 +27,7 @@ Feature: Award badges based on competency completion
Scenario: Award badge for completing a competency in a course
# Add a competency to the course
When I am on "Course 1" course homepage
And I follow "Competencies"
And I press "Add competencies to course"
And I navigate to "Competencies > Add competencies to course" in current page administration
And "Competency picker" "dialogue" should be visible
And I select "comp1" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
......@@ -58,7 +57,7 @@ Feature: Award badges based on competency completion
And I press "Continue"
# Rate the competency in the course
And I am on "Course 1" course homepage
And I follow "Competencies"
And I navigate to "Competencies" in current page administration
And I click on "comp1" "link" in the "[data-region='coursecompetencies']" "css_element"
And I press "Rate"
And I set the following fields to these values:
......@@ -75,8 +74,7 @@ Feature: Award badges based on competency completion
Scenario: Award badge for completing a competency in the site
# Add a competency to the course
When I am on "Course 1" course homepage
And I follow "Competencies"
And I press "Add competencies to course"
And I navigate to "Competencies > Add competencies to course" in current page administration
And "Competency picker" "dialogue" should be visible
And I select "comp1" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
......@@ -110,7 +108,7 @@ Feature: Award badges based on competency completion
And I press "Continue"
# Rate the competency in the course
And I am on "Course 1" course homepage
And I follow "Competencies"
And I navigate to "Competencies" in current page administration
And I click on "comp1" "link" in the "[data-region='coursecompetencies']" "css_element"
And I press "Rate"
And I set the following fields to these values:
......@@ -127,8 +125,7 @@ Feature: Award badges based on competency completion
Scenario: Award badge for completing all competencies in the site
# Add a competency to the course
When I am on "Course 1" course homepage
And I follow "Competencies"
And I press "Add competencies to course"
And I navigate to "Competencies > Add competencies to course" in current page administration
And "Competency picker" "dialogue" should be visible
And I select "comp1" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
......@@ -164,7 +161,7 @@ Feature: Award badges based on competency completion
And I press "Continue"
# Rate the competency in the course
And I am on "Course 1" course homepage
And I follow "Competencies"
And I navigate to "Competencies" in current page administration
And I click on "comp1" "link" in the "[data-region='coursecompetencies']" "css_element"
And I press "Rate"
And I set the following fields to these values:
......@@ -180,7 +177,7 @@ Feature: Award badges based on competency completion
# Rate the other competency.
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Competencies"
And I navigate to "Competencies" in current page administration
And I click on "comp2" "link" in the "[data-region='coursecompetencies']" "css_element"
And I press "Rate"
And I set the following fields to these values:
......
......@@ -36,7 +36,8 @@ Feature: Enable Block Completion in a course using manual completion by others
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Reports > Course completion" in current page administration
And I navigate to "Reports" in current page administration
And I select "Course completion" from the "Report type" singleselect
And I follow "Click to mark user complete"
# Running completion task just after clicking sometimes fail, as record
# should be created before the task runs.
......@@ -71,7 +72,8 @@ Feature: Enable Block Completion in a course using manual completion by others
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Reports > Course completion" in current page administration
And I navigate to "Reports" in current page administration
And I select "Course completion" from the "Report type" singleselect
And I follow "Click to mark user complete"
And I log out
And I log in as "student1"
......@@ -85,7 +87,8 @@ Feature: Enable Block Completion in a course using manual completion by others
And I log out
And I log in as "teacher2"
And I am on "Course 1" course homepage
And I navigate to "Reports > Course completion" in current page administration
And I navigate to "Reports" in current page administration
And I select "Course completion" from the "Report type" singleselect
And I follow "Click to mark user complete"
# Running completion task just after clicking sometimes fail, as record
# should be created before the task runs.
......
......@@ -9,7 +9,7 @@ Feature: Course summary block used on the frontpage
And I am on site homepage
And I turn editing mode on
And I add the "Course/site summary" block
And I navigate to "Edit settings" in current page administration
And I navigate to "Front page settings" in site administration
And I set the following fields to these values:
| summary | Proved the summary block works! |
And I press "Save changes"
......
......@@ -47,7 +47,7 @@ class behat_blocks extends behat_base {
*/
public function i_add_the_block($blockname) {
$addblock = get_string('addblock');
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
$this->execute('behat_general::i_click_on_in_the', [$addblock, 'link_exact', '.block_fake', 'css_element']);
if (!$this->running_javascript()) {
$this->execute('behat_general::i_click_on_in_the', [$blockname, 'link_exact', '#region-main', 'css_element']);
......@@ -121,7 +121,8 @@ class behat_blocks extends behat_base {
*/
public function the_add_block_selector_should_contain_block($blockname) {
$addblock = get_string('addblock');
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
$this->execute('behat_general::i_click_on', [$addblock, 'link_exact']);
$cancelstr = get_string('cancel');
if (!$this->running_javascript()) {
......@@ -141,7 +142,8 @@ class behat_blocks extends behat_base {
*/
public function the_add_block_selector_should_not_contain_block($blockname) {
$addblock = get_string('addblock');
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
$this->execute('behat_general::i_click_on', [$addblock, 'link_exact']);
$cancelstr = get_string('cancel');
if (!$this->running_javascript()) {
......
......@@ -46,7 +46,7 @@ Feature: Add and configure blocks throughout the site
And I press "Save changes"
And I am on "Course 1" course homepage
# The first block matching the pattern should be top-left block
And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' block ')]" "xpath_element"
And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' block_comments ')]" "xpath_element"
Scenario: Blocks on the dashboard page can have roles assigned to them
Given I log in as "manager1"
......
......@@ -58,7 +58,6 @@ Feature: Block appearances
And I set the following fields to these values:
| Visible | No |
And I press "Save changes"
And I click on "Topic 1" "link"
And I turn editing mode off
And I am on "Course 1" course homepage with editing mode off
And I click on "Test book name" "link" in the "region-main" "region"
Then I should not see "Comments"
......@@ -87,7 +87,8 @@ class behat_completion extends behat_base {
$reportsnode = get_string('reports');
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration",
$reportsnode . ' > ' . $completionnode);
$reportsnode);
$this->execute("behat_forms::i_select_from_the_singleselect", [$completionnode, "Report type"]);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment