diff options
Diffstat (limited to 'features')
| -rw-r--r-- | features/group/members.feature | 12 | ||||
| -rw-r--r-- | features/group/milestones.feature | 48 | ||||
| -rw-r--r-- | features/profile/profile.feature | 85 | ||||
| -rw-r--r-- | features/project/issues/milestones.feature | 7 | ||||
| -rw-r--r-- | features/project/network_graph.feature | 46 | ||||
| -rw-r--r-- | features/project/pages.feature | 87 | ||||
| -rw-r--r-- | features/steps/group/members.rb | 15 | ||||
| -rw-r--r-- | features/steps/group/milestones.rb | 135 | ||||
| -rw-r--r-- | features/steps/profile/profile.rb | 226 | ||||
| -rw-r--r-- | features/steps/project/commits/commits.rb | 6 | ||||
| -rw-r--r-- | features/steps/project/issues/labels.rb | 5 | ||||
| -rw-r--r-- | features/steps/project/issues/milestones.rb | 9 | ||||
| -rw-r--r-- | features/steps/project/network_graph.rb | 116 | ||||
| -rw-r--r-- | features/steps/project/pages.rb | 152 | ||||
| -rw-r--r-- | features/steps/project/source/markdown_render.rb | 6 | ||||
| -rw-r--r-- | features/steps/user.rb | 38 | ||||
| -rw-r--r-- | features/support/capybara_helpers.rb | 10 | ||||
| -rw-r--r-- | features/support/db_cleaner.rb | 2 | ||||
| -rw-r--r-- | features/support/env.rb | 7 | ||||
| -rw-r--r-- | features/user.feature | 86 |
20 files changed, 25 insertions, 1073 deletions
diff --git a/features/group/members.feature b/features/group/members.feature deleted file mode 100644 index 49a44f57cbb..00000000000 --- a/features/group/members.feature +++ /dev/null @@ -1,12 +0,0 @@ -Feature: Group Members - Background: - Given I sign in as "John Doe" - And "John Doe" is owner of group "Owned" - And "John Doe" is guest of group "Guest" - - Scenario: Search member by name - Given "Mary Jane" is guest of group "Guest" - And I visit group "Guest" members page - When I search for 'Mary' member - Then I should see user "Mary Jane" in team list - Then I should not see user "John Doe" in team list diff --git a/features/group/milestones.feature b/features/group/milestones.feature deleted file mode 100644 index 2211acfee20..00000000000 --- a/features/group/milestones.feature +++ /dev/null @@ -1,48 +0,0 @@ -Feature: Group Milestones - Background: - Given I sign in as "John Doe" - And "John Doe" is owner of group "Owned" - - Scenario: I should see group "Owned" milestone index page with no milestones - When I visit group "Owned" page - And I click on group milestones - Then I should see group milestones index page has no milestones - - Scenario: I should see group "Owned" milestone index page with milestones - Given Group has projects with milestones - When I visit group "Owned" page - And I click on group milestones - Then I should see group milestones index page with milestones - - Scenario: I should see group "Owned" milestone show page - Given Group has projects with milestones - When I visit group "Owned" page - And I click on group milestones - And I click on one group milestone - Then I should see group milestone with descriptions and expiry date - And I should see group milestone with all issues and MRs assigned to that milestone - - Scenario: Create group milestones - Given I visit group "Owned" milestones page - And I click new milestone button - And I fill milestone name - When I press create mileston button - Then group milestone should be created - - Scenario: I should see Issues listed with labels - Given Group has projects with milestones - When I visit group "Owned" page - And I click on group milestones - And I click on one group milestone - Then I should see the "bug" label - And I should see the "feature" label - And I should see the project name in the Issue row - - @javascript - Scenario: I should see the Labels tab - Given Group has projects with milestones - When I visit group "Owned" page - And I click on group milestones - And I click on one group milestone - And I click on the "Labels" tab - Then I should see the list of labels diff --git a/features/profile/profile.feature b/features/profile/profile.feature deleted file mode 100644 index 3263d3e212b..00000000000 --- a/features/profile/profile.feature +++ /dev/null @@ -1,85 +0,0 @@ -@profile -Feature: Profile - Background: - Given I sign in as a user - - Scenario: I look at my profile - Given I visit profile page - Then I should see my profile info - - @javascript - Scenario: I can see groups I belong to - Given I have group with projects - When I visit profile page - And I click on my profile picture - Then I should see my user page - And I should see groups I belong to - - Scenario: I edit profile - Given I visit profile page - Then I change my profile info - And I should see new profile info - - Scenario: I change my password without old one - Given I visit profile password page - When I try change my password w/o old one - Then I should see a missing password error message - And I should be redirected to password page - - Scenario: I change my password - Given I visit profile password page - Then I change my password - And I should be redirected to sign in page - - Scenario: I edit my avatar - Given I visit profile page - Then I change my avatar - And I should see new avatar - And I should see the "Remove avatar" button - And I should see the gravatar host link - - Scenario: I remove my avatar - Given I visit profile page - And I have an avatar - When I remove my avatar - Then I should see my gravatar - And I should not see the "Remove avatar" button - And I should see the gravatar host link - - Scenario: My password is expired - Given my password is expired - And I am not an ldap user - Given I visit profile password page - Then I redirected to expired password page - And I submit new password - And I redirected to sign in page - - Scenario: I unsuccessfully change my password - Given I visit profile password page - When I unsuccessfully change my password - Then I should see a password error message - - Scenario: I visit history tab - Given I logout - And I sign in via the UI - And I have activity - When I visit Authentication log page - Then I should see my activity - - Scenario: I visit my user page - When I visit profile page - And I click on my profile picture - Then I should see my user page - - Scenario: I can manage application - Given I visit profile applications page - Then I should see application form - Then I fill application form out and submit - And I see application - Then I click edit - And I see edit application form - Then I change name of application and submit - And I see that application was changed - Then I visit profile applications page - And I click to remove application - Then I see that application is removed diff --git a/features/project/issues/milestones.feature b/features/project/issues/milestones.feature index 1af05b3c326..d121222308d 100644 --- a/features/project/issues/milestones.feature +++ b/features/project/issues/milestones.feature @@ -18,12 +18,15 @@ Feature: Project Issues Milestones Given I click link "New Milestone" And I submit new milestone "v2.3" Then I should see milestone "v2.3" - Given I click link to remove milestone + Given I click button to remove milestone + And I confirm in modal When I visit project "Shop" activity page Then I should see deleted milestone activity + @javascript Scenario: I delete new milestone - Given I click link to remove milestone + Given I click button to remove milestone + And I confirm in modal And I should see no milestones @javascript diff --git a/features/project/network_graph.feature b/features/project/network_graph.feature deleted file mode 100644 index 93c884e23c5..00000000000 --- a/features/project/network_graph.feature +++ /dev/null @@ -1,46 +0,0 @@ -Feature: Project Network Graph - Background: - Given I sign in as a user - And I own project "Shop" - And I visit project "Shop" network page - - @javascript - Scenario: I should see project network - Then page should have network graph - And page should select "master" in select box - And page should have "master" on graph - - @javascript - Scenario: I should see project network with 'test' branch - When I visit project network page on branch 'test' - Then page should have 'test' on graph - - @javascript - Scenario: I should switch "branch" and "tag" - When I switch ref to "feature" - Then page should select "feature" in select box - And page should have "feature" on graph - When I switch ref to "v1.0.0" - Then page should select "v1.0.0" in select box - And page should have "v1.0.0" on graph - - @javascript - Scenario: I should looking for a commit by SHA - When I looking for a commit by SHA of "v1.0.0" - Then page should have network graph - And page should select "master" in select box - And page should have "v1.0.0" on graph - - @javascript - Scenario: I should filter selected tag - When I switch ref to "v1.0.0" - Then page should have "v1.0.0" in title - Then page should have content not containing "v1.0.0" - When click "Show only selected branch" checkbox - Then page should only have content from "v1.0.0" - When click "Show only selected branch" checkbox - Then page should have content not containing "v1.0.0" - - Scenario: I should fail to look for a commit - When I look for a commit by ";" - Then I should see non-existent git revision error message diff --git a/features/project/pages.feature b/features/project/pages.feature deleted file mode 100644 index 56e47287b5c..00000000000 --- a/features/project/pages.feature +++ /dev/null @@ -1,87 +0,0 @@ -Feature: Project Pages - Background: - Given I sign in as a user - And I own a project - - Scenario: I cannot navigate to Pages settings if pages enabled - Given pages are disabled - And I visit my project's settings page - Then I should not see the "Pages" tab - - Scenario: I can navigate to Pages settings if pages enabled - Given pages are enabled - And I visit my project's settings page - Then I should see the "Pages" tab - - Scenario: I can see the pages usage if not deployed - Given pages are enabled - When I visit the Project Pages - Then I should see the usage of GitLab Pages - - Scenario: I can access the pages if deployed - Given pages are enabled - And pages are deployed - When I visit the Project Pages - Then I should be able to access the Pages - - Scenario: I should message that domains support is disabled - Given pages are enabled - And pages are deployed - And support for external domains is disabled - When I visit the Project Pages - Then I should see that support for domains is disabled - - Scenario: I should see a new domain button - Given pages are enabled - And pages are exposed on external HTTP address - When I visit the Project Pages - And I should be able to add a New Domain - - Scenario: I should be able to add a new domain - Given pages are enabled - And pages are exposed on external HTTP address - When I visit add a new Pages Domain - And I fill the domain - And I click on "Create New Domain" - Then I should see a new domain added - - Scenario: I should be able to add a new domain for project in group namespace - Given I own a project in some group namespace - And pages are enabled - And pages are exposed on external HTTP address - When I visit add a new Pages Domain - And I fill the domain - And I click on "Create New Domain" - Then I should see a new domain added - - Scenario: I should be denied to add the same domain twice - Given pages are enabled - And pages are exposed on external HTTP address - And pages domain is added - When I visit add a new Pages Domain - And I fill the domain - And I click on "Create New Domain" - Then I should see error message that domain already exists - - Scenario: I should message that certificates support is disabled when trying to add a new domain - Given pages are enabled - And pages are exposed on external HTTP address - And pages domain is added - When I visit add a new Pages Domain - Then I should see that support for certificates is disabled - - Scenario: I should be able to add a new domain with certificate - Given pages are enabled - And pages are exposed on external HTTPS address - When I visit add a new Pages Domain - And I fill the domain - And I fill the certificate and key - And I click on "Create New Domain" - Then I should see a new domain added - - Scenario: I can remove the pages if deployed - Given pages are enabled - And pages are deployed - When I visit the Project Pages - And I click Remove Pages - Then The Pages should get removed diff --git a/features/steps/group/members.rb b/features/steps/group/members.rb index 0ab1012660c..97bcca7730b 100644 --- a/features/steps/group/members.rb +++ b/features/steps/group/members.rb @@ -9,14 +9,6 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps expect(group_members_list).to have_content("John Doe") end - step 'I should not see user "John Doe" in team list' do - expect(group_members_list).not_to have_content("John Doe") - end - - step 'I should see user "Mary Jane" in team list' do - expect(group_members_list).to have_content("Mary Jane") - end - step 'I should not see user "Mary Jane" in team list' do expect(group_members_list).not_to have_content("Mary Jane") end @@ -41,13 +33,6 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps # poltergeist always confirms popups. end - step 'I search for \'Mary\' member' do - page.within '.member-search-form' do - fill_in 'search', with: 'Mary' - find('.member-search-btn').click - end - end - step 'I change the "Mary Jane" role to "Developer"' do member = mary_jane_member diff --git a/features/steps/group/milestones.rb b/features/steps/group/milestones.rb deleted file mode 100644 index 818bbb50d0e..00000000000 --- a/features/steps/group/milestones.rb +++ /dev/null @@ -1,135 +0,0 @@ -class Spinach::Features::GroupMilestones < Spinach::FeatureSteps - include WaitForRequests - include SharedAuthentication - include SharedPaths - include SharedGroup - include SharedUser - - step 'I click on group milestones' do - visit group_milestones_path('owned') - end - - step 'I should see group milestones index page has no milestones' do - expect(page).to have_content('No milestones to show') - end - - step 'Group has projects with milestones' do - group_milestone - end - - step 'I should see group milestones index page with milestones' do - expect(page).to have_content('Version 7.2') - expect(page).to have_content('GL-113') - expect(page).to have_link('3 Issues', href: issues_group_path("owned", milestone_title: "Version 7.2")) - expect(page).to have_link('0 Merge Requests', href: merge_requests_group_path("owned", milestone_title: "GL-113")) - end - - step 'I click on one group milestone' do - milestones = Milestone.where(title: 'GL-113') - @global_milestone = GlobalMilestone.new('GL-113', milestones) - - click_link 'GL-113' - end - - step 'I should see group milestone with descriptions and expiry date' do - expect(page).to have_content('expires on Aug 20, 2114') - end - - step 'I should see group milestone with all issues and MRs assigned to that milestone' do - expect(page).to have_content('Milestone GL-113') - expect(page).to have_content('Issues 3 Open: 3 Closed: 0') - issue = Milestone.find_by(name: 'GL-113').issues.first - expect(page).to have_link(issue.title, href: project_issue_path(issue.project, issue)) - end - - step 'I fill milestone name' do - fill_in 'milestone_title', with: 'v2.9.0' - end - - step 'I click new milestone button' do - page.within('.nav-controls') do - click_link "New milestone" - end - end - - step 'I press create mileston button' do - click_button "Create milestone" - end - - step 'group milestone should be created' do - group = Group.find_by(name: 'Owned') - expect(page).to have_content group.milestones.find_by_title('v2.9.0').title - end - - step 'I should see the "bug" label' do - page.within('#tab-issues') do - expect(page).to have_content 'bug' - end - end - - step 'I should see the "feature" label' do - page.within('#tab-issues') do - expect(page).to have_content 'bug' - end - end - - step 'I should see the project name in the Issue row' do - page.within('#tab-issues') do - @global_milestone.projects.each do |project| - expect(page).to have_content project.name - end - end - end - - step 'I click on the "Labels" tab' do - page.within('.content .nav-links') do - page.find(:xpath, "//a[@href='#tab-labels']").click - end - end - - step 'I should see the list of labels' do - wait_for_requests - - page.within('#tab-labels') do - expect(page).to have_content 'bug' - expect(page).to have_content 'feature' - end - end - - private - - def group_milestone - group = owned_group - - %w(gitlabhq gitlab-ci cookbook-gitlab).each do |path| - project = create(:project, path: path, group: group) - milestone = create :milestone, title: "Version 7.2", project: project - - create(:label, project: project, title: 'bug') - create(:label, project: project, title: 'feature') - - create :issue, - project: project, - assignees: [current_user], - author: current_user, - milestone: milestone - - milestone = create :milestone, - title: "GL-113", - project: project, - due_date: '2114-08-20', - description: 'Lorem Ipsum is simply dummy text' - - issue = create :issue, - project: project, - assignees: [current_user], - author: current_user, - milestone: milestone - - issue.labels << project.labels.find_by(title: 'bug') - issue.labels << project.labels.find_by(title: 'feature') - end - - current_user.refresh_authorized_projects - end -end diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb deleted file mode 100644 index d3b88ae8d2a..00000000000 --- a/features/steps/profile/profile.rb +++ /dev/null @@ -1,226 +0,0 @@ -class Spinach::Features::Profile < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - - step 'I should see my profile info' do - expect(page).to have_content "This information will appear on your profile" - end - - step 'I change my profile info' do - fill_in 'user_skype', with: 'testskype' - fill_in 'user_linkedin', with: 'testlinkedin' - fill_in 'user_twitter', with: 'testtwitter' - fill_in 'user_website_url', with: 'testurl' - fill_in 'user_location', with: 'Ukraine' - fill_in 'user_bio', with: 'I <3 GitLab' - fill_in 'user_organization', with: 'GitLab' - click_button 'Update profile settings' - @user.reload - end - - step 'I should see new profile info' do - expect(@user.skype).to eq 'testskype' - expect(@user.linkedin).to eq 'testlinkedin' - expect(@user.twitter).to eq 'testtwitter' - expect(@user.website_url).to eq 'testurl' - expect(@user.bio).to eq 'I <3 GitLab' - expect(@user.organization).to eq 'GitLab' - expect(find('#user_location').value).to eq 'Ukraine' - end - - step 'I change my avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')) - click_button "Update profile settings" - @user.reload - end - - step 'I should see new avatar' do - expect(@user.avatar).to be_instance_of AvatarUploader - expect(@user.avatar.url).to eq "/uploads/-/system/user/avatar/#{@user.id}/banana_sample.gif" - end - - step 'I should see the "Remove avatar" button' do - expect(page).to have_link("Remove avatar") - end - - step 'I have an avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')) - click_button "Update profile settings" - @user.reload - end - - step 'I remove my avatar' do - click_link "Remove avatar" - @user.reload - end - - step 'I should see my gravatar' do - expect(@user.avatar?).to eq false - end - - step 'I should not see the "Remove avatar" button' do - expect(page).not_to have_link("Remove avatar") - end - - step 'I should see the gravatar host link' do - expect(page).to have_link("gravatar.com") - end - - step 'I try change my password w/o old one' do - page.within '.update-password' do - fill_in "user_password", with: "22233344" - fill_in "user_password_confirmation", with: "22233344" - click_button "Save password" - end - end - - step 'I change my password' do - page.within '.update-password' do - fill_in "user_current_password", with: "12345678" - fill_in "user_password", with: "22233344" - fill_in "user_password_confirmation", with: "22233344" - click_button "Save password" - end - end - - step 'I unsuccessfully change my password' do - page.within '.update-password' do - fill_in "user_current_password", with: "12345678" - fill_in "user_password", with: "password" - fill_in "user_password_confirmation", with: "confirmation" - click_button "Save password" - end - end - - step "I should see a missing password error message" do - page.within ".flash-container" do - expect(page).to have_content "You must provide a valid current password" - end - end - - step "I should see a password error message" do - page.within '.alert-danger' do - expect(page).to have_content "Password confirmation doesn't match" - end - end - - step 'I have activity' do - create(:closed_issue_event, author: current_user) - end - - step 'I should see my activity' do - expect(page).to have_content "Signed in with standard authentication" - end - - step 'my password is expired' do - current_user.update_attributes(password_expires_at: Time.now - 1.hour) - end - - step "I am not an ldap user" do - current_user.identities.delete - expect(current_user.ldap_user?).to eq false - end - - step 'I redirected to expired password page' do - expect(current_path).to eq new_profile_password_path - end - - step 'I submit new password' do - fill_in :user_current_password, with: '12345678' - fill_in :user_password, with: '12345678' - fill_in :user_password_confirmation, with: '12345678' - click_button "Set new password" - end - - step 'I redirected to sign in page' do - expect(current_path).to eq new_user_session_path - end - - step 'I should be redirected to password page' do - expect(current_path).to eq edit_profile_password_path - end - - step 'I should be redirected to account page' do - expect(current_path).to eq profile_account_path - end - - step 'I click on my profile picture' do - find(:css, '.header-user-dropdown-toggle').click - - page.within ".header-user" do - click_link "Profile" - end - end - - step 'I should see my user page' do - page.within ".cover-block" do - expect(page).to have_content current_user.name - expect(page).to have_content current_user.username - end - end - - step 'I have group with projects' do - @group = create(:group) - @group.add_owner(current_user) - @project = create(:project, :repository, namespace: @group) - @event = create(:closed_issue_event, project: @project) - - @project.add_master(current_user) - end - - step 'I should see groups I belong to' do - page.within ".content" do - click_link "Groups" - end - - page.within "#groups" do - expect(page).to have_content @group.name - end - end - - step 'I should see application form' do - expect(page).to have_content "Add new application" - end - - step 'I fill application form out and submit' do - fill_in :doorkeeper_application_name, with: 'test' - fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' - click_on "Save application" - end - - step 'I see application' do - expect(page).to have_content "Application: test" - expect(page).to have_content "Application Id" - expect(page).to have_content "Secret" - end - - step 'I click edit' do - click_on "Edit" - end - - step 'I see edit application form' do - expect(page).to have_content "Edit application" - end - - step 'I change name of application and submit' do - expect(page).to have_content "Edit application" - fill_in :doorkeeper_application_name, with: 'test_changed' - click_on "Save application" - end - - step 'I see that application was changed' do - expect(page).to have_content "test_changed" - expect(page).to have_content "Application Id" - expect(page).to have_content "Secret" - end - - step 'I click to remove application' do - page.within '.oauth-applications' do - click_on "Destroy" - end - end - - step "I see that application is removed" do - expect(page.find(".oauth-applications")).not_to have_content "test_changed" - end -end diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index bd3011b1cd8..959cf7d3e54 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -154,8 +154,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'commit has ci status' do @project.enable_ci - pipeline = create :ci_pipeline, project: @project, sha: sample_commit.id - create :ci_build, pipeline: pipeline + @pipeline = create(:ci_pipeline, project: @project, sha: sample_commit.id) + create(:ci_build, pipeline: @pipeline) end step 'repository contains ".gitlab-ci.yml" file' do @@ -163,7 +163,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I see commit ci info' do - expect(page).to have_content "Pipeline #1 pending" + expect(page).to have_content "Pipeline ##{@pipeline.id} pending" end step 'I search "submodules" commits' do diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb index 196e0fff63a..4df96e081f9 100644 --- a/features/steps/project/issues/labels.rb +++ b/features/steps/project/issues/labels.rb @@ -15,8 +15,9 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps step 'I delete all labels' do page.within '.labels' do - page.all('.remove-row').each do - accept_confirm { first('.remove-row').click } + page.all('.label-list-item').each do + first('.remove-row').click + first(:link, 'Delete label').click end end end diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb index 33a24e8913a..4ce67aa651c 100644 --- a/features/steps/project/issues/milestones.rb +++ b/features/steps/project/issues/milestones.rb @@ -3,7 +3,6 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps include SharedProject include SharedPaths include SharedMarkdown - include CapybaraHelpers step 'I should see milestone "v2.2"' do milestone = @project.milestones.find_by(title: "v2.2") @@ -65,8 +64,12 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps expect(page).to have_selector('#tab-issues li.issuable-row', count: 4) end - step 'I click link to remove milestone' do - confirm_modal_if_present { click_link 'Delete' } + step 'I click button to remove milestone' do + click_button 'Delete' + end + + step 'I confirm in modal' do + click_button 'Delete milestone' end step 'I should see no milestones' do diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb deleted file mode 100644 index ba98d861e7b..00000000000 --- a/features/steps/project/network_graph.rb +++ /dev/null @@ -1,116 +0,0 @@ -class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'page should have network graph' do - expect(page).to have_selector ".network-graph" - end - - When 'I visit project "Shop" network page' do - # Stub Graph max_size to speed up test (10 commits vs. 650) - Network::Graph.stub(max_count: 10) - - @project = Project.find_by(name: "Shop") - visit project_network_path(@project, "master") - end - - step "I visit project network page on branch 'test'" do - visit project_network_path(@project, "'test'") - end - - step 'page should select "master" in select box' do - expect(page).to have_selector '.dropdown-menu-toggle', text: "master" - end - - step 'page should select "v1.0.0" in select box' do - expect(page).to have_selector '.dropdown-menu-toggle', text: "v1.0.0" - end - - step 'page should have "master" on graph' do - page.within '.network-graph' do - expect(page).to have_content 'master' - end - end - - step "page should have 'test' on graph" do - page.within '.network-graph' do - expect(page).to have_content "'test'" - end - end - - When 'I switch ref to "feature"' do - first('.js-project-refs-dropdown').click - - page.within '.project-refs-form' do - click_link 'feature' - end - end - - When 'I switch ref to "v1.0.0"' do - first('.js-project-refs-dropdown').click - - page.within '.project-refs-form' do - click_link 'v1.0.0' - end - end - - When 'click "Show only selected branch" checkbox' do - find('#filter_ref').click - end - - step 'page should have content not containing "v1.0.0"' do - page.within '.network-graph' do - expect(page).to have_content 'Change some files' - end - end - - step 'page should have "v1.0.0" in title' do - expect(page).to have_css 'title', text: 'Graph ยท v1.0.0', visible: false - end - - step 'page should only have content from "v1.0.0"' do - page.within '.network-graph' do - expect(page).not_to have_content 'Change some files' - end - end - - step 'page should select "feature" in select box' do - expect(page).to have_selector '.dropdown-menu-toggle', text: "feature" - end - - step 'page should select "v1.0.0" in select box' do - expect(page).to have_selector '.dropdown-menu-toggle', text: "v1.0.0" - end - - step 'page should have "feature" on graph' do - page.within '.network-graph' do - expect(page).to have_content 'feature' - end - end - - When 'I looking for a commit by SHA of "v1.0.0"' do - page.within ".network-form" do - fill_in 'extended_sha1', with: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9' - find('button').click - end - sleep 2 - end - - step 'page should have "v1.0.0" on graph' do - page.within '.network-graph' do - expect(page).to have_content 'v1.0.0' - end - end - - When 'I look for a commit by ";"' do - page.within ".network-form" do - fill_in 'extended_sha1', with: ';' - find('button').click - end - end - - step 'I should see non-existent git revision error message' do - expect(page).to have_selector '.flash-alert', text: "Git revision ';' does not exist." - end -end diff --git a/features/steps/project/pages.rb b/features/steps/project/pages.rb deleted file mode 100644 index f03630e5a91..00000000000 --- a/features/steps/project/pages.rb +++ /dev/null @@ -1,152 +0,0 @@ -class Spinach::Features::ProjectPages < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'pages are enabled' do - allow(Gitlab.config.pages).to receive(:enabled).and_return(true) - allow(Gitlab.config.pages).to receive(:host).and_return('example.com') - allow(Gitlab.config.pages).to receive(:port).and_return(80) - allow(Gitlab.config.pages).to receive(:https).and_return(false) - end - - step 'pages are disabled' do - allow(Gitlab.config.pages).to receive(:enabled).and_return(false) - end - - step 'I visit the Project Pages' do - visit project_pages_path(@project) - end - - step 'I should see the usage of GitLab Pages' do - expect(page).to have_content('Configure pages') - end - - step 'I should see the "Pages" tab' do - page.within '.nav-sidebar' do - expect(page).to have_link('Pages') - end - end - - step 'I should not see the "Pages" tab' do - page.within '.nav-sidebar' do - expect(page).not_to have_link('Pages') - end - end - - step 'pages are deployed' do - pipeline = @project.pipelines.create(ref: 'HEAD', - sha: @project.commit('HEAD').sha, - source: :push, - protected: false) - - build = build(:ci_build, - project: @project, - pipeline: pipeline, - ref: 'HEAD', - legacy_artifacts_file: fixture_file_upload(Rails.root + 'spec/fixtures/pages.zip'), - legacy_artifacts_metadata: fixture_file_upload(Rails.root + 'spec/fixtures/pages.zip.meta') - ) - - result = ::Projects::UpdatePagesService.new(@project, build).execute - expect(result[:status]).to eq(:success) - end - - step 'I should be able to access the Pages' do - expect(page).to have_content('Access pages') - end - - step 'I should see that support for domains is disabled' do - expect(page).to have_content('Support for domains and certificates is disabled') - end - - step 'support for external domains is disabled' do - allow(Gitlab.config.pages).to receive(:external_http).and_return(nil) - allow(Gitlab.config.pages).to receive(:external_https).and_return(nil) - end - - step 'pages are exposed on external HTTP address' do - allow(Gitlab.config.pages).to receive(:external_http).and_return(['1.1.1.1:80']) - allow(Gitlab.config.pages).to receive(:external_https).and_return(nil) - end - - step 'pages are exposed on external HTTPS address' do - allow(Gitlab.config.pages).to receive(:external_http).and_return(['1.1.1.1:80']) - allow(Gitlab.config.pages).to receive(:external_https).and_return(['1.1.1.1:443']) - end - - step 'I should be able to add a New Domain' do - expect(page).to have_content('New Domain') - end - - step 'I visit add a new Pages Domain' do - visit new_project_pages_domain_path(@project) - end - - step 'I fill the domain' do - fill_in 'Domain', with: 'my.test.domain.com' - end - - step 'I click on "Create New Domain"' do - click_button 'Create New Domain' - end - - step 'I should see a new domain added' do - expect(page).to have_content('Domains (1)') - expect(page).to have_content('my.test.domain.com') - end - - step 'pages domain is added' do - @project.pages_domains.create!(domain: 'my.test.domain.com') - end - - step 'I should see error message that domain already exists' do - expect(page).to have_content('Domain has already been taken') - end - - step 'I should see that support for certificates is disabled' do - expect(page).to have_content('Support for custom certificates is disabled') - end - - step 'I fill the certificate and key' do - fill_in 'Certificate (PEM)', with: '-----BEGIN CERTIFICATE----- -MIICGzCCAYSgAwIBAgIBATANBgkqhkiG9w0BAQUFADAbMRkwFwYDVQQDExB0ZXN0 -LWNlcnRpZmljYXRlMB4XDTE2MDIxMjE0MzIwMFoXDTIwMDQxMjE0MzIwMFowGzEZ -MBcGA1UEAxMQdGVzdC1jZXJ0aWZpY2F0ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw -gYkCgYEApL4J9L0ZxFJ1hI1LPIflAlAGvm6ZEvoT4qKU5Xf2JgU7/2geNR1qlNFa -SvCc08Knupp5yTgmvyK/Xi09U0N82vvp4Zvr/diSc4A/RA6Mta6egLySNT438kdT -nY2tR5feoTLwQpX0t4IMlwGQGT5h6Of2fKmDxzuwuyffcIHqLdsCAwEAAaNvMG0w -DAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUxl9WSxBprB0z0ibJs3rXEk0+95AwCwYD -VR0PBAQDAgXgMBEGCWCGSAGG+EIBAQQEAwIGQDAeBglghkgBhvhCAQ0EERYPeGNh -IGNlcnRpZmljYXRlMA0GCSqGSIb3DQEBBQUAA4GBAGC4T8SlFHK0yPSa+idGLQFQ -joZp2JHYvNlTPkRJ/J4TcXxBTJmArcQgTIuNoBtC+0A/SwdK4MfTCUY4vNWNdese -5A4K65Nb7Oh1AdQieTBHNXXCdyFsva9/ScfQGEl7p55a52jOPs0StPd7g64uvjlg -YHi2yesCrOvVXt+lgPTd ------END CERTIFICATE-----' - - fill_in 'Key (PEM)', with: '-----BEGIN PRIVATE KEY----- -MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKS+CfS9GcRSdYSN -SzyH5QJQBr5umRL6E+KilOV39iYFO/9oHjUdapTRWkrwnNPCp7qaeck4Jr8iv14t -PVNDfNr76eGb6/3YknOAP0QOjLWunoC8kjU+N/JHU52NrUeX3qEy8EKV9LeCDJcB -kBk+Yejn9nypg8c7sLsn33CB6i3bAgMBAAECgYA2D26w80T7WZvazYr86BNMePpd -j2mIAqx32KZHzt/lhh40J/SRtX9+Kl0Y7nBoRR5Ja9u/HkAIxNxLiUjwg9r6cpg/ -uITEF5nMt7lAk391BuI+7VOZZGbJDsq2ulPd6lO+C8Kq/PI/e4kXcIjeH6KwQsuR -5vrXfBZ3sQfflaiN4QJBANBt8JY2LIGQF8o89qwUpRL5vbnKQ4IzZ5+TOl4RLR7O -AQpJ81tGuINghO7aunctb6rrcKJrxmEH1whzComybrMCQQDKV49nOBudRBAIgG4K -EnLzsRKISUHMZSJiYTYnablof8cKw1JaQduw7zgrUlLwnroSaAGX88+Jw1f5n2Lh -Vlg5AkBDdUGnrDLtYBCDEQYZHblrkc7ZAeCllDOWjxUV+uMqlCv8A4Ey6omvY57C -m6I8DkWVAQx8VPtozhvHjUw80rZHAkB55HWHAM3h13axKG0htCt7klhPsZHpx6MH -EPjGlXIT+aW2XiPmK3ZlCDcWIenE+lmtbOpI159Wpk8BGXs/s/xBAkEAlAY3ymgx -63BDJEwvOb2IaP8lDDxNsXx9XJNVvQbv5n15vNsLHbjslHfAhAbxnLQ1fLhUPqSi -nNp/xedE1YxutQ== ------END PRIVATE KEY-----' - end - - step 'I click Remove Pages' do - click_link 'Remove pages' - end - - step 'The Pages should get removed' do - expect(@project.pages_deployed?).to be_falsey - end -end diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb index fc4ef26f6b6..db99c179439 100644 --- a/features/steps/project/source/markdown_render.rb +++ b/features/steps/project/source/markdown_render.rb @@ -193,7 +193,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps 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' + find('a', text: %r{^/#id$})['href'] == current_host + project_tree_path(@project, "markdown") + '#id' end step 'The link with text "README.mdID" '\ @@ -203,7 +203,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps step 'The link with text "d/README.mdID" should have '\ 'url "blob/markdown/d/README.mdID"' do - find('a', text: /^d\/README.md#id$/)['href'] == current_host + project_blob_path(@project, "d/markdown/README.md") + '#id' + 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 @@ -212,7 +212,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do - find('a', text: /^\/#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' + find('a', text: %r{^/#id$})['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' end # Wiki diff --git a/features/steps/user.rb b/features/steps/user.rb deleted file mode 100644 index 321c1e942d5..00000000000 --- a/features/steps/user.rb +++ /dev/null @@ -1,38 +0,0 @@ -class Spinach::Features::User < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedUser - include SharedProject - - step 'I should see user "John Doe" page' do - expect(title).to match(/^\s*John Doe/) - end - - step '"John Doe" has contributions' do - user = User.find_by(name: 'John Doe') - project = contributed_project - - # Issue contribution - issue_params = { title: 'Bug in old browser' } - Issues::CreateService.new(project, user, issue_params).execute - - # Push code contribution - event = create(:push_event, project: project, author: user) - - create(:push_event_payload, event: event, commit_count: 3) - end - - step 'I should see contributed projects' do - page.within '#contributed' do - expect(page).to have_content(@contributed_project.name) - end - end - - step 'I should see contributions calendar' do - expect(page).to have_css('.js-contrib-calendar') - end - - def contributed_project - @contributed_project ||= create(:project, :public, :empty_repo) - end -end diff --git a/features/support/capybara_helpers.rb b/features/support/capybara_helpers.rb deleted file mode 100644 index 647f8d087c3..00000000000 --- a/features/support/capybara_helpers.rb +++ /dev/null @@ -1,10 +0,0 @@ -module CapybaraHelpers - def confirm_modal_if_present - if Capybara.current_driver == Capybara.javascript_driver - accept_confirm { yield } - return - end - - yield - end -end diff --git a/features/support/db_cleaner.rb b/features/support/db_cleaner.rb index 8294bb1445f..31c922d23c3 100644 --- a/features/support/db_cleaner.rb +++ b/features/support/db_cleaner.rb @@ -1,6 +1,6 @@ require 'database_cleaner' -DatabaseCleaner[:active_record].strategy = :truncation +DatabaseCleaner[:active_record].strategy = :deletion Spinach.hooks.before_scenario do DatabaseCleaner.start diff --git a/features/support/env.rb b/features/support/env.rb index 7f5b4c1c11b..15211995918 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -20,15 +20,16 @@ Dir["#{Rails.root}/features/steps/shared/*.rb"].each { |file| require file } Spinach.hooks.before_run do include RSpec::Mocks::ExampleMethods + include ActiveJob::TestHelper + include FactoryBot::Syntax::Methods + include GitlabRoutingHelper + RSpec::Mocks.setup TestEnv.init(mailer: false) # skip pre-receive hook check so we can use # web editor and merge TestEnv.disable_pre_receive - - include FactoryBot::Syntax::Methods - include GitlabRoutingHelper end Spinach.hooks.after_scenario do |scenario_data, step_definitions| diff --git a/features/user.feature b/features/user.feature deleted file mode 100644 index e0cadba30a1..00000000000 --- a/features/user.feature +++ /dev/null @@ -1,86 +0,0 @@ -Feature: User - Background: - Given User "John Doe" exists - And "John Doe" owns private project "Enterprise" - - # Signed out - - @javascript - Scenario: I visit user "John Doe" page while not signed in when he owns a public project - Given "John Doe" owns internal project "Internal" - And "John Doe" owns public project "Community" - When I visit user "John Doe" page - And I click on "Personal projects" tab - Then I should see user "John Doe" page - And I should not see project "Enterprise" - And I should not see project "Internal" - And I should see project "Community" - - # Signed in as someone else - - @javascript - Scenario: I visit user "John Doe" page while signed in as someone else when he owns a public project - Given "John Doe" owns public project "Community" - And "John Doe" owns internal project "Internal" - And I sign in as a user - When I visit user "John Doe" page - And I click on "Personal projects" tab - Then I should see user "John Doe" page - And I should not see project "Enterprise" - And I should see project "Internal" - And I should see project "Community" - - @javascript - Scenario: I visit user "John Doe" page while signed in as someone else when he is not authorized to a public project - Given "John Doe" owns internal project "Internal" - And I sign in as a user - When I visit user "John Doe" page - And I click on "Personal projects" tab - Then I should see user "John Doe" page - And I should not see project "Enterprise" - And I should see project "Internal" - And I should not see project "Community" - - @javascript - Scenario: I visit user "John Doe" page while signed in as someone else when he is not authorized to a project I can see - Given I sign in as a user - When I visit user "John Doe" page - And I click on "Personal projects" tab - Then I should see user "John Doe" page - And I should not see project "Enterprise" - And I should not see project "Internal" - And I should not see project "Community" - - # Signed in as the user himself - - @javascript - Scenario: I visit user "John Doe" page while signed in as "John Doe" when he has a public project - Given "John Doe" owns internal project "Internal" - And "John Doe" owns public project "Community" - And I sign in as "John Doe" - When I visit user "John Doe" page - And I click on "Personal projects" tab - Then I should see user "John Doe" page - And I should see project "Enterprise" - And I should see project "Internal" - And I should see project "Community" - - @javascript - Scenario: I visit user "John Doe" page while signed in as "John Doe" when he has no public project - Given I sign in as "John Doe" - When I visit user "John Doe" page - And I click on "Personal projects" tab - Then I should see user "John Doe" page - And I should see project "Enterprise" - And I should not see project "Internal" - And I should not see project "Community" - - @javascript - Scenario: "John Doe" contribution profile - Given I sign in as a user - And "John Doe" has contributions - When I visit user "John Doe" page - And I click on "Contributed projects" tab - Then I should see user "John Doe" page - And I should see contributed projects - And I should see contributions calendar |
