[ Index ]

PHP Cross Reference of Unnamed Project

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    @javascript
   8    Scenario: Students can add entries to a database
   9      Given the following "users" exist:
  10        | username | firstname | lastname | email |
  11        | student1 | Student | 1 | student1@example.com |
  12        | teacher1 | Teacher | 1 | teacher1@example.com |
  13      And the following "courses" exist:
  14        | fullname | shortname | category |
  15        | Course 1 | C1 | 0 |
  16      And the following "course enrolments" exist:
  17        | user | course | role |
  18        | teacher1 | C1 | editingteacher |
  19        | student1 | C1 | student |
  20      And the following "activities" exist:
  21        | activity | name               | intro | course | idnumber |
  22        | data     | Test database name | n     | C1     | data1    |
  23      And I log in as "teacher1"
  24      And I follow "Course 1"
  25      And I add a "Text input" field to "Test database name" database and I fill the form with:
  26        | Field name | Test field name |
  27        | Field description | Test field description |
  28      And I add a "Text input" field to "Test database name" database and I fill the form with:
  29        | Field name | Test field 2 name |
  30        | Field description | Test field 2 description |
  31      # To generate the default templates.
  32      And I follow "Templates"
  33      And I log out
  34      When I log in as "student1"
  35      And I follow "Course 1"
  36      And I add an entry to "Test database name" database with:
  37        | Test field name | Student original entry |
  38        | Test field 2 name | Student original entry 2 |
  39      And I press "Save and view"
  40      Then I should see "Student original entry"
  41      And I follow "Edit"
  42      And I set the following fields to these values:
  43        | Test field name | Student original entry |
  44        | Test field 2 name |  |
  45      And I press "Save and view"
  46      Then I should not see "Student original entry 2"
  47      And I follow "Edit"
  48      And I set the following fields to these values:
  49        | Test field name | Student edited entry |
  50      And I press "Save and view"
  51      And I should see "Student edited entry"
  52      And I add an entry to "Test database name" database with:
  53        | Test field name | Student second entry |
  54      And I press "Save and add another"
  55      And the field "Test field name" does not match value "Student second entry"
  56      And I add an entry to "Test database name" database with:
  57        | Test field name | Student third entry |
  58      And I press "Save and view"
  59      And I follow "View list"
  60      And I should see "Student edited entry"
  61      And I should see "Student second entry"
  62      And I should see "Student third entry"
  63      # Will delete the first one.
  64      And I follow "Delete"
  65      And I press "Delete"
  66      And I should not see "Student edited entry"
  67      And I should see "Student second entry"
  68      And I should see "Student third entry"
  69      # Now I will bulk delete the rest of the entries.
  70      And I log out
  71      And I log in as "teacher1"
  72      And I follow "Course 1"
  73      And I follow "Test database name"
  74      And I press "Select all"
  75      And I press "Delete selected"
  76      And I press "Delete"
  77      And I should see "No entries in database"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1