Skip to content

Instantly share code, notes, and snippets.

@davidscotson
Created February 24, 2016 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidscotson/7288f70302d96bf120f6 to your computer and use it in GitHub Desktop.
Save davidscotson/7288f70302d96bf120f6 to your computer and use it in GitHub Desktop.
@mod @mod_newmodule
Feature: Add a mod_newmodule
In order to <purpose of mod_newmodule>
As a teacher
I need to create a mod_newmodule
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Newmodule" to section "1" and I fill the form with:
| Name | Test newmodule name |
| Description | Test newmodule description |
# add any fields required by mod_newmodule here
And I log out
Scenario: Student view of newmodule
Given I log in as "student1"
And I follow "Course 1"
When I follow "Test newmodule name"
# Modify the following line to suit your module
# see the following examples for ideas:
# mod/quiz/tests/behat/add_quiz.feature
# mod/forum/tests/behat/add_forum.feature
# mod/scorm/tests/behat/add_scorm.feature
Then I should see "Text relevant to mod_newmodule"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment