From 739ac54ab0003ae5519c00b76c3d5c3e36b0359a Mon Sep 17 00:00:00 2001 From: David Monllao <davidm@moodle.com> Date: Fri, 22 Mar 2013 12:44:22 +0800 Subject: [PATCH] MDL-38622 behat: New tests Navigation works correctly in paged mode, according to MDLQA-1633, MDLQA-1639, MDLQA-1645, MDLQA-1646, MDLQA-1647, MDLQA-1648, MDLQA-1649, MDLQA-1651, MDLQA-1652, MDLQA-1653, MDLQA-1654 and MDLQA-1655. --- .../behat/paged_course_navigation.feature | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 course/tests/behat/paged_course_navigation.feature diff --git a/course/tests/behat/paged_course_navigation.feature b/course/tests/behat/paged_course_navigation.feature new file mode 100644 index 00000000000..f7268b6cca4 --- /dev/null +++ b/course/tests/behat/paged_course_navigation.feature @@ -0,0 +1,72 @@ +@core_course +Feature: Course paged mode + In order to split the course in parts + As a moodle teacher + I need to display the course in a paged mode and navigate through the different sections + + @javascript @_cross_browser + Scenario Outline: Weekly and topics course formats with Javascript enabled + Given the following "courses" exists: + | fullname | shortname | category | format | coursedisplay | numsections | + | Course 1 | C1 | 0 | <courseformat> | 1 | 3 | + And I log in as "admin" + And I follow "Course 1" + Then I click on <section2> "link" in the "#section-2" "css_element" + And I follow "C1" + And I click on <section3> "link" in the "#section-3" "css_element" + And I follow "C1" + And I click on <section1> "link" in the "#section-1" "css_element" + And I should see <section1> in the "div.single-section div.header" "css_element" + And I should see <section2> in the ".single-section span.mdl-right" "css_element" + And I should not see <prevunexistingsection> in the ".single-section" "css_element" + And I click on <section2> "link" in the ".single-section" "css_element" + And I should see <section2> in the "div.single-section div.header" "css_element" + And I should see <section1> in the ".single-section span.mdl-left" "css_element" + And I should see <section3> in the ".single-section span.mdl-right" "css_element" + And I click on <section1> "link" in the ".single-section" "css_element" + And I should see <section1> in the "div.single-section div.header" "css_element" + And I click on <section2> "link" in the ".single-section" "css_element" + And I click on <section3> "link" in the ".single-section" "css_element" + And I should see <section3> in the "div.single-section div.header" "css_element" + And I should see <section2> in the ".single-section span.mdl-left" "css_element" + And I should not see <section1> in the ".single-section .section-navigation" "css_element" + And I should not see <prevunexistingsection> in the ".single-section" "css_element" + And I should not see <nextunexistingsection> in the ".single-section" "css_element" + + Examples: + | courseformat | section1 | section2 | section3 | prevunexistingsection | nextunexistingsection | + | topics | "Topic 1" | "Topic 2" | "Topic 3" | "Topic 0" | "Topic 4" | + | weeks | "1 January - 7 January" | "8 January - 14 January" | "15 January - 21 January" | "25 December - 31 December" | "22 January - 28 January" | + + Scenario Outline: Weekly and topics course formats with Javascript disabled + Given the following "courses" exists: + | fullname | shortname | category | format | coursedisplay | numsections | + | Course 1 | C1 | 0 | <courseformat> | 1 | 3 | + And I log in as "admin" + And I follow "Course 1" + Then I click on <section2> "link" in the "#section-2" "css_element" + And I follow "C1" + And I click on <section3> "link" in the "#section-3" "css_element" + And I follow "C1" + And I click on <section1> "link" in the "#section-1" "css_element" + And I should see <section1> in the "div.single-section div.header" "css_element" + And I should see <section2> in the ".single-section span.mdl-right" "css_element" + And I should not see <prevunexistingsection> in the ".single-section" "css_element" + And I click on <section2> "link" in the ".single-section" "css_element" + And I should see <section2> in the "div.single-section div.header" "css_element" + And I should see <section1> in the ".single-section span.mdl-left" "css_element" + And I should see <section3> in the ".single-section span.mdl-right" "css_element" + And I click on <section1> "link" in the ".single-section" "css_element" + And I should see <section1> in the "div.single-section div.header" "css_element" + And I click on <section2> "link" in the ".single-section" "css_element" + And I click on <section3> "link" in the ".single-section" "css_element" + And I should see <section3> in the "div.single-section div.header" "css_element" + And I should see <section2> in the ".single-section span.mdl-left" "css_element" + And I should not see <section1> in the ".single-section .section-navigation" "css_element" + And I should not see <prevunexistingsection> in the ".single-section" "css_element" + And I should not see <nextunexistingsection> in the ".single-section" "css_element" + + Examples: + | courseformat | section1 | section2 | section3 | prevunexistingsection | nextunexistingsection | + | topics | "Topic 1" | "Topic 2" | "Topic 3" | "Topic 0" | "Topic 4" | + | weeks | "1 January - 7 January" | "8 January - 14 January" | "15 January - 21 January" | "25 December - 31 December" | "22 January - 28 January" |