[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/data/tests/behat/ -> add_entries.feature (source)

   1  @mod @mod_data
   2  Feature: Users can add entries to database activities
   3    In order to populate databases
   4    As a user
   5    I need to add entries to databases
   6  
   7    Scenario: Students can add entries to a database
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | student1 | Student | 1 | [email protected] |
  11        | teacher1 | Teacher | 1 | [email protected] |
  12      And the following "courses" exist:
  13        | fullname | shortname | category |
  14        | Course 1 | C1 | 0 |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And the following "activities" exist:
  20        | activity | name               | intro | course | idnumber |
  21        | data     | Test database name | n     | C1     | data1    |
  22      And I log in as "teacher1"
  23      And I follow "Course 1"
  24      And I add a "Text input" field to "Test database name" database and I fill the form with:
  25        | Field name | Test field name |
  26        | Field description | Test field description |
  27      # To generate the default templates.
  28      And I follow "Templates"
  29      And I log out
  30      When I log in as "student1"
  31      And I follow "Course 1"
  32      And I add an entry to "Test database name" database with:
  33        | Test field description | Student original entry |
  34      And I press "Save and view"
  35      Then I should see "Student original entry"
  36      And I follow "Edit"
  37      And I set the following fields to these values:
  38        | Test field description | Student edited entry |
  39      And I press "Save and view"
  40      And I should see "Student edited entry"
  41      And I add an entry to "Test database name" database with:
  42        | Test field description | Student second entry |
  43      And I press "Save and add another"
  44      And I add an entry to "Test database name" database with:
  45        | Test field description | Student third entry |
  46      And I press "Save and view"
  47      And I follow "View list"
  48      And I should see "Student edited entry"
  49      And I should see "Student second entry"
  50      And I should see "Student third entry"
  51      # Will delete the first one.
  52      And I follow "Delete"
  53      And I press "Delete"
  54      And I should not see "Student edited entry"
  55      And I should see "Student second entry"
  56      And I should see "Student third entry"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1