1 |
efrain |
1 |
@mod @mod_lesson
|
|
|
2 |
Feature: In a lesson activity, teacher can import embedded images in questions answers and responses
|
|
|
3 |
As a teacher
|
|
|
4 |
I need to import a question with images in answers and responses in a lesson
|
|
|
5 |
|
|
|
6 |
@javascript @_file_upload
|
|
|
7 |
Scenario: Import questions with images in answers and responses in a lesson
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
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 "activity" exists:
|
|
|
20 |
| course | C1 |
|
|
|
21 |
| activity | lesson |
|
|
|
22 |
| name | Test lesson name |
|
|
|
23 |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
24 |
And I follow "Import questions"
|
|
|
25 |
And I set the field "File format" to "Moodle XML format"
|
|
|
26 |
And I upload "mod/lesson/tests/fixtures/multichoice.xml" file to "Upload" filemanager
|
|
|
27 |
And I press "Import"
|
|
|
28 |
Then I should see "Importing 1 questions"
|
|
|
29 |
And I should see " Listen to this greeting:"
|
|
|
30 |
And I should see "What language is being spoken?"
|
|
|
31 |
And I press "Continue"
|
|
|
32 |
And I should see "What language is being spoken?"
|
|
|
33 |
And "//audio[contains(@title, 'Listen to this greeting:')]/source[contains(@src, 'bonjour.mp3')]" "xpath_element" should exist
|
|
|
34 |
And "//*[contains(@class, 'answeroption')]//img[contains(@src, 'pluginfile.php')]" "xpath_element" should exist
|
|
|
35 |
And "//*[contains(@class, 'answeroption')]//img[contains(@src, 'flag-france.jpg')]" "xpath_element" should exist
|