course-updates.feature 4.42 KB
Newer Older
1
@shard_2
2
Feature: CMS.Course updates
3 4
    As a course author, I want to be able to provide updates to my students

JonahStanley committed
5 6
    # Internet explorer can't select all so the update appears weirdly
    @skip_internetexplorer
7 8 9
    Scenario: Users can add updates
        Given I have opened a new course in Studio
        And I go to the course updates page
JonahStanley committed
10
        When I add a new update with the text "Hello"
11
        Then I should see the update "Hello"
12
        And I see a "saving" notification
13

JonahStanley committed
14 15
    # Internet explorer can't select all so the update appears weirdly
    @skip_internetexplorer
16 17 18
    Scenario: Users can edit updates
        Given I have opened a new course in Studio
        And I go to the course updates page
JonahStanley committed
19 20
        When I add a new update with the text "Hello"
        And I modify the text to "Goodbye"
21
        Then I should see the update "Goodbye"
22
        And I see a "saving" notification
23 24 25 26

    Scenario: Users can delete updates
        Given I have opened a new course in Studio
        And I go to the course updates page
JonahStanley committed
27 28
        And I add a new update with the text "Hello"
        And I delete the update
29
        And I confirm the prompt
30
        Then I should not see the update "Hello"
31
        And I see a "deleting" notification
32 33 34 35

    Scenario: Users can edit update dates
        Given I have opened a new course in Studio
        And I go to the course updates page
JonahStanley committed
36 37
        And I add a new update with the text "Hello"
        When I edit the date to "June 1, 2013"
38
        Then I should see the date "June 1, 2013"
39
        And I see a "saving" notification
40

JonahStanley committed
41 42
    # Internet explorer can't select all so the update appears weirdly
    @skip_internetexplorer
43 44 45
    Scenario: Users can change handouts
        Given I have opened a new course in Studio
        And I go to the course updates page
JonahStanley committed
46
        When I modify the handout to "<ol>Test</ol>"
47
        Then I see the handout "Test"
48
        And I see a "saving" notification
49

50 51 52 53 54 55 56 57
    Scenario: Text outside of tags is preserved
        Given I have opened a new course in Studio
        And I go to the course updates page
        When I add a new update with the text "before <strong>middle</strong> after"
        Then I should see the update "before <strong>middle</strong> after"
        And when I reload the page
        Then I should see the update "before <strong>middle</strong> after"

58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
    Scenario: Static links are rewritten when previewing a course update
        Given I have opened a new course in Studio
        And I go to the course updates page
        When I add a new update with the text "<img src='/static/my_img.jpg'/>"
        # Can only do partial text matches because of the quotes with in quotes (and regexp step matching).
        Then I should see the update "/c4x/MITx/999/asset/my_img.jpg"
        And I change the update from "/static/my_img.jpg" to "<img src='/static/modified.jpg'/>"
        Then I should see the update "/c4x/MITx/999/asset/modified.jpg"
        And when I reload the page
        Then I should see the update "/c4x/MITx/999/asset/modified.jpg"

    Scenario: Static links are rewritten when previewing handouts
        Given I have opened a new course in Studio
        And I go to the course updates page
        When I modify the handout to "<ol><img src='/static/my_img.jpg'/></ol>"
        # Can only do partial text matches because of the quotes with in quotes (and regexp step matching).
        Then I see the handout "/c4x/MITx/999/asset/my_img.jpg"
        And I change the handout from "/static/my_img.jpg" to "<img src='/static/modified.jpg'/>"
        Then I see the handout "/c4x/MITx/999/asset/modified.jpg"
        And when I reload the page
        Then I see the handout "/c4x/MITx/999/asset/modified.jpg"
79 80 81 82 83 84 85 86 87 88 89 90 91 92

    Scenario: Users cannot save handouts with bad html until edit or update it properly
        Given I have opened a new course in Studio
        And I go to the course updates page
        When I modify the handout to "<p><a href=>[LINK TEXT]</a></p>"
        Then I see the handout error text
        And I see handout save button disabled
        When I edit the handout to "<p><a href='https://www.google.com.pk/'>home</a></p>"
        Then I see handout save button re-enabled
        When I save handout edit
        # Can only do partial text matches because of the quotes with in quotes (and regexp step matching).
        Then I see the handout "https://www.google.com.pk/"
        And when I reload the page
        Then I see the handout "https://www.google.com.pk/"