MDL-49689 navigation: Behat tests for default home page
authorAdrian Greeve <adrian@moodle.com>
Thu, 9 Apr 2015 06:40:56 +0000 (14:40 +0800)
committerAdrian Greeve <adrian@moodle.com>
Mon, 13 Apr 2015 07:54:24 +0000 (15:54 +0800)
Part of MDL-45774.

user/tests/behat/set_default_homepage.feature [new file with mode: 0644]

diff --git a/user/tests/behat/set_default_homepage.feature b/user/tests/behat/set_default_homepage.feature
new file mode 100644 (file)
index 0000000..7358ca7
--- /dev/null
@@ -0,0 +1,28 @@
+@core @core_user
+Feature: Set the site home page and dashboard as the default home page
+  In order to set a page as my default home page
+  As a user
+  I need to go to the page I want and set it as my home page
+
+  Background:
+    Given the following "courses" exist:
+      | fullname | shortname | category | groupmode |
+      | Course 1 | C1 | 0 | 1 |
+
+  Scenario: Admin sets the site page and then the dashboard as the default home page
+    Given I log in as "admin"
+    And I navigate to "Navigation" node in "Site administration > Appearance"
+    And I set the field "Default home page for users" to "User preference"
+    And I press "Save changes"
+    And I am on site homepage
+    And I follow "Make this my default home page"
+    And I should not see "Make this my default home page"
+    And I follow "Course 1"
+    And "//ul[@class='breadcrumb']/li/a[text()='Home']" "xpath_element" should exist
+    And I am on site homepage
+    And I follow "Dashboard"
+    And I follow "Make this my default home page"
+    And I should not see "Make this my default home page"
+    And I am on site homepage
+    When I follow "Course 1"
+    Then "//ul[@class='breadcrumb']/li/a[text()='Dashboard']" "xpath_element" should exist