forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MDL-45289-master' of git://github.com/danpoltawski/moodle
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
blocks/course_summary/tests/behat/block_course_summary_course.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@block @block_course_summary | ||
Feature: Course summary block used in a course | ||
In order to help particpants know the summary of a course | ||
As a teacher | ||
I can add the course summary block to a course page | ||
|
||
Background: | ||
Given the following "courses" exist: | ||
| fullname | shortname | summary | category | | ||
| Course 1 | C101 | Proved the course summary block works! |0 | | ||
And the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| student1 | Sam | Student | student1@asd.com | | ||
| teacher1 | Teacher | One | teacher1@asd.com | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| student1 | C101 | student | | ||
| teacher1 | C101 | editingteacher | | ||
And I log in as "teacher1" | ||
And I follow "Course 1" | ||
And I turn editing mode on | ||
And I add the "Course/site summary" block | ||
And I log out | ||
|
||
Scenario: Student can view course summary | ||
When I log in as "student1" | ||
And I follow "Course 1" | ||
Then "block_course_summary" "block" should exist | ||
And I should see "Proved the course summary block works!" in the "block_course_summary" "block" | ||
|
||
Scenario: Teacher can see an edit icon when edit mode is on and follow it to the course edit page | ||
When I log in as "teacher1" | ||
And I follow "Course 1" | ||
And I turn editing mode on | ||
Then I should see "Proved the course summary block works!" in the "block_course_summary" "block" | ||
And I click on "Edit" "link" in the "block_course_summary" "block" | ||
Then I should see "Edit course settings" in the "h2" "css_element" | ||
|
||
Scenario: Teacher can not see edit icon when edit mode is off | ||
When I log in as "teacher1" | ||
And I follow "Course 1" | ||
Then I should see "Proved the course summary block works!" in the "block_course_summary" "block" | ||
And "Edit" "link" should not exist in the "block_course_summary" "block" |
33 changes: 33 additions & 0 deletions
33
blocks/course_summary/tests/behat/block_course_summary_frontpage.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@block @block_course_summary | ||
Feature: Course summary block used on the frontpage | ||
In order to help particpants know the summary of a site | ||
As admin | ||
I can use the course summary block on the frontpage | ||
|
||
Background: | ||
Given I log in as "admin" | ||
And I navigate to "Edit settings" node in "Front page settings" | ||
And I set the following fields to these values: | ||
| summary | Proved the summary block works! | | ||
And I press "Save changes" | ||
And I log out | ||
# The course summary block a default front page block, so no need to add it. | ||
|
||
Scenario: Guest can view site summary | ||
When I am on homepage | ||
Then "block_course_summary" "block" should exist | ||
And I should see "Proved the summary block works!" in the "block_course_summary" "block" | ||
|
||
Scenario: Admin can see an edit icon when edit mode is on and follow it to the front page settings | ||
When I log in as "admin" | ||
And I am on homepage | ||
And I follow "Turn editing on" | ||
Then I should see "Proved the summary block works!" in the "block_course_summary" "block" | ||
And I click on "Edit" "link" in the "block_course_summary" "block" | ||
Then I should see "Front page settings" in the "h2" "css_element" | ||
|
||
Scenario: Admin can not see edit icon when edit mode is off | ||
When I log in as "teacher1" | ||
And I am on homepage | ||
Then I should see "Proved the summary block works!" in the "block_course_summary" "block" | ||
And "Edit" "link" should not exist in the "block_course_summary" "block" |