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: Users can view the list of data activities and their formatted descriptions
3
 
4
  Background:
5
    Given the following "users" exist:
6
      | username | firstname | lastname | email                |
7
      | student1 | Bob       | 1        | student1@example.com |
8
      | teacher1 | Teacher   | 1        | teacher1@example.com |
9
    And the following "courses" exist:
10
      | fullname | shortname | category |
11
      | Course 1 | C1        | 0        |
12
    And the following "course enrolments" exist:
13
      | user     | course | role           |
14
      | teacher1 | C1     | editingteacher |
15
      | student1 | C1     | student        |
16
    And the following "activities" exist:
17
      | activity | name            | intro                                                                     | course | idnumber |
18
      | data     | Test database 1 | This is an intro without an image                                         | C1     | data1    |
19
      | data     | Test database 2 | This is an intro with an image: <img src="@@PLUGINFILE@@/some_image.jpg"> | C1     | data2    |
20
    And the following "blocks" exist:
21
      | blockname        | contextlevel | reference | pagetypepattern | defaultregion |
22
      | activity_modules | Course       | C1        | course-view-*   | side-pre      |
23
 
24
  Scenario: Teachers can view the list of data activities and their formatted descriptions
25
    Given I am on the "Course 1" course page logged in as teacher1
26
    When I follow "Databases"
27
    Then I should see "Test database 1"
28
    And I should see "Test database 2"
29
    And I should see "This is an intro without an image"
30
    And I should see "This is an intro with an image: "
31
    And "//img[contains(@src, 'some_image.jpg')]" "xpath_element" should exist
32
    And "//img[contains(@src, '@@PLUGINFILE@@/some_image.jpg')]" "xpath_element" should not exist
33
 
34
  Scenario: Students can view the list of data activities and their formatted descriptions
35
    Given I am on the "Course 1" course page logged in as student1
36
    When I follow "Databases"
37
    Then I should see "Test database 1"
38
    And I should see "Test database 2"
39
    And I should see "This is an intro without an image"
40
    And I should see "This is an intro with an image: "
41
    And "//img[contains(@src, 'some_image.jpg')]" "xpath_element" should exist
42
    And "//img[contains(@src, '@@PLUGINFILE@@/some_image.jpg')]" "xpath_element" should not exist