markdown_render.feature 5.82 KB
Newer Older
1
Feature: Project Source Markdown Render
2 3 4
  Background:
    Given I sign in as a user
    And I own project "Delta"
5
    And I visit markdown branch
6

7
  # Tree README
8

Douwe Maan's avatar
Douwe Maan committed
9
  @javascript
10 11 12 13 14
  Scenario: Tree view should have correct links in README
    Given I go directory which contains README file
    And I click on a relative link in README
    Then I should see the correct markdown

Douwe Maan's avatar
Douwe Maan committed
15
  @javascript
16 17
  Scenario: I browse files from markdown branch
    Then I should see files from repository in markdown
18 19 20 21
    And I should see rendered README which contains correct links
    And I click on Gitlab API in README
    Then I should see correct document rendered

22 23
  Scenario: I view README in markdown branch
    Then I should see files from repository in markdown
24 25 26 27
    And I should see rendered README which contains correct links
    And I click on Rake tasks in README
    Then I should see correct directory rendered

28 29
  Scenario: I view README in markdown branch to see reference links to directory
    Then I should see files from repository in markdown
30 31 32 33
    And I should see rendered README which contains correct links
    And I click on GitLab API doc directory in README
    Then I should see correct doc/api directory rendered

Douwe Maan's avatar
Douwe Maan committed
34
  @javascript
35 36
  Scenario: I view README in markdown branch to see reference links to file
    Then I should see files from repository in markdown
37 38 39 40
    And I should see rendered README which contains correct links
    And I click on Maintenance in README
    Then I should see correct maintenance file rendered

Douwe Maan's avatar
Douwe Maan committed
41
  @javascript
42 43 44 45
  Scenario: README headers should have header links
    Then I should see rendered README which contains correct links
    And Header "Application details" should have correct id and link

46
  # Blob
47

Douwe Maan's avatar
Douwe Maan committed
48
  @javascript
49
  Scenario: I navigate to doc directory to view documentation in markdown
50 51 52 53 54
    And I navigate to the doc/api/README
    And I see correct file rendered
    And I click on users in doc/api/README
    Then I should see the correct document file

Douwe Maan's avatar
Douwe Maan committed
55
  @javascript
56
  Scenario: I navigate to doc directory to view user doc in markdown
57 58 59 60 61
    And I navigate to the doc/api/README
    And I see correct file rendered
    And I click on raketasks in doc/api/README
    Then I should see correct directory rendered

Douwe Maan's avatar
Douwe Maan committed
62
  @javascript
63
  Scenario: I navigate to doc directory to view user doc in markdown
64 65 66
    And I navigate to the doc/api/README
    And Header "GitLab API" should have correct id and link

67
  # Markdown branch
68

Douwe Maan's avatar
Douwe Maan committed
69
  @javascript
70 71 72 73 74 75 76 77 78 79 80 81 82 83
  Scenario: I browse files from markdown branch
    When I visit markdown branch
    Then I should see files from repository in markdown branch
    And I should see rendered README which contains correct links
    And I click on Gitlab API in README
    Then I should see correct document rendered for markdown branch

  Scenario: I browse directory from markdown branch
    When I visit markdown branch
    Then I should see files from repository in markdown branch
    And I should see rendered README which contains correct links
    And I click on Rake tasks in README
    Then I should see correct directory rendered for markdown branch

Douwe Maan's avatar
Douwe Maan committed
84
  @javascript
85 86 87 88 89 90 91
  Scenario: I navigate to doc directory to view documentation in markdown branch
    When I visit markdown branch
    And I navigate to the doc/api/README
    And I see correct file rendered in markdown branch
    And I click on users in doc/api/README
    Then I should see the users document file in markdown branch

Douwe Maan's avatar
Douwe Maan committed
92
  @javascript
93 94 95 96 97 98 99
  Scenario: I navigate to doc directory to view user doc in markdown branch
    When I visit markdown branch
    And I navigate to the doc/api/README
    And I see correct file rendered in markdown branch
    And I click on raketasks in doc/api/README
    Then I should see correct directory rendered for markdown branch

Douwe Maan's avatar
Douwe Maan committed
100
  @javascript
101 102 103 104 105 106 107 108 109 110 111 112
  Scenario: Tree markdown links view empty urls should have correct urls
    When I visit markdown branch
    Then The link with text "empty" should have url "tree/markdown"
    When I visit markdown branch "README.md" blob
    Then The link with text "empty" should have url "blob/markdown/README.md"
    When I visit markdown branch "d" tree
    Then The link with text "empty" should have url "tree/markdown/d"
    When I visit markdown branch "d/README.md" blob
    Then The link with text "empty" should have url "blob/markdown/d/README.md"

  # "ID" means "#id" on the tests below, because we are unable to escape the hash sign.
  # which Spinach interprets as the start of a comment.
Douwe Maan's avatar
Douwe Maan committed
113
  @javascript
114 115 116 117 118 119 120 121 122 123 124 125
  Scenario: All markdown links with ids should have correct urls
    When I visit markdown branch
    Then The link with text "ID" should have url "tree/markdownID"
    Then The link with text "/ID" should have url "tree/markdownID"
    Then The link with text "README.mdID" should have url "blob/markdown/README.mdID"
    Then The link with text "d/README.mdID" should have url "blob/markdown/d/README.mdID"
    When I visit markdown branch "README.md" blob
    Then The link with text "ID" should have url "blob/markdown/README.mdID"
    Then The link with text "/ID" should have url "blob/markdown/README.mdID"
    Then The link with text "README.mdID" should have url "blob/markdown/README.mdID"
    Then The link with text "d/README.mdID" should have url "blob/markdown/d/README.mdID"

126 127
  # Wiki

128 129 130 131 132 133 134 135 136 137 138 139
  Scenario: I create a wiki page with different links
    Given I go to wiki page
    And I add various links to the wiki page
    Then Wiki page should have added links
    And I click on test link
    Then I see new wiki page named test
    When I go back to wiki page home
    And I click on GitLab API doc link
    Then I see Gitlab API document
    When I go back to wiki page home
    And I click on Rake tasks link
    Then I see Rake tasks directory
140

141 142 143 144
  Scenario: Wiki headers should have should have ids generated for them.
    Given I go to wiki page
    And I add a header to the wiki page
    Then Wiki header should have correct id and link