Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_workshop @javascript
2
Feature: Teachers can embed images into instructions and conclusion fields
3
  In order to display images as a part of instructions or conclusions in the workshop
4
  As a teacher
5
  I need to be able to embed images into the fields and they should display correctly
6
 
7
  @editor_tiny
8
  Scenario: Embedding the image into the instructions and conclusions fields
9
    Given the following "users" exist:
10
      | username | firstname | lastname | email                |
11
      | teacher1 | Teacher   | One      | teacher1@example.com |
12
    And the following "user private files" exist:
13
      | user     | filepath                                   | filename       |
14
      | teacher1 | mod/workshop/tests/fixtures/moodlelogo.png | moodlelogo.png |
15
    And the following "courses" exist:
16
      | fullname | shortname |
17
      | Course 1 | C1        |
18
    And the following "course enrolments" exist:
19
      | user     | course | role           |
20
      | teacher1 | C1     | editingteacher |
21
    And the following "blocks" exist:
22
      | blockname     | contextlevel | reference | pagetypepattern | defaultregion |
23
      | private_files | System       | 1         | my-index        | side-post     |
24
    And the following "activities" exist:
25
      | activity | course | name                          |
26
      | workshop | C1     | Workshop with embedded images |
27
    And I am on the "Workshop with embedded images" "workshop activity editing" page logged in as admin
28
    And I set the following fields to these values:
29
      | Instructions for submission format  | 1 |
30
      | Instructions for assessment format  | 1 |
31
      | Conclusion format                   | 1 |
32
    And I press "Save and display"
33
    And I log out
34
    When I log in as "teacher1"
35
    # Edit the workshop.
36
    And I am on the "Workshop with embedded images" "workshop activity editing" page
37
    And I expand all fieldsets
38
    And I click on "Image" "button" in the "Instructions for submission" "form_row"
39
    And I click on "Browse repositories" "button"
40
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
41
    And I click on "moodlelogo.png" "link"
42
    And I click on "Select this file" "button"
43
    And I set the field "How would you describe this image to someone who can't see it:" to "How to submit"
44
    And I click on "Save" "button" in the "Image details" "dialogue"
45
    And I press "Save and display"
46
    # Embed the image into Instructions for assessment.
47
    And I navigate to "Settings" in current page administration
48
    And I expand all fieldsets
49
    And I click on "Image" "button" in the "Instructions for assessment" "form_row"
50
    And I click on "Browse repositories" "button"
51
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
52
    And I click on "moodlelogo.png" "link"
53
    And I click on "Select this file" "button"
54
    And I set the field "How would you describe this image to someone who can't see it:" to "How to assess"
55
    And I click on "Save" "button" in the "Image details" "dialogue"
56
    And I press "Save and display"
57
    # Embed the image into Conclusion.
58
    And I navigate to "Settings" in current page administration
59
    And I expand all fieldsets
60
    And I click on "Image" "button" in the "Conclusion" "form_row"
61
    And I click on "Browse repositories" "button"
62
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
63
    And I click on "moodlelogo.png" "link"
64
    And I click on "Select this file" "button"
65
    And I set the field "How would you describe this image to someone who can't see it:" to "Well done"
66
    And I click on "Save" "button" in the "Image details" "dialogue"
67
    And I press "Save and display"
68
    # Save the form and check the images are displayed in appropriate phases.
69
    And I change phase in workshop "Workshop with embedded images" to "Submission phase"
70
    Then "//*[contains(@class, 'instructions')]//img[contains(@src, 'pluginfile.php') and contains(@src, '/mod_workshop/instructauthors/moodlelogo.png') and @alt='How to submit']" "xpath_element" should exist
71
    And I change phase in workshop "Workshop with embedded images" to "Assessment phase"
72
    Then "//*[contains(@class, 'instructions')]//img[contains(@src, 'pluginfile.php') and contains(@src, '/mod_workshop/instructreviewers/moodlelogo.png') and @alt='How to assess']" "xpath_element" should exist
73
    And I change phase in workshop "Workshop with embedded images" to "Closed"
74
    Then "//*[contains(@class, 'conclusion')]//img[contains(@src, 'pluginfile.php') and contains(@src, '/mod_workshop/conclusion/moodlelogo.png') and @alt='Well done']" "xpath_element" should exist