Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_data
2
Feature: Zero state page (no fields created)
3
 
4
  Background:
5
    Given the following "users" exist:
6
      | username | firstname | lastname | email |
7
      | teacher1 | Teacher | 1 | teacher1@example.com |
8
    And the following "courses" exist:
9
      | fullname | shortname | category |
10
      | Course 1 | C1 | 0 |
11
    And the following "course enrolments" exist:
12
      | user | course | role |
13
      | teacher1 | C1 | editingteacher |
14
    And the following "activities" exist:
15
      | activity | name               | intro | course | idnumber |
16
      | data     | Test database name | n     | C1     | data1    |
17
 
18
  Scenario: Teachers see buttons to manage database when there is no field created on view page
19
    Given I am on the "Test database name" "data activity" page logged in as "teacher1"
20
    And "Import a preset" "button" should exist
21
    And I am on the "Test database name" "data activity" page
22
    And "Create a field" "button" should exist
23
    And I click on "Create a field" "button"
24
    And I click on "Short text" "link"
25
    And I should see "Create a field"
26
    And I am on the "Test database name" "data activity" page
27
    And "Use a preset" "button" should exist
28
    And I click on "Use a preset" "button"
29
    And I should see "Presets"
30
 
31
  @javascript
32
  Scenario: Teachers see buttons to manage database when there is no field created on templates page
33
    Given I am on the "Test database name" "data activity" page logged in as "teacher1"
34
    And "Import a preset" "button" should exist
35
    When I click on "Import a preset" "button"
36
    Then I should see "Preset file"
37
    And I am on the "Test database name" "data activity" page
38
    And I click on "Templates" "link"
39
    And "Create a field" "button" should exist
40
    And I click on "Create a field" "button"
41
    And I click on "Short text" "link"
42
    And I should see "Create a field"
43
    And I am on the "Test database name" "data activity" page
44
    And I click on "Templates" "link"
45
    And "Use a preset" "button" should exist
46
    And I click on "Use a preset" "button"
47
    And I should see "Presets"
48
 
49
  @javascript @_file_upload
50
  Scenario: Teachers can import preset from the zero state page
51
    Given I am on the "Test database name" "data activity" page logged in as "teacher1"
52
    And "Import a preset" "button" should exist
53
    When I click on "Import a preset" "button"
54
    And I upload "mod/data/tests/fixtures/image_gallery_preset.zip" file to "Preset file" filemanager
55
    Then I click on "Import preset and apply" "button" in the ".modal-dialog" "css_element"
56
    And I should see "Manage fields"
57
    Then I should see "Preset applied"
58
 
59
  @javascript
60
  Scenario: Teacher can use a preset from zero state page on an empty database
61
    Given I am on the "Test database name" "data activity" page logged in as "teacher1"
62
    And I click on "Use a preset" "button"
63
    And I click on "fullname" "radio" in the "Image gallery" "table_row"
64
    And the "Use this preset" "button" should be enabled
65
    Then I click on "Use this preset" "button"
66
    And I should not see "Field mappings"
67
    And I should see "Image" in the "image" "table_row"
68
 
69
  @javascript @accessibility
70
  Scenario: Check the accessibility of the database activity zero state
71
    When I am on the "Test database name" "data activity" page logged in as "teacher1"
72
    Then I should see "Start building your activity"
73
    And the page should meet accessibility standards