From 07fd6882b832f599ace453fd77d510ab29e5faaa Mon Sep 17 00:00:00 2001 From: David Monllao Date: Thu, 11 Apr 2013 15:41:47 +0800 Subject: [PATCH] MDL-38963 behat: New test According to MDLQA-113, a teacher can set a wiki to be collaborative or individual. --- .../behat/collaborative_individual.feature | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 mod/wiki/tests/behat/collaborative_individual.feature diff --git a/mod/wiki/tests/behat/collaborative_individual.feature b/mod/wiki/tests/behat/collaborative_individual.feature new file mode 100644 index 00000000000..d48375fa69c --- /dev/null +++ b/mod/wiki/tests/behat/collaborative_individual.feature @@ -0,0 +1,90 @@ +@mod_wiki @mod +Feature: A teacher can set a wiki to be collaborative or individual + In order to allow both collaborative wikis and individual journals with history register + As a teacher + I need to select whether the wiki is collaborative or individual + + @javascript + Scenario: Collaborative and individual wikis + Given the following "users" exists: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@asd.com | + | student1 | Student | 1 | student1@asd.com | + | student2 | Student | 2 | student2@asd.com | + And the following "courses" exists: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And the following "course enrolments" exists: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + | student2 | C1 | student | + And I log in as "teacher1" + And I follow "Course 1" + And I turn editing mode on + And I add a "Wiki" to section "1" and I fill the form with: + | Wiki name | Collaborative wiki name | + | Description | Collaborative wiki description | + | First page name | Collaborative index | + | Wiki mode | Collaborative wiki | + And I follow "Collaborative wiki name" + And I press "Create page" + And I fill the moodle form with: + | HTML format | Collaborative teacher1 edition | + And I press "Save" + And I follow "Course 1" + And I add a "Wiki" to section "1" and I fill the form with: + | Wiki name | Individual wiki name | + | Description | Individual wiki description | + | First page name | Individual index | + | Wiki mode | Individual wiki | + And I follow "Individual wiki name" + And I press "Create page" + And I fill the moodle form with: + | HTML format | Individual teacher1 edition | + And I press "Save" + And I log out + And I log in as "student1" + And I follow "Course 1" + When I follow "Collaborative wiki name" + Then I should see "Collaborative teacher1 edition" + And I follow "Edit" + And I fill the moodle form with: + | HTML format | Collaborative student1 edition | + And I press "Save" + And I should not see "Collaborative teacher1 edition" + And I should see "Collaborative student1 edition" + And I follow "Course 1" + And I follow "Individual wiki name" + And I should not see "Individual teacher1 edition" + And I press "Create page" + And I fill the moodle form with: + | HTML format | Individual student1 edition | + And I press "Save" + And I log out + And I log in as "student2" + And I follow "Course 1" + And I follow "Individual wiki name" + And I should not see "Individual teacher1 edition" + And I should not see "Individual student1 edition" + And I press "Create page" + And I fill the moodle form with: + | HTML format | Individual student2 edition | + And I press "Save" + And I log out + And I log in as "teacher1" + And I follow "Course 1" + And I follow "Collaborative wiki name" + And I should see "Collaborative student1 edition" + And I follow "Course 1" + And I follow "Individual wiki name" + And I should see "Individual teacher1 edition" + And I should not see "Individual student1 edition" + And I select "Student 1" from "uid" + And I should see "Individual student1 edition" + And I should not see "Individual teacher1 edition" + And I select "Student 2" from "uid" + And I should see "Individual student2 edition" + And I should not see "Individual teacher1 edition" + +