diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/project/builds/artifacts.feature | 65 | ||||
-rw-r--r-- | features/project/commits/commits.feature | 96 | ||||
-rw-r--r-- | features/project/source/markdown_render.feature | 147 | ||||
-rw-r--r-- | features/steps/project/builds/artifacts.rb | 98 | ||||
-rw-r--r-- | features/steps/project/commits/commits.rb | 192 | ||||
-rw-r--r-- | features/steps/project/deploy_keys.rb | 7 | ||||
-rw-r--r-- | features/steps/project/forked_merge_requests.rb | 2 | ||||
-rw-r--r-- | features/steps/project/source/markdown_render.rb | 317 | ||||
-rw-r--r-- | features/steps/shared/builds.rb | 53 | ||||
-rw-r--r-- | features/steps/shared/group.rb | 4 | ||||
-rw-r--r-- | features/steps/shared/markdown.rb | 9 | ||||
-rw-r--r-- | features/steps/shared/paths.rb | 4 |
12 files changed, 7 insertions, 987 deletions
diff --git a/features/project/builds/artifacts.feature b/features/project/builds/artifacts.feature deleted file mode 100644 index 5abc24949cf..00000000000 --- a/features/project/builds/artifacts.feature +++ /dev/null @@ -1,65 +0,0 @@ -Feature: Project Builds Artifacts - Background: - Given I sign in as a user - And I own a project - And project has CI enabled - And project has a recent build - - Scenario: I download build artifacts - Given recent build has artifacts available - When I visit recent build details page - And I click artifacts download button - Then download of build artifacts archive starts - - Scenario: I browse build artifacts - Given recent build has artifacts available - And recent build has artifacts metadata available - When I visit recent build details page - And I click artifacts browse button - Then I should see content of artifacts archive - And I should see the build header - - Scenario: I browse subdirectory of build artifacts - Given recent build has artifacts available - And recent build has artifacts metadata available - When I visit recent build details page - And I click artifacts browse button - And I click link to subdirectory within build artifacts - Then I should see content of subdirectory within artifacts archive - And I should see the directory name in the breadcrumb - - Scenario: I browse directory with UTF-8 characters in name - Given recent build has artifacts available - And recent build has artifacts metadata available - And recent build artifacts contain directory with UTF-8 characters - When I visit recent build details page - And I click artifacts browse button - And I navigate to directory with UTF-8 characters in name - Then I should see content of directory with UTF-8 characters in name - - Scenario: I try to browse directory with invalid UTF-8 characters in name - Given recent build has artifacts available - And recent build has artifacts metadata available - And recent build artifacts contain directory with invalid UTF-8 characters - When I visit recent build details page - And I click artifacts browse button - And I navigate to parent directory of directory with invalid name - Then I should not see directory with invalid name on the list - - @javascript - Scenario: I download a single file from build artifacts - Given recent build has artifacts available - And recent build has artifacts metadata available - When I visit recent build details page - And I click artifacts browse button - And I click a link to file within build artifacts - Then I see a download link - - @javascript - Scenario: I click on a row in an artifacts table - Given recent build has artifacts available - And recent build has artifacts metadata available - When I visit recent build details page - And I click artifacts browse button - And I click a first row within build artifacts table - Then page with a coresponding path is loading diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature deleted file mode 100644 index 3459cce03f9..00000000000 --- a/features/project/commits/commits.feature +++ /dev/null @@ -1,96 +0,0 @@ -@project_commits -Feature: Project Commits - Background: - Given I sign in as a user - And I own a project - And I visit my project's commits page - - Scenario: I browse commits list for master branch - Then I see project commits - And I should not see button to create a new merge request - Then I click the "Compare" tab - And I should not see button to create a new merge request - - Scenario: I browse commits list for feature branch without a merge request - Given I visit commits list page for feature branch - Then I see feature branch commits - And I see button to create a new merge request - Then I click the "Compare" tab - And I see button to create a new merge request - - Scenario: I browse commits list for feature branch with an open merge request - Given project have an open merge request - And I visit commits list page for feature branch - Then I see feature branch commits - And I should not see button to create a new merge request - And I should see button to the merge request - Then I click the "Compare" tab - And I should not see button to create a new merge request - And I should see button to the merge request - - Scenario: I browse atom feed of commits list for master branch - Given I click atom feed link - Then I see commits atom feed - - Scenario: I browse commit from list - Given I click on commit link - Then I see commit info - And I see side-by-side diff button - - Scenario: I browse commit from list and create a new tag - Given I click on commit link - And I click on tag link - Then I see commit SHA pre-filled - - Scenario: I browse commit with ci from list - Given commit has ci status - And repository contains ".gitlab-ci.yml" file - When I click on commit link - Then I see commit ci info - - Scenario: I browse commit with side-by-side diff view - Given I click on commit link - And I click side-by-side diff button - Then I see inline diff button - - @javascript - Scenario: I compare branches without a merge request - Given I visit compare refs page - And I fill compare fields with branches - Then I see compared branches - And I see button to create a new merge request - - @javascript - Scenario: I compare branches with an open merge request - Given project have an open merge request - And I visit compare refs page - And I fill compare fields with branches - Then I see compared branches - And I should not see button to create a new merge request - And I should see button to the merge request - - @javascript - Scenario: I compare refs - Given I visit compare refs page - And I fill compare fields with refs - Then I see compared refs - And I unfold diff - Then I should see additional file lines - - Scenario: I browse commits for a specific path - Given I visit my project's commits page for a specific path - Then I see breadcrumb links - - # TODO: Implement feature in graphs - #Scenario: I browse commits stats - #Given I visit my project's commits stats page - #Then I see commits stats - - Scenario: I browse a commit with an image - Given I visit a commit with an image that changed - Then The diff links to both the previous and current image - - @javascript - Scenario: I filter commits by message - When I search "submodules" commits - Then I should see only "submodules" commits diff --git a/features/project/source/markdown_render.feature b/features/project/source/markdown_render.feature deleted file mode 100644 index fe4466ad241..00000000000 --- a/features/project/source/markdown_render.feature +++ /dev/null @@ -1,147 +0,0 @@ -Feature: Project Source Markdown Render - Background: - Given I sign in as a user - And I own project "Delta" - And I visit markdown branch - - # Tree README - - @javascript - 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 - - @javascript - Scenario: I browse files from markdown branch - Then I should see files from repository in markdown - 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 - - @javascript - Scenario: I view README in markdown branch - Then I should see files from repository in markdown - 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 - - @javascript - Scenario: I view README in markdown branch to see reference links to directory - Then I should see files from repository in markdown - 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 - - @javascript - Scenario: I view README in markdown branch to see reference links to file - Then I should see files from repository in markdown - 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 - - @javascript - 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 - - # Blob - - @javascript - Scenario: I navigate to doc directory to view documentation in markdown - 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 - - @javascript - Scenario: I navigate to doc directory to view user doc in markdown - 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 - - @javascript - Scenario: I navigate to doc directory to view user doc in markdown - And I navigate to the doc/api/README - And Header "GitLab API" should have correct id and link - - # Markdown branch - - @javascript - 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 - - @javascript - 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 - - @javascript - 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 - - @javascript - 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 - - @javascript - 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. - @javascript - 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" - - # Wiki - - 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 - - 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 diff --git a/features/steps/project/builds/artifacts.rb b/features/steps/project/builds/artifacts.rb deleted file mode 100644 index 4b72355b125..00000000000 --- a/features/steps/project/builds/artifacts.rb +++ /dev/null @@ -1,98 +0,0 @@ -class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedBuilds - include RepoHelpers - include WaitForRequests - - step 'I click artifacts download button' do - click_link 'Download' - end - - step 'I click artifacts browse button' do - click_link 'Browse' - expect(page).not_to have_selector('.build-sidebar') - end - - step 'I should see content of artifacts archive' do - page.within('.tree-table') do - expect(page).to have_no_content '..' - expect(page).to have_content 'other_artifacts_0.1.2' - expect(page).to have_content 'ci_artifacts.txt' - expect(page).to have_content 'rails_sample.jpg' - end - end - - step 'I should see the build header' do - page.within('.build-header') do - expect(page).to have_content "Job ##{@build.id} in pipeline ##{@pipeline.id} for #{@pipeline.short_sha}" - end - end - - step 'I click link to subdirectory within build artifacts' do - page.within('.tree-table') { click_link 'other_artifacts_0.1.2' } - end - - step 'I should see content of subdirectory within artifacts archive' do - page.within('.tree-table') do - expect(page).to have_content '..' - expect(page).to have_content 'another-subdirectory' - expect(page).to have_content 'doc_sample.txt' - end - end - - step 'I should see the directory name in the breadcrumb' do - page.within('.repo-breadcrumb') do - expect(page).to have_content 'other_artifacts_0.1.2' - end - end - - step 'recent build artifacts contain directory with UTF-8 characters' do - # metadata fixture contains relevant directory - end - - step 'I navigate to directory with UTF-8 characters in name' do - page.within('.tree-table') { click_link 'tests_encoding' } - page.within('.tree-table') { click_link 'utf8 test dir ✓' } - end - - step 'I should see content of directory with UTF-8 characters in name' do - page.within('.tree-table') do - expect(page).to have_content '..' - expect(page).to have_content 'regular_file_2' - end - end - - step 'recent build artifacts contain directory with invalid UTF-8 characters' do - # metadata fixture contains relevant directory - end - - step 'I navigate to parent directory of directory with invalid name' do - page.within('.tree-table') { click_link 'tests_encoding' } - end - - step 'I should not see directory with invalid name on the list' do - page.within('.tree-table') do - expect(page).to have_no_content('non-utf8-dir') - end - end - - step 'I click a link to file within build artifacts' do - page.within('.tree-table') { find_link('ci_artifacts.txt').click } - wait_for_requests - end - - step 'I see a download link' do - expect(page).to have_link 'download it' - end - - step 'I click a first row within build artifacts table' do - row = first('tr[data-link]') - @row_path = row['data-link'] - row.click - end - - step 'page with a coresponding path is loading' do - expect(current_path).to eq @row_path - end -end diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb deleted file mode 100644 index 959cf7d3e54..00000000000 --- a/features/steps/project/commits/commits.rb +++ /dev/null @@ -1,192 +0,0 @@ -class Spinach::Features::ProjectCommits < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include SharedDiffNote - include RepoHelpers - - step 'I see project commits' do - commit = @project.repository.commit - expect(page).to have_content(@project.name) - expect(page).to have_content(commit.message[0..20]) - expect(page).to have_content(commit.short_id) - end - - step 'I click atom feed link' do - click_link "Commits feed" - end - - step 'I see commits atom feed' do - commit = @project.repository.commit - expect(response_headers['Content-Type']).to have_content("application/atom+xml") - expect(body).to have_selector("title", text: "#{@project.name}:master commits") - expect(body).to have_selector("author email", text: commit.author_email) - expect(body).to have_selector("entry summary", text: commit.description[0..10].delete("\r\n")) - end - - step 'I click on tag link' do - click_link "Tag" - end - - step 'I see commit SHA pre-filled' do - expect(page).to have_selector("input[value='#{sample_commit.id}']") - end - - step 'I click on commit link' do - visit project_commit_path(@project, sample_commit.id) - end - - step 'I see commit info' do - expect(page).to have_content sample_commit.message - expect(page).to have_content "Showing #{sample_commit.files_changed_count} changed files" - end - - step 'I fill compare fields with branches' do - select_using_dropdown('from', 'feature') - select_using_dropdown('to', 'master') - - click_button 'Compare' - end - - step 'I fill compare fields with refs' do - select_using_dropdown('from', sample_commit.parent_id, true) - select_using_dropdown('to', sample_commit.id, true) - - click_button "Compare" - end - - step 'I unfold diff' do - @diff = first('.js-unfold') - @diff.click - sleep 2 - end - - step 'I should see additional file lines' do - page.within @diff.query_scope do - expect(first('.new_line').text).not_to have_content "..." - end - end - - step 'I see compared refs' do - expect(page).to have_content "Commits (1)" - expect(page).to have_content "Showing 2 changed files" - end - - step 'I visit commits list page for feature branch' do - visit project_commits_path(@project, 'feature', { limit: 5 }) - end - - step 'I see feature branch commits' do - commit = @project.repository.commit('0b4bc9a') - expect(page).to have_content(@project.name) - expect(page).to have_content(commit.message[0..12]) - expect(page).to have_content(commit.short_id) - end - - step 'project have an open merge request' do - create(:merge_request, - title: 'Feature', - source_project: @project, - source_branch: 'feature', - target_branch: 'master', - author: @project.users.first - ) - end - - step 'I click the "Compare" tab' do - click_link('Compare') - end - - step 'I fill compare fields with branches' do - select_using_dropdown('from', 'master') - select_using_dropdown('to', 'feature') - - click_button 'Compare' - end - - step 'I see compared branches' do - expect(page).to have_content 'Commits (1)' - expect(page).to have_content 'Showing 1 changed file with 5 additions and 0 deletions' - end - - step 'I see button to create a new merge request' do - expect(page).to have_link 'Create merge request' - end - - step 'I should not see button to create a new merge request' do - expect(page).not_to have_link 'Create merge request' - end - - step 'I should see button to the merge request' do - merge_request = MergeRequest.find_by(title: 'Feature') - expect(page).to have_link "View open merge request", href: project_merge_request_path(@project, merge_request) - end - - step 'I see breadcrumb links' do - expect(page).to have_selector('ul.breadcrumb') - expect(page).to have_selector('ul.breadcrumb a', count: 4) - end - - step 'I see commits stats' do - expect(page).to have_content 'Top 50 Committers' - expect(page).to have_content 'Committers' - expect(page).to have_content 'Total commits' - expect(page).to have_content 'Authors' - end - - step 'I visit a commit with an image that changed' do - visit project_commit_path(@project, sample_image_commit.id) - end - - step 'The diff links to both the previous and current image' do - links = page.all('.file-actions a') - expect(links[0]['href']).to match %r{blob/#{sample_image_commit.old_blob_id}} - expect(links[1]['href']).to match %r{blob/#{sample_image_commit.new_blob_id}} - end - - step 'I see inline diff button' do - expect(page).to have_content "Inline" - end - - step 'I click side-by-side diff button' do - find('#parallel-diff-btn').click - end - - step 'commit has ci status' do - @project.enable_ci - @pipeline = create(:ci_pipeline, project: @project, sha: sample_commit.id) - create(:ci_build, pipeline: @pipeline) - end - - step 'repository contains ".gitlab-ci.yml" file' do - allow_any_instance_of(Ci::Pipeline).to receive(:ci_yaml_file).and_return(String.new) - end - - step 'I see commit ci info' do - expect(page).to have_content "Pipeline ##{@pipeline.id} pending" - end - - step 'I search "submodules" commits' do - fill_in 'commits-search', with: 'submodules' - end - - step 'I should see only "submodules" commits' do - expect(page).to have_content "More submodules" - expect(page).not_to have_content "Change some files" - end - - def select_using_dropdown(dropdown_type, selection, is_commit = false) - dropdown = find(".js-compare-#{dropdown_type}-dropdown") - dropdown.find(".compare-dropdown-toggle").click - dropdown.find('.dropdown-menu', visible: true) - dropdown.fill_in("Filter by Git revision", with: selection) - - if is_commit - dropdown.find('input[type="search"]').send_keys(:return) - else - find_link(selection, visible: true).click - end - - dropdown.find('.dropdown-menu', visible: false) - end -end diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb index 9db31522c5c..8e2f594328d 100644 --- a/features/steps/project/deploy_keys.rb +++ b/features/steps/project/deploy_keys.rb @@ -9,18 +9,21 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps step 'I should see project deploy key' do page.within(find('.deploy-keys')) do + find('.js-deployKeys-tab-enabled_keys').click() expect(page).to have_content deploy_key.title end end step 'I should see other project deploy key' do page.within(find('.deploy-keys')) do + find('.js-deployKeys-tab-available_project_keys').click() expect(page).to have_content other_deploy_key.title end end step 'I should see public deploy key' do page.within(find('.deploy-keys')) do + find('.js-deployKeys-tab-public_keys').click() expect(page).to have_content public_deploy_key.title end end @@ -42,6 +45,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps step 'I should see newly created deploy key' do @project.reload page.within(find('.deploy-keys')) do + find('.js-deployKeys-tab-enabled_keys').click() expect(page).to have_content(deploy_key.title) end end @@ -58,7 +62,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps step 'I should only see the same deploy key once' do page.within(find('.deploy-keys')) do - expect(page).to have_selector('ul li', count: 1) + expect(find('.js-deployKeys-tab-available_project_keys .badge')).to have_content('1') end end @@ -68,6 +72,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps step 'I click attach deploy key' do page.within(find('.deploy-keys')) do + find('.badge', text: '1').click() click_button 'Enable' expect(page).not_to have_selector('.fa-spinner') end diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index fd51ee1a316..82b931b2246 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -53,7 +53,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps first('.js-source-branch').click wait_for_requests - first('.dropdown-source-branch .dropdown-content a', text: 'fix').click + first('.js-source-branch-dropdown .dropdown-content a', text: 'fix').click click_button "Compare branches and continue" diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb deleted file mode 100644 index db99c179439..00000000000 --- a/features/steps/project/source/markdown_render.rb +++ /dev/null @@ -1,317 +0,0 @@ -# If you need to modify the existing seed repository for your tests, -# it is recommended that you make the changes on the `markdown` branch of the seed project repository, -# which should only be used by tests in this file. See `/spec/factories.rb#project` for more info. -class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedMarkdown - include WaitForRequests - - step 'I own project "Delta"' do - @project = ::Project.find_by(name: "Delta") - @project ||= create(:project, :repository, name: "Delta", namespace: @user.namespace) - @project.add_master(@user) - end - - step 'I should see files from repository in markdown' do - expect(current_path).to eq project_tree_path(@project, "markdown") - expect(page).to have_content "README.md" - expect(page).to have_content "CHANGELOG" - end - - step 'I should see rendered README which contains correct links' do - expect(page).to have_content "Welcome to GitLab GitLab is a free project and repository management application" - expect(page).to have_link "GitLab API doc" - expect(page).to have_link "GitLab API website" - expect(page).to have_link "Rake tasks" - expect(page).to have_link "backup and restore procedure" - expect(page).to have_link "GitLab API doc directory" - expect(page).to have_link "Maintenance" - end - - step 'I click on Gitlab API in README' do - click_link "GitLab API doc" - end - - step 'I should see correct document rendered' do - expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") - wait_for_requests - expect(page).to have_content "All API requests require authentication" - end - - step 'I click on Rake tasks in README' do - click_link "Rake tasks" - end - - step 'I should see correct directory rendered' do - expect(current_path).to eq project_tree_path(@project, "markdown/doc/raketasks") - expect(page).to have_content "backup_restore.md" - expect(page).to have_content "maintenance.md" - end - - step 'I click on GitLab API doc directory in README' do - click_link "GitLab API doc directory" - end - - step 'I should see correct doc/api directory rendered' do - expect(current_path).to eq project_tree_path(@project, "markdown/doc/api") - expect(page).to have_content "README.md" - expect(page).to have_content "users.md" - end - - step 'I click on Maintenance in README' do - click_link "Maintenance" - end - - step 'I should see correct maintenance file rendered' do - expect(current_path).to eq project_blob_path(@project, "markdown/doc/raketasks/maintenance.md") - wait_for_requests - expect(page).to have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" - end - - step 'I click on link "empty" in the README' do - page.within('.readme-holder') do - click_link "empty" - end - end - - step 'I click on link "id" in the README' do - page.within('.readme-holder') do - click_link "#id" - end - end - - step 'I navigate to the doc/api/README' do - page.within '.tree-table' do - click_link "doc" - end - - page.within '.tree-table' do - click_link "api" - end - - wait_for_requests - - page.within '.tree-table' do - click_link "README.md" - end - end - - step 'I see correct file rendered' do - expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") - wait_for_requests - expect(page).to have_content "Contents" - expect(page).to have_link "Users" - expect(page).to have_link "Rake tasks" - end - - step 'I click on users in doc/api/README' do - click_link "Users" - end - - step 'I should see the correct document file' do - expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/users.md") - expect(page).to have_content "Get a list of users." - end - - step 'I click on raketasks in doc/api/README' do - click_link "Rake tasks" - end - - # Markdown branch - - When 'I visit markdown branch' do - visit project_tree_path(@project, "markdown") - wait_for_requests - end - - When 'I visit markdown branch "README.md" blob' do - visit project_blob_path(@project, "markdown/README.md") - end - - When 'I visit markdown branch "d" tree' do - visit project_tree_path(@project, "markdown/d") - end - - When 'I visit markdown branch "d/README.md" blob' do - visit project_blob_path(@project, "markdown/d/README.md") - end - - step 'I should see files from repository in markdown branch' do - expect(current_path).to eq project_tree_path(@project, "markdown") - expect(page).to have_content "README.md" - expect(page).to have_content "CHANGELOG" - end - - step 'I see correct file rendered in markdown branch' do - expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") - wait_for_requests - expect(page).to have_content "Contents" - expect(page).to have_link "Users" - expect(page).to have_link "Rake tasks" - end - - step 'I should see correct document rendered for markdown branch' do - expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") - wait_for_requests - expect(page).to have_content "All API requests require authentication" - end - - step 'I should see correct directory rendered for markdown branch' do - expect(current_path).to eq project_tree_path(@project, "markdown/doc/raketasks") - expect(page).to have_content "backup_restore.md" - expect(page).to have_content "maintenance.md" - end - - step 'I should see the users document file in markdown branch' do - expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/users.md") - expect(page).to have_content "Get a list of users." - end - - # Expected link contents - - step 'The link with text "empty" should have url "tree/markdown"' do - wait_for_requests - find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown") - end - - step 'The link with text "empty" should have url "blob/markdown/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") - end - - step 'The link with text "empty" should have url "tree/markdown/d"' do - find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown/d") - end - - step 'The link with text "empty" should have '\ - 'url "blob/markdown/d/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/d/README.md") - end - - step 'The link with text "ID" should have url "tree/markdownID"' do - find('a', text: /^#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id' - end - - step 'The link with text "/ID" should have url "tree/markdownID"' do - find('a', text: %r{^/#id$})['href'] == current_host + project_tree_path(@project, "markdown") + '#id' - end - - step 'The link with text "README.mdID" '\ - 'should have url "blob/markdown/README.mdID"' do - find('a', text: /^README.md#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' - end - - step 'The link with text "d/README.mdID" should have '\ - 'url "blob/markdown/d/README.mdID"' do - find('a', text: %r{^d/README.md#id$})['href'] == current_host + project_blob_path(@project, "d/markdown/README.md") + '#id' - end - - step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do - wait_for_requests - find('a', text: /^#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' - end - - step 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do - find('a', text: %r{^/#id$})['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' - end - - # Wiki - - step 'I go to wiki page' do - first(:link, "Wiki").click - expect(current_path).to eq project_wiki_path(@project, "home") - end - - step 'I add various links to the wiki page' do - fill_in "wiki[content]", with: "[test](test)\n[GitLab API doc](api)\n[Rake tasks](raketasks)\n" - fill_in "wiki[message]", with: "Adding links to wiki" - page.within '.wiki-form' do - click_button "Create page" - end - end - - step 'Wiki page should have added links' do - expect(current_path).to eq project_wiki_path(@project, "home") - expect(page).to have_content "test GitLab API doc Rake tasks" - end - - step 'I add a header to the wiki page' do - fill_in "wiki[content]", with: "# Wiki header\n" - fill_in "wiki[message]", with: "Add header to wiki" - page.within '.wiki-form' do - click_button "Create page" - end - end - - step 'Wiki header should have correct id and link' do - header_should_have_correct_id_and_link(1, 'Wiki header', 'wiki-header') - end - - step 'I click on test link' do - click_link "test" - end - - step 'I see new wiki page named test' do - expect(current_path).to eq project_wiki_path(@project, "test") - - page.within(:css, ".nav-text") do - expect(page).to have_content "Test" - expect(page).to have_content "Create Page" - end - end - - When 'I go back to wiki page home' do - visit project_wiki_path(@project, "home") - expect(current_path).to eq project_wiki_path(@project, "home") - end - - step 'I click on GitLab API doc link' do - click_link "GitLab API" - end - - step 'I see Gitlab API document' do - expect(current_path).to eq project_wiki_path(@project, "api") - - page.within(:css, ".nav-text") do - expect(page).to have_content "Create" - expect(page).to have_content "Api" - end - end - - step 'I click on Rake tasks link' do - click_link "Rake tasks" - end - - step 'I see Rake tasks directory' do - expect(current_path).to eq project_wiki_path(@project, "raketasks") - - page.within(:css, ".nav-text") do - expect(page).to have_content "Create" - expect(page).to have_content "Rake" - end - end - - step 'I go directory which contains README file' do - visit project_tree_path(@project, "markdown/doc/api") - expect(current_path).to eq project_tree_path(@project, "markdown/doc/api") - end - - step 'I click on a relative link in README' do - click_link "Users" - end - - step 'I should see the correct markdown' do - expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/users.md") - wait_for_requests - expect(page).to have_content "List users" - end - - step 'Header "Application details" should have correct id and link' do - wait_for_requests - header_should_have_correct_id_and_link(2, 'Application details', 'application-details') - end - - step 'Header "GitLab API" should have correct id and link' do - header_should_have_correct_id_and_link(1, 'GitLab API', 'gitlab-api') - end -end diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb deleted file mode 100644 index c2197584d8d..00000000000 --- a/features/steps/shared/builds.rb +++ /dev/null @@ -1,53 +0,0 @@ -module SharedBuilds - include Spinach::DSL - - step 'project has CI enabled' do - @project.enable_ci - end - - step 'project has coverage enabled' do - @project.update_attribute(:build_coverage_regex, /Coverage (\d+)%/) - end - - step 'project has a recent build' do - @pipeline = create(:ci_empty_pipeline, project: @project, sha: @project.commit.sha, ref: 'master') - @build = create(:ci_build, :running, :coverage, :trace_artifact, pipeline: @pipeline) - end - - step 'recent build is successful' do - @build.success - end - - step 'recent build failed' do - @build.drop - end - - step 'project has another build that is running' do - create(:ci_build, pipeline: @pipeline, name: 'second build', status_event: 'run') - end - - step 'I visit recent build details page' do - visit project_job_path(@project, @build) - end - - step 'recent build has artifacts available' do - artifacts = Rails.root + 'spec/fixtures/ci_build_artifacts.zip' - archive = fixture_file_upload(artifacts, 'application/zip') - @build.update_attributes(legacy_artifacts_file: archive) - end - - step 'recent build has artifacts metadata available' do - metadata = Rails.root + 'spec/fixtures/ci_build_artifacts_metadata.gz' - gzip = fixture_file_upload(metadata, 'application/x-gzip') - @build.update_attributes(legacy_artifacts_metadata: gzip) - end - - step 'recent build has a build trace' do - @build.trace.set('job trace') - end - - step 'download of build artifacts archive starts' do - expect(page.response_headers['Content-Type']).to eq 'application/zip' - expect(page.response_headers['Content-Transfer-Encoding']).to eq 'binary' - end -end diff --git a/features/steps/shared/group.rb b/features/steps/shared/group.rb index 0a0588346b1..0126ce39c5a 100644 --- a/features/steps/shared/group.rb +++ b/features/steps/shared/group.rb @@ -5,10 +5,6 @@ module SharedGroup is_member_of(current_user.name, "Owned", Gitlab::Access::DEVELOPER) end - step '"John Doe" is owner of group "Owned"' do - is_member_of("John Doe", "Owned", Gitlab::Access::OWNER) - end - step '"John Doe" is guest of group "Guest"' do is_member_of("John Doe", "Guest", Gitlab::Access::GUEST) end diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index 9d522936fb6..65118f07ca2 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -1,15 +1,6 @@ module SharedMarkdown include Spinach::DSL - def header_should_have_correct_id_and_link(level, text, id, parent = ".wiki") - node = find("#{parent} h#{level} a#user-content-#{id}") - expect(node[:href]).to end_with "##{id}" - - # Work around a weird Capybara behavior where calling `parent` on a node - # returns the whole document, not the node's actual parent element - expect(find(:xpath, "#{node.path}/..").text).to eq text - end - step 'I should not see the Markdown preview' do expect(find('.gfm-form .js-md-preview')).not_to be_visible end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 014e6ad625b..b6c648a707d 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -48,10 +48,6 @@ module SharedPaths visit group_group_members_path(Group.find_by(name: "Owned")) end - step 'I visit group "Owned" settings page' do - visit edit_group_path(Group.find_by(name: "Owned")) - end - step 'I visit group "Owned" projects page' do visit projects_group_path(Group.find_by(name: "Owned")) end |