MDL-69752 mod_data: Format module intro on Database activities page
[moodle.git] / mod / data / tests / behat / data_activities.feature
CommitLineData
0f7c2b92
MG
1@mod @mod_data
2Feature: 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 I log in as "admin"
21 And I am on "Course 1" course homepage with editing mode on
22 And I add the "Activities" block
23 And I log out
24
25 Scenario: Teachers can view the list of data activities and their formatted descriptions
26 Given I log in as "teacher1"
27 And I am on "Course 1" course homepage
28 When I follow "Databases"
29 Then I should see "Test database 1"
30 And I should see "Test database 2"
31 And I should see "This is an intro without an image"
32 And I should see "This is an intro with an image: "
33 And "//img[contains(@src, 'some_image.jpg')]" "xpath_element" should exist
34 And "//img[contains(@src, '@@PLUGINFILE@@/some_image.jpg')]" "xpath_element" should not exist
35 And I log out
36
37 Scenario: Students can view the list of data activities and their formatted descriptions
38 Given I log in as "student1"
39 And I am on "Course 1" course homepage
40 When I follow "Databases"
41 Then I should see "Test database 1"
42 And I should see "Test database 2"
43 And I should see "This is an intro without an image"
44 And I should see "This is an intro with an image: "
45 And "//img[contains(@src, 'some_image.jpg')]" "xpath_element" should exist
46 And "//img[contains(@src, '@@PLUGINFILE@@/some_image.jpg')]" "xpath_element" should not exist
47 And I log out