Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | 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:
11 efrain 13
      | user     | filepath                                   |
14
      | teacher1 | mod/workshop/tests/fixtures/moodlelogo.png |
1 efrain 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 "activities" exist:
22
      | activity | course | name                          |
23
      | workshop | C1     | Workshop with embedded images |
24
    And I am on the "Workshop with embedded images" "workshop activity editing" page logged in as admin
25
    And I set the following fields to these values:
26
      | Instructions for submission format  | 1 |
27
      | Instructions for assessment format  | 1 |
28
      | Conclusion format                   | 1 |
29
    And I press "Save and display"
30
    And I log out
31
    When I log in as "teacher1"
32
    # Edit the workshop.
33
    And I am on the "Workshop with embedded images" "workshop activity editing" page
34
    And I expand all fieldsets
35
    And I click on "Image" "button" in the "Instructions for submission" "form_row"
36
    And I click on "Browse repositories" "button"
37
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
38
    And I click on "moodlelogo.png" "link"
39
    And I click on "Select this file" "button"
11 efrain 40
    And I set the field "How would you describe this image to someone who can't see it?" to "How to submit"
1 efrain 41
    And I click on "Save" "button" in the "Image details" "dialogue"
42
    And I press "Save and display"
43
    # Embed the image into Instructions for assessment.
44
    And I navigate to "Settings" in current page administration
45
    And I expand all fieldsets
46
    And I click on "Image" "button" in the "Instructions for assessment" "form_row"
47
    And I click on "Browse repositories" "button"
48
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
49
    And I click on "moodlelogo.png" "link"
50
    And I click on "Select this file" "button"
11 efrain 51
    And I set the field "How would you describe this image to someone who can't see it?" to "How to assess"
1 efrain 52
    And I click on "Save" "button" in the "Image details" "dialogue"
53
    And I press "Save and display"
54
    # Embed the image into Conclusion.
55
    And I navigate to "Settings" in current page administration
56
    And I expand all fieldsets
57
    And I click on "Image" "button" in the "Conclusion" "form_row"
58
    And I click on "Browse repositories" "button"
59
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
60
    And I click on "moodlelogo.png" "link"
61
    And I click on "Select this file" "button"
11 efrain 62
    And I set the field "How would you describe this image to someone who can't see it?" to "Well done"
1 efrain 63
    And I click on "Save" "button" in the "Image details" "dialogue"
64
    And I press "Save and display"
65
    # Save the form and check the images are displayed in appropriate phases.
66
    And I change phase in workshop "Workshop with embedded images" to "Submission phase"
67
    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
68
    And I change phase in workshop "Workshop with embedded images" to "Assessment phase"
69
    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
70
    And I change phase in workshop "Workshop with embedded images" to "Closed"
71
    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