Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-09-13 20:21:33 +0300
committerJose Ivan Vargas <jvargas@gitlab.com>2017-09-13 20:21:33 +0300
commit4c0beb6c024b25ff24c7c2ea966bacab0ee860d5 (patch)
treef3e61556a1cc9132f439d222dca9d6366eb8a6ca /features
parent2d58626a33bc0d4e78eaf0c25965d18a6239fa3b (diff)
parent33010da28b0f2e00e96cc4bf6c439363905a81d5 (diff)
Merge branch 'master' into sh-headless-chrome-support
Diffstat (limited to 'features')
-rw-r--r--features/profile/active_tab.feature29
-rw-r--r--features/profile/emails.feature26
-rw-r--r--features/project/builds/summary.feature30
-rw-r--r--features/project/group_links.feature16
-rw-r--r--features/project/issues/award_emoji.feature45
-rw-r--r--features/project/merge_requests/accept.feature28
-rw-r--r--features/project/merge_requests/revert.feature29
-rw-r--r--features/project/milestone.feature16
-rw-r--r--features/project/team_management.feature26
-rw-r--r--features/project/wiki.feature101
-rw-r--r--features/steps/explore/projects.rb4
-rw-r--r--features/steps/group/milestones.rb2
-rw-r--r--features/steps/profile/active_tab.rb25
-rw-r--r--features/steps/profile/emails.rb48
-rw-r--r--features/steps/project/builds/summary.rb43
-rw-r--r--features/steps/project/fork.rb4
-rw-r--r--features/steps/project/issues/award_emoji.rb107
-rw-r--r--features/steps/project/issues/issues.rb2
-rw-r--r--features/steps/project/issues/milestones.rb2
-rw-r--r--features/steps/project/merge_requests.rb2
-rw-r--r--features/steps/project/merge_requests/acceptance.rb55
-rw-r--r--features/steps/project/merge_requests/revert.rb56
-rw-r--r--features/steps/project/project.rb1
-rw-r--r--features/steps/project/project_group_links.rb51
-rw-r--r--features/steps/project/project_milestone.rb62
-rw-r--r--features/steps/project/redirects.rb2
-rw-r--r--features/steps/project/snippets.rb2
-rw-r--r--features/steps/project/source/markdown_render.rb2
-rw-r--r--features/steps/project/team_management.rb87
-rw-r--r--features/steps/project/wiki.rb195
-rw-r--r--features/steps/shared/active_tab.rb4
-rw-r--r--features/steps/shared/project.rb2
-rw-r--r--features/steps/user.rb13
-rw-r--r--features/support/gitaly.rb3
34 files changed, 21 insertions, 1099 deletions
diff --git a/features/profile/active_tab.feature b/features/profile/active_tab.feature
deleted file mode 100644
index 21d7d6c3800..00000000000
--- a/features/profile/active_tab.feature
+++ /dev/null
@@ -1,29 +0,0 @@
-@profile
-Feature: Profile Active Tab
- Background:
- Given I sign in as a user
-
- Scenario: On Profile Home
- Given I visit profile page
- Then the active main tab should be Home
- And no other main tabs should be active
-
- Scenario: On Profile Account
- Given I visit profile account page
- Then the active main tab should be Account
- And no other main tabs should be active
-
- Scenario: On Profile SSH Keys
- Given I visit profile SSH keys page
- Then the active main tab should be SSH Keys
- And no other main tabs should be active
-
- Scenario: On Profile Preferences
- Given I visit profile preferences page
- Then the active main tab should be Preferences
- And no other main tabs should be active
-
- Scenario: On Profile Authentication log
- Given I visit Authentication log page
- Then the active main tab should be Authentication log
- And no other main tabs should be active
diff --git a/features/profile/emails.feature b/features/profile/emails.feature
deleted file mode 100644
index 19ed949f6ae..00000000000
--- a/features/profile/emails.feature
+++ /dev/null
@@ -1,26 +0,0 @@
-@profile
-Feature: Profile Emails
- Background:
- Given I sign in as a user
- And I visit profile emails page
-
- Scenario: I should see emails
- Then I should see my emails
-
- Scenario: Add new email
- Given I submit new email "my@email.com"
- Then I should see new email "my@email.com"
- And I should see my emails
-
- Scenario: Add duplicate email
- Given I submit duplicate email @user.email
- Then I should not have @user.email added
- And I should see my emails
-
- Scenario: Remove email
- Given I submit new email "my@email.com"
- Then I should see new email "my@email.com"
- And I should see my emails
- Then I click link "Remove" for "my@email.com"
- Then I should not see email "my@email.com"
- And I should see my emails
diff --git a/features/project/builds/summary.feature b/features/project/builds/summary.feature
deleted file mode 100644
index 3bf15b0cf87..00000000000
--- a/features/project/builds/summary.feature
+++ /dev/null
@@ -1,30 +0,0 @@
-Feature: Project Builds Summary
- Background:
- Given I sign in as a user
- And I own a project
- And project has CI enabled
- And project has coverage enabled
- And project has a recent build
-
- @javascript
- Scenario: I browse build details page
- When I visit recent build details page
- Then I see details of a build
- And I see build trace
-
- @javascript
- Scenario: I browse project builds page
- When I visit project builds page
- Then I see coverage
- Then I see button to CI Lint
-
- @javascript
- Scenario: I erase a build
- Given recent build is successful
- And recent build has a build trace
- When I visit recent build details page
- And I click erase build button
- Then recent build has been erased
- And recent build summary does not have artifacts widget
- And recent build summary contains information saying that build has been erased
- And the build count cache is updated
diff --git a/features/project/group_links.feature b/features/project/group_links.feature
deleted file mode 100644
index 2657c4487ad..00000000000
--- a/features/project/group_links.feature
+++ /dev/null
@@ -1,16 +0,0 @@
-Feature: Project Group Links
- Background:
- Given I sign in as a user
- And I own project "Shop"
- And project "Shop" is shared with group "Ops"
- And project "Shop" is not shared with group "Market"
- And I visit project group links page
-
- Scenario: I should see list of groups
- Then I should see project already shared with group "Ops"
- Then I should see project is not shared with group "Market"
-
- @javascript
- Scenario: I share project with group
- When I select group "Market" for share
- Then I should see project is shared with group "Market"
diff --git a/features/project/issues/award_emoji.feature b/features/project/issues/award_emoji.feature
deleted file mode 100644
index 1d7adfdd2c2..00000000000
--- a/features/project/issues/award_emoji.feature
+++ /dev/null
@@ -1,45 +0,0 @@
-@project_issues
-Feature: Award Emoji
- Background:
- Given I sign in as a user
- And I own project "Shop"
- And project "Shop" has issue "Bugfix"
- And I visit "Bugfix" issue page
-
- @javascript
- Scenario: I repeatedly add and remove thumbsup award in the issue
- Given I click the thumbsup award Emoji
- Then I have award added
- Given I click the thumbsup award Emoji
- Then I have no awards added
- Given I click the thumbsup award Emoji
- Then I have award added
-
- @javascript
- Scenario: I add and remove custom award in the issue
- Given I click to emoji-picker
- Then The emoji menu is visible
- And The search field is focused
- Then I click to emoji in the picker
- Then I have award added
- And I can remove it by clicking to icon
-
- @javascript
- Scenario: I can see the list of emoji categories
- Given I click to emoji-picker
- Then The emoji menu is visible
- And The search field is focused
- Then I can see the activity and food categories
-
- @javascript
- Scenario: I can search emoji
- Given I click to emoji-picker
- Then The emoji menu is visible
- And The search field is focused
- And I search "hand"
- Then I see search result for "hand"
-
- @javascript
- Scenario: I add award emoji using regular comment
- Given I leave comment with a single emoji
- Then I have new comment with emoji added
diff --git a/features/project/merge_requests/accept.feature b/features/project/merge_requests/accept.feature
deleted file mode 100644
index 2ab1c19f452..00000000000
--- a/features/project/merge_requests/accept.feature
+++ /dev/null
@@ -1,28 +0,0 @@
-@project_merge_requests
-Feature: Project Merge Requests Acceptance
- Background:
- Given There is an open Merge Request
- And I am signed in as a developer of the project
-
- @javascript
- Scenario: Accepting the Merge Request and removing the source branch
- Given I am on the Merge Request detail page
- When I check the "Remove source branch" option
- And I click on Accept Merge Request
- Then I should see merge request merged
- And I should not see the Remove Source Branch button
-
- @javascript
- Scenario: Accepting the Merge Request when URL has an anchor
- Given I am on the Merge Request detail with note anchor page
- When I check the "Remove source branch" option
- And I click on Accept Merge Request
- Then I should see merge request merged
- And I should not see the Remove Source Branch button
-
- @javascript
- Scenario: Accepting the Merge Request without removing the source branch
- Given I am on the Merge Request detail page
- When I click on Accept Merge Request
- Then I should see merge request merged
- And I should see the Remove Source Branch button
diff --git a/features/project/merge_requests/revert.feature b/features/project/merge_requests/revert.feature
deleted file mode 100644
index aaac5fd7209..00000000000
--- a/features/project/merge_requests/revert.feature
+++ /dev/null
@@ -1,29 +0,0 @@
-@project_merge_requests
-Feature: Revert Merge Requests
- Background:
- Given There is an open Merge Request
- And I am signed in as a developer of the project
- And I am on the Merge Request detail page
- And I click on Accept Merge Request
- And I am on the Merge Request detail page
-
- @javascript
- Scenario: I revert a merge request
- Given I click on the revert button
- And I revert the changes directly
- Then I should see the revert merge request notice
-
- @javascript
- Scenario: I revert a merge request that was previously reverted
- Given I click on the revert button
- And I revert the changes directly
- And I am on the Merge Request detail page
- And I click on the revert button
- And I revert the changes directly
- Then I should see a revert error
-
- @javascript
- Scenario: I revert a merge request in a new merge request
- Given I click on the revert button
- And I revert the changes in a new merge request
- Then I should see the new merge request notice
diff --git a/features/project/milestone.feature b/features/project/milestone.feature
deleted file mode 100644
index 5e7b211fa27..00000000000
--- a/features/project/milestone.feature
+++ /dev/null
@@ -1,16 +0,0 @@
-Feature: Project Milestone
- Background:
- Given I sign in as a user
- And I own project "Shop"
- And project "Shop" has labels: "bug", "feature", "enhancement"
- And project "Shop" has milestone "v2.2"
- And milestone has issue "Bugfix1" with labels: "bug", "feature"
- And milestone has issue "Bugfix2" with labels: "bug", "enhancement"
-
- @javascript
- Scenario: Listing labels from labels tab
- Given I visit project "Shop" milestones page
- And I click link "v2.2"
- And I click link "Labels"
- Then I should see the list of labels
- And I should see the labels "bug", "enhancement" and "feature"
diff --git a/features/project/team_management.feature b/features/project/team_management.feature
deleted file mode 100644
index aed41924cd9..00000000000
--- a/features/project/team_management.feature
+++ /dev/null
@@ -1,26 +0,0 @@
-Feature: Project Team Management
- Background:
- Given I sign in as a user
- And I own project "Shop"
- And gitlab user "Mike"
- And gitlab user "Dmitriy"
- And "Dmitriy" is "Shop" developer
- And I visit project "Shop" team page
-
- Scenario: Cancel team member
- Given I click cancel link for "Dmitriy"
- Then I visit project "Shop" team page
- And I should not see "Dmitriy" in team list
-
- Scenario: Import team from another project
- Given I own project "Website"
- And "Mike" is "Website" reporter
- When I visit project "Shop" team page
- And I click link "Import team from another project"
- And I submit "Website" project for import team
- Then I should see "Mike" in team list as "Reporter"
-
- Scenario: See all members of projects shared group
- Given I share project with group "OpenSource"
- And I visit project "Shop" team page
- Then I should see "Opensource" group user listing
diff --git a/features/project/wiki.feature b/features/project/wiki.feature
deleted file mode 100644
index a04228de03b..00000000000
--- a/features/project/wiki.feature
+++ /dev/null
@@ -1,101 +0,0 @@
-Feature: Project Wiki
- Background:
- Given I sign in as a user
- And I own project "Shop"
- Given I visit project wiki page
-
- Scenario: Add new page
- Given I create the Wiki Home page
- Then I should see the newly created wiki page
-
- Scenario: Add new page with errors
- Given I create the Wiki Home page with no content
- Then I should see a "Content can't be blank" error message
- When I create the Wiki Home page
- Then I should see the newly created wiki page
-
- Scenario: Pressing Cancel while editing a brand new Wiki
- Given I click on the Cancel button
- Then I should be redirected back to the Edit Home Wiki page
-
- Scenario: Edit existing page
- Given I have an existing Wiki page
- And I browse to that Wiki page
- And I click on the Edit button
- And I change the content
- Then I should see the updated content
-
- Scenario: Pressing Cancel while editing an existing Wiki page
- Given I have an existing Wiki page
- And I browse to that Wiki page
- And I click on the Edit button
- And I click on the Cancel button
- Then I should be redirected back to that Wiki page
-
- Scenario: View page history
- Given I have an existing wiki page
- And That page has two revisions
- And I browse to that Wiki page
- And I click the History button
- Then I should see both revisions
-
- Scenario: Destroy Wiki page
- Given I have an existing wiki page
- And I browse to that Wiki page
- And I click on the Edit button
- And I click on the "Delete this page" button
- Then The page should be deleted
-
- Scenario: View all pages
- Given I have an existing wiki page
- And I browse to that Wiki page
- Then I should see the existing page in the pages list
-
- Scenario: File exists in wiki repo
- Given I have an existing Wiki page with images linked on page
- And I browse to wiki page with images
- And I click on existing image link
- Then I should see the image from wiki repo
-
- Scenario: Image in wiki repo shown on the page
- Given I have an existing Wiki page with images linked on page
- And I browse to wiki page with images
- Then Image should be shown on the page
-
- Scenario: File does not exist in wiki repo
- Given I have an existing Wiki page with images linked on page
- And I browse to wiki page with images
- And I click on image link
- Then I should see the new wiki page form
-
- @javascript
- Scenario: New Wiki page that has a path
- Given I create a New page with paths
- Then I should see non-escaped link in the pages list
-
- @javascript
- Scenario: Edit Wiki page that has a path
- Given I create a New page with paths
- And I edit the Wiki page with a path
- Then I should see a non-escaped path
- And I should see the Editing page
- And I change the content
- Then I should see the updated content
-
- @javascript
- Scenario: View the page history of a Wiki page that has a path
- Given I create a New page with paths
- And I view the page history of a Wiki page that has a path
- Then I should see a non-escaped path
- And I should see the page history
-
- @javascript
- Scenario: View an old page version of a Wiki page
- Given I create a New page with paths
- And I edit the Wiki page with a path
- Then I should see a non-escaped path
- And I should see the Editing page
- And I change the content
- Then I click on Page History
- And I should see the page history
- And I should see a link with a version ID
diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb
index 8fb2ac34c32..962e39dde9a 100644
--- a/features/steps/explore/projects.rb
+++ b/features/steps/explore/projects.rb
@@ -36,13 +36,13 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
end
step 'I should see project "Community" home page' do
- page.within '.breadcrumbs .title' do
+ page.within '.breadcrumbs .breadcrumb-item-text' do
expect(page).to have_content 'Community'
end
end
step 'I should see project "Internal" home page' do
- page.within '.breadcrumbs .title' do
+ page.within '.breadcrumbs .breadcrumb-item-text' do
expect(page).to have_content 'Internal'
end
end
diff --git a/features/steps/group/milestones.rb b/features/steps/group/milestones.rb
index 20edcf75ff1..818bbb50d0e 100644
--- a/features/steps/group/milestones.rb
+++ b/features/steps/group/milestones.rb
@@ -47,7 +47,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
end
step 'I click new milestone button' do
- page.within('.breadcrumbs') do
+ page.within('.nav-controls') do
click_link "New milestone"
end
end
diff --git a/features/steps/profile/active_tab.rb b/features/steps/profile/active_tab.rb
deleted file mode 100644
index 069d4e6a23d..00000000000
--- a/features/steps/profile/active_tab.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-class Spinach::Features::ProfileActiveTab < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
- include SharedActiveTab
-
- step 'the active main tab should be Home' do
- ensure_active_main_tab('Profile')
- end
-
- step 'the active main tab should be Account' do
- ensure_active_main_tab('Account')
- end
-
- step 'the active main tab should be SSH Keys' do
- ensure_active_main_tab('SSH Keys')
- end
-
- step 'the active main tab should be Preferences' do
- ensure_active_main_tab('Preferences')
- end
-
- step 'the active main tab should be Authentication log' do
- ensure_active_main_tab('Authentication log')
- end
-end
diff --git a/features/steps/profile/emails.rb b/features/steps/profile/emails.rb
deleted file mode 100644
index 4f44f932a6d..00000000000
--- a/features/steps/profile/emails.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
- include SharedAuthentication
-
- step 'I visit profile emails page' do
- visit profile_emails_path
- end
-
- step 'I should see my emails' do
- expect(page).to have_content(@user.email)
- @user.emails.each do |email|
- expect(page).to have_content(email.email)
- end
- end
-
- step 'I submit new email "my@email.com"' do
- fill_in "email_email", with: "my@email.com"
- click_button "Add"
- end
-
- step 'I should see new email "my@email.com"' do
- email = @user.emails.find_by(email: "my@email.com")
- expect(email).not_to be_nil
- expect(page).to have_content("my@email.com")
- end
-
- step 'I should not see email "my@email.com"' do
- email = @user.emails.find_by(email: "my@email.com")
- expect(email).to be_nil
- expect(page).not_to have_content("my@email.com")
- end
-
- step 'I click link "Remove" for "my@email.com"' do
- # there should only be one remove button at this time
- click_link "Remove"
- # force these to reload as they have been cached
- @user.emails.reload
- end
-
- step 'I submit duplicate email @user.email' do
- fill_in "email_email", with: @user.email
- click_button "Add"
- end
-
- step 'I should not have @user.email added' do
- email = @user.emails.find_by(email: @user.email)
- expect(email).to be_nil
- end
-end
diff --git a/features/steps/project/builds/summary.rb b/features/steps/project/builds/summary.rb
deleted file mode 100644
index 40d373a680b..00000000000
--- a/features/steps/project/builds/summary.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedBuilds
- include RepoHelpers
-
- step 'I see coverage' do
- page.within('td.coverage') do
- expect(page).to have_content "99.9%"
- end
- end
-
- step 'I see button to CI Lint' do
- page.within('.nav-controls') do
- ci_lint_tool_link = page.find_link('CI lint')
- expect(ci_lint_tool_link[:href]).to end_with(ci_lint_path)
- end
- end
-
- step 'I click erase build button' do
- accept_confirm { click_link 'Erase' }
- end
-
- step 'recent build has been erased' do
- expect(@build).not_to have_trace
- expect(@build.artifacts_file.exists?).to be_falsy
- expect(@build.artifacts_metadata.exists?).to be_falsy
- end
-
- step 'recent build summary does not have artifacts widget' do
- expect(page).to have_no_css('.artifacts')
- end
-
- step 'recent build summary contains information saying that build has been erased' do
- page.within('.erased') do
- expect(page).to have_content 'Job has been erased'
- end
- end
-
- step 'the build count cache is updated' do
- expect(@build.project.running_or_pending_build_count).to eq @build.project.builds.running_or_pending.count(:all)
- end
-end
diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb
index 3b8d9af96c1..f88738b4c61 100644
--- a/features/steps/project/fork.rb
+++ b/features/steps/project/fork.rb
@@ -37,7 +37,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
step 'I goto the Merge Requests page' do
page.within '.nav-sidebar' do
- click_link "Merge Requests"
+ first(:link, "Merge Requests").click
end
end
@@ -52,7 +52,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
end
step 'I visit the forks page of the "Shop" project' do
- @project = Project.where(name: 'Shop').last
+ @project = Project.where(name: 'Shop').first
visit project_forks_path(@project)
end
diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb
deleted file mode 100644
index bbd284b4633..00000000000
--- a/features/steps/project/issues/award_emoji.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include Select2Helper
-
- step 'I visit "Bugfix" issue page' do
- visit project_issue_path(@project, @issue)
- end
-
- step 'I click the thumbsup award Emoji' do
- page.within '.awards' do
- thumbsup = page.first('.award-control')
- thumbsup.click
- thumbsup.hover
- end
- end
-
- step 'I click to emoji-picker' do
- page.within '.awards' do
- page.find('.js-add-award').click
- end
- end
-
- step 'I click to emoji in the picker' do
- page.within '.emoji-menu-content' do
- emoji_button = page.first('.js-emoji-btn')
- emoji_button.hover
- emoji_button.click
- end
- end
-
- step 'I can remove it by clicking to icon' do
- page.within '.awards' do
- expect do
- page.find('.js-emoji-btn.active').click
- wait_for_requests
- end.to change { page.all(".award-control.js-emoji-btn").size }.from(3).to(2)
- end
- end
-
- step 'I can see the activity and food categories' do
- page.within '.emoji-menu' do
- expect(page).not_to have_selector 'Activity'
- expect(page).not_to have_selector 'Food'
- end
- end
-
- step 'I have new comment with emoji added' do
- expect(page).to have_selector 'gl-emoji[data-name="smile"]'
- end
-
- step 'I have award added' do
- page.within '.awards' do
- expect(page).to have_selector '.js-emoji-btn'
- expect(page.find('.js-emoji-btn.active .js-counter')).to have_content '1'
- expect(page).to have_css(".js-emoji-btn.active[data-original-title='You']")
- end
- end
-
- step 'I have no awards added' do
- page.within '.awards' do
- expect(page).to have_selector '.award-control.js-emoji-btn'
- expect(page.all('.award-control.js-emoji-btn').size).to eq(2)
-
- # Check tooltip data
- page.all('.award-control.js-emoji-btn').each do |element|
- expect(element['title']).to eq("")
- end
-
- page.all('.award-control .js-counter').each do |element|
- expect(element).to have_content '0'
- end
- end
- end
-
- step 'project "Shop" has issue "Bugfix"' do
- @project = Project.find_by(name: 'Shop')
- @issue = create(:issue, title: 'Bugfix', project: project)
- end
-
- step 'I leave comment with a single emoji' do
- page.within('.js-main-target-form') do
- fill_in 'note[note]', with: ':smile:'
- click_button 'Comment'
- end
- end
-
- step 'I search "hand"' do
- fill_in 'emoji-menu-search', with: 'hand'
- end
-
- step 'I see search result for "hand"' do
- page.within '.emoji-menu-content' do
- expect(page).to have_selector '[data-name="raised_hand"]'
- end
- end
-
- step 'The emoji menu is visible' do
- page.find(".emoji-menu.is-visible")
- end
-
- step 'The search field is focused' do
- expect(page).to have_selector('.js-emoji-menu-search')
- expect(page.evaluate_script("document.activeElement.classList.contains('js-emoji-menu-search')")).to eq(true)
- end
-end
diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb
index f7dd4fc21e9..b9460f5b534 100644
--- a/features/steps/project/issues/issues.rb
+++ b/features/steps/project/issues/issues.rb
@@ -62,7 +62,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
step 'I click link "New issue"' do
- page.within '.breadcrumbs' do
+ page.within '#content-body' do
page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue')
end
end
diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb
index 4765bb7cebe..33a24e8913a 100644
--- a/features/steps/project/issues/milestones.rb
+++ b/features/steps/project/issues/milestones.rb
@@ -17,7 +17,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
end
step 'I click link "New Milestone"' do
- page.within('.breadcrumbs') do
+ page.within('.nav-controls') do
click_link "New milestone"
end
end
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index a57edc287be..17b1bcd02f3 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -15,7 +15,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I click link "New Merge Request"' do
- page.within '.breadcrumbs' do
+ page.within '.nav-controls' do
page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request')
end
end
diff --git a/features/steps/project/merge_requests/acceptance.rb b/features/steps/project/merge_requests/acceptance.rb
deleted file mode 100644
index 3c640e3512a..00000000000
--- a/features/steps/project/merge_requests/acceptance.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps
- include LoginHelpers
- include WaitForRequests
-
- step 'I am on the Merge Request detail page' do
- visit merge_request_path(@merge_request)
- end
-
- step 'I am on the Merge Request detail with note anchor page' do
- visit merge_request_path(@merge_request, anchor: 'note_123')
- end
-
- step 'I uncheck the "Remove source branch" option' do
- uncheck('Remove source branch')
- end
-
- step 'I check the "Remove source branch" option' do
- check('Remove source branch')
- end
-
- step 'I click on Accept Merge Request' do
- click_button('Merge')
- end
-
- step 'I should see the Remove Source Branch button' do
- expect(page).to have_selector('.js-remove-branch-button')
-
- # Wait for View Resource requests to complete so they don't blow up if they are
- # only handled after `DatabaseCleaner` has already run
- wait_for_requests
- end
-
- step 'I should not see the Remove Source Branch button' do
- expect(page).not_to have_selector('.js-remove-branch-button')
-
- # Wait for View Resource requests to complete so they don't blow up if they are
- # only handled after `DatabaseCleaner` has already run
- wait_for_requests
- end
-
- step 'There is an open Merge Request' do
- @user = create(:user)
- @project = create(:project, :public, :repository)
- @project_member = create(:project_member, :developer, user: @user, project: @project)
- @merge_request = create(:merge_request, :with_diffs, :simple, source_project: @project)
- end
-
- step 'I am signed in as a developer of the project' do
- sign_in(@user)
- end
-
- step 'I should see merge request merged' do
- expect(page).to have_content('The changes were merged into')
- end
-end
diff --git a/features/steps/project/merge_requests/revert.rb b/features/steps/project/merge_requests/revert.rb
deleted file mode 100644
index 25ccf5ab180..00000000000
--- a/features/steps/project/merge_requests/revert.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps
- include LoginHelpers
- include WaitForRequests
-
- step 'I click on the revert button' do
- find("a[href='#modal-revert-commit']").click
- end
-
- step 'I revert the changes directly' do
- page.within('#modal-revert-commit') do
- uncheck 'create_merge_request'
- click_button 'Revert'
- end
- end
-
- step 'I should see the revert merge request notice' do
- page.should have_content('The merge request has been successfully reverted.')
- wait_for_requests
- end
-
- step 'I should not see the revert button' do
- expect(page).not_to have_selector(:xpath, "a[href='#modal-revert-commit']")
- end
-
- step 'I am on the Merge Request detail page' do
- visit merge_request_path(@merge_request)
- end
-
- step 'I click on Accept Merge Request' do
- click_button('Merge')
- end
-
- step 'I am signed in as a developer of the project' do
- @user = create(:user) { |u| @project.add_developer(u) }
- sign_in(@user)
- end
-
- step 'There is an open Merge Request' do
- @merge_request = create(:merge_request, :with_diffs, :simple)
- @project = @merge_request.source_project
- end
-
- step 'I should see a revert error' do
- page.should have_content('Sorry, we cannot revert this merge request automatically.')
- end
-
- step 'I revert the changes in a new merge request' do
- page.within('#modal-revert-commit') do
- click_button 'Revert'
- end
- end
-
- step 'I should see the new merge request notice' do
- page.should have_content('The merge request has been successfully reverted. You can now submit a merge request to get this change into the original branch.')
- end
-end
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
index 0a89c1baf20..3a762be8f1f 100644
--- a/features/steps/project/project.rb
+++ b/features/steps/project/project.rb
@@ -6,7 +6,6 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step 'change project settings' do
fill_in 'project_name_edit', with: 'NewName'
- select 'Disabled', from: 'project_project_feature_attributes_issues_access_level'
end
step 'I save project' do
diff --git a/features/steps/project/project_group_links.rb b/features/steps/project/project_group_links.rb
deleted file mode 100644
index 47ee31786a6..00000000000
--- a/features/steps/project/project_group_links.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include Select2Helper
-
- step 'I should see project already shared with group "Ops"' do
- page.within '.project-members-groups' do
- expect(page).to have_content "Ops"
- end
- end
-
- step 'I should see project is not shared with group "Market"' do
- page.within '.project-members-groups' do
- expect(page).not_to have_content "Market"
- end
- end
-
- step 'I select group "Market" for share' do
- click_link 'Share with group'
- group = Group.find_by(path: 'market')
- select2(group.id, from: "#link_group_id")
- select "Master", from: 'link_group_access'
- click_button "Share"
- end
-
- step 'I should see project is shared with group "Market"' do
- page.within '.project-members-groups' do
- expect(page).to have_content "Market"
- end
- end
-
- step 'project "Shop" is shared with group "Ops"' do
- group = create(:group, name: 'Ops')
- share_link = project.project_group_links.new(group_access: Gitlab::Access::MASTER)
- share_link.group_id = group.id
- share_link.save!
- end
-
- step 'project "Shop" is not shared with group "Market"' do
- create(:group, name: 'Market', path: 'market')
- end
-
- step 'I visit project group links page' do
- visit project_group_links_path(project)
- end
-
- def project
- @project ||= Project.find_by_name "Shop"
- end
-end
diff --git a/features/steps/project/project_milestone.rb b/features/steps/project/project_milestone.rb
deleted file mode 100644
index b2d08515e77..00000000000
--- a/features/steps/project/project_milestone.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include WaitForRequests
-
- step 'milestone has issue "Bugfix1" with labels: "bug", "feature"' do
- project = Project.find_by(name: "Shop")
- milestone = project.milestones.find_by(title: 'v2.2')
- issue = create(:issue, title: "Bugfix1", project: project, milestone: milestone)
- issue.labels << project.labels.find_by(title: 'bug')
- issue.labels << project.labels.find_by(title: 'feature')
- end
-
- step 'milestone has issue "Bugfix2" with labels: "bug", "enhancement"' do
- project = Project.find_by(name: "Shop")
- milestone = project.milestones.find_by(title: 'v2.2')
- issue = create(:issue, title: "Bugfix2", project: project, milestone: milestone)
- issue.labels << project.labels.find_by(title: 'bug')
- issue.labels << project.labels.find_by(title: 'enhancement')
- end
-
- step 'project "Shop" has milestone "v2.2"' do
- project = Project.find_by(name: "Shop")
- milestone = create(:milestone,
- title: "v2.2",
- project: project,
- description: "# Description header"
- )
- 3.times { create(:issue, project: project, milestone: milestone) }
- end
-
- step 'I should see the list of labels' do
- expect(page).to have_selector('ul.manage-labels-list')
- end
-
- step 'I should see the labels "bug", "enhancement" and "feature"' do
- wait_for_requests
-
- page.within('#tab-issues') do
- expect(page).to have_content 'bug'
- expect(page).to have_content 'enhancement'
- expect(page).to have_content 'feature'
- end
- end
-
- step 'I should see the "bug" label listed only once' do
- page.within('#tab-labels') do
- expect(page).to have_content('bug', count: 1)
- end
- end
-
- step 'I click link "v2.2"' do
- click_link "v2.2"
- end
-
- step 'I click link "Labels"' do
- page.within('.nav-sidebar') do
- page.find(:xpath, "//a[@href='#tab-labels']").click
- end
- end
-end
diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb
index 100e674abed..9ce86ca45d0 100644
--- a/features/steps/project/redirects.rb
+++ b/features/steps/project/redirects.rb
@@ -18,7 +18,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step 'I should see project "Community" home page' do
Gitlab.config.gitlab.should_receive(:host).and_return("www.example.com")
- page.within '.breadcrumbs .title' do
+ page.within '.breadcrumbs .breadcrumb-item-text' do
expect(page).to have_content 'Community'
end
end
diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb
index 0646a70acfd..12257593621 100644
--- a/features/steps/project/snippets.rb
+++ b/features/steps/project/snippets.rb
@@ -23,7 +23,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
end
step 'I click link "New snippet"' do
- page.within '.breadcrumbs' do
+ page.within '.nav-controls' do
first(:link, "New snippet").click
end
end
diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb
index 243a0f54f7f..f6445b57ec0 100644
--- a/features/steps/project/source/markdown_render.rb
+++ b/features/steps/project/source/markdown_render.rb
@@ -218,7 +218,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
# Wiki
step 'I go to wiki page' do
- click_link "Wiki"
+ first(:link, "Wiki").click
expect(current_path).to eq project_wiki_path(@project, "home")
end
diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb
deleted file mode 100644
index 5c4025ace34..00000000000
--- a/features/steps/project/team_management.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include Select2Helper
-
- step 'I should not see "Dmitriy" in team list' do
- user = User.find_by(name: "Dmitriy")
- expect(page).not_to have_content(user.name)
- expect(page).not_to have_content(user.username)
- end
-
- step 'I should see "Mike" in team list as "Reporter"' do
- user = User.find_by(name: 'Mike')
- project_member = project.project_members.find_by(user_id: user.id)
- page.within "#project_member_#{project_member.id}" do
- expect(page).to have_content('Mike')
- expect(page).to have_content('Reporter')
- end
- end
-
- step 'gitlab user "Mike"' do
- create(:user, name: "Mike")
- end
-
- step 'gitlab user "Dmitriy"' do
- create(:user, name: "Dmitriy")
- end
-
- step '"Dmitriy" is "Shop" developer' do
- user = User.find_by(name: "Dmitriy")
- project = Project.find_by(name: "Shop")
- project.team << [user, :developer]
- end
-
- step 'I own project "Website"' do
- @project = create(:project, name: "Website", namespace: @user.namespace)
- @project.team << [@user, :master]
- end
-
- step '"Mike" is "Website" reporter' do
- user = User.find_by(name: "Mike")
- project = Project.find_by(name: "Website")
- project.team << [user, :reporter]
- end
-
- step 'I click link "Import team from another project"' do
- page.within '.users-project-form' do
- click_link "Import"
- end
- end
-
- When 'I submit "Website" project for import team' do
- project = Project.find_by(name: "Website")
- select project.name_with_namespace, from: 'source_project_id'
- click_button 'Import'
- end
-
- step 'I click cancel link for "Dmitriy"' do
- project = Project.find_by(name: "Shop")
- user = User.find_by(name: 'Dmitriy')
- project_member = project.project_members.find_by(user_id: user.id)
- page.within "#project_member_#{project_member.id}" do
- click_link('Remove user from project')
- end
- end
-
- step 'I share project with group "OpenSource"' do
- project = Project.find_by(name: 'Shop')
- os_group = create(:group, name: 'OpenSource')
- create(:project, group: os_group)
- @os_user1 = create(:user)
- @os_user2 = create(:user)
- os_group.add_owner(@os_user1)
- os_group.add_user(@os_user2, Gitlab::Access::DEVELOPER)
- share_link = project.project_group_links.new(group_access: Gitlab::Access::MASTER)
- share_link.group_id = os_group.id
- share_link.save!
- end
-
- step 'I should see "Opensource" group user listing' do
- page.within '.project-members-groups' do
- expect(page).to have_content('OpenSource')
- expect(first('.group_member')).to have_content('Master')
- end
- end
-end
diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb
deleted file mode 100644
index 855757e34b3..00000000000
--- a/features/steps/project/wiki.rb
+++ /dev/null
@@ -1,195 +0,0 @@
-class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedNote
- include SharedPaths
-
- step 'I click on the Cancel button' do
- page.within(:css, ".wiki-form .form-actions") do
- click_on "Cancel"
- end
- end
-
- step 'I should be redirected back to the Edit Home Wiki page' do
- expect(current_path).to eq project_wiki_path(project, :home)
- end
-
- step 'I create the Wiki Home page' do
- fill_in "wiki_content", with: '[link test](test)'
- page.within '.wiki-form' do
- click_on "Create page"
- end
- end
-
- step 'I create the Wiki Home page with no content' do
- fill_in "wiki_content", with: ''
- page.within '.wiki-form' do
- click_on "Create page"
- end
- end
-
- step 'I should see the newly created wiki page' do
- expect(page).to have_content "Home"
- expect(page).to have_content "link test"
-
- click_link "link test"
- expect(page).to have_content "Create page"
- end
-
- step 'I have an existing Wiki page' do
- wiki.create_page("existing", "content", :markdown, "first commit")
- @page = wiki.find_page("existing")
- end
-
- step 'I browse to that Wiki page' do
- visit project_wiki_path(project, @page)
- end
-
- step 'I click on the Edit button' do
- click_on "Edit"
- end
-
- step 'I change the content' do
- fill_in "Content", with: 'Updated Wiki Content'
- click_on "Save changes"
- end
-
- step 'I should see the updated content' do
- expect(page).to have_content "Updated Wiki Content"
- end
-
- step 'I should be redirected back to that Wiki page' do
- expect(current_path).to eq project_wiki_path(project, @page)
- end
-
- step 'That page has two revisions' do
- @page.update(content: "new content", message: "second commit")
- end
-
- step 'I click the History button' do
- click_on 'Page history'
- end
-
- step 'I should see both revisions' do
- expect(page).to have_content current_user.name
- expect(page).to have_content "first commit"
- expect(page).to have_content "second commit"
- end
-
- step 'I click on the "Delete this page" button' do
- click_on "Delete"
- end
-
- step 'The page should be deleted' do
- expect(page).to have_content "Page was successfully deleted"
- end
-
- step 'I should see the existing page in the pages list' do
- expect(page).to have_content current_user.name
- expect(find('.wiki-pages')).to have_content @page.title.capitalize
- end
-
- step 'I have an existing Wiki page with images linked on page' do
- wiki.create_page("pictures", "Look at this [image](image.jpg)\n\n ![alt text](image.jpg)", :markdown, "first commit")
- @wiki_page = wiki.find_page("pictures")
- end
-
- step 'I browse to wiki page with images' do
- visit project_wiki_path(project, @wiki_page)
- end
-
- step 'I click on existing image link' do
- file = Gollum::File.new(wiki.wiki)
- Gollum::Wiki.any_instance.stub(:file).with("image.jpg", "master", true).and_return(file)
- Gollum::File.any_instance.stub(:mime_type).and_return("image/jpeg")
- expect(page).to have_link('image', href: "#{wiki.wiki_base_path}/image.jpg")
- click_on "image"
- end
-
- step 'I should see the image from wiki repo' do
- expect(current_path).to match('wikis/image.jpg')
- expect(page).not_to have_xpath('/html') # Page should render the image which means there is no html involved
- Gollum::Wiki.any_instance.unstub(:file)
- Gollum::File.any_instance.unstub(:mime_type)
- end
-
- step 'Image should be shown on the page' do
- expect(page).to have_xpath("//img[@data-src=\"image.jpg\"]")
- end
-
- step 'I click on image link' do
- expect(page).to have_link('image', href: "#{wiki.wiki_base_path}/image.jpg")
- click_on "image"
- end
-
- step 'I should see the new wiki page form' do
- expect(current_path).to match('wikis/image.jpg')
- expect(page).to have_content('New Wiki Page')
- expect(page).to have_content('Create page')
- end
-
- step 'I create a New page with paths' do
- click_on 'New page'
- fill_in 'Page slug', with: 'one/two/three-test'
- page.within '#modal-new-wiki' do
- click_on 'Create page'
- end
- fill_in "wiki_content", with: 'wiki content'
- page.within '.wiki-form' do
- click_on "Create page"
- end
- expect(current_path).to include 'one/two/three-test'
- end
-
- step 'I should see non-escaped link in the pages list' do
- expect(page).to have_xpath("//a[@href='/#{project.full_path}/wikis/one/two/three-test']")
- end
-
- step 'I edit the Wiki page with a path' do
- expect(find('.wiki-pages')).to have_content('Three')
- click_on 'Three'
- expect(find('.nav-text')).to have_content('Three')
- click_on 'Edit'
- end
-
- step 'I should see a non-escaped path' do
- expect(current_path).to include 'one/two/three-test'
- end
-
- step 'I should see the Editing page' do
- expect(page).to have_content('Edit Page')
- end
-
- step 'I view the page history of a Wiki page that has a path' do
- click_on 'Three'
- click_on 'Page history'
- end
-
- step 'I click on Page History' do
- click_on 'Page history'
- end
-
- step 'I should see the page history' do
- page.within(:css, ".nav-text") do
- expect(page).to have_content('History')
- end
- end
-
- step 'I search for Wiki content' do
- fill_in "Search", with: "wiki_content"
- click_button "Search"
- end
-
- step 'I should see a link with a version ID' do
- find('a[href*="?version_id"]')
- end
-
- step 'I should see a "Content can\'t be blank" error message' do
- expect(page).to have_content('The form contains the following error:')
- expect(page).to have_content('Content can\'t be blank')
- end
-
- def wiki
- @project_wiki = ProjectWiki.new(project, current_user)
- end
-end
diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb
index 2bb21a798aa..104d024fee2 100644
--- a/features/steps/shared/active_tab.rb
+++ b/features/steps/shared/active_tab.rb
@@ -11,7 +11,7 @@ module SharedActiveTab
end
def ensure_active_sub_tab(content)
- expect(find('.sidebar-sub-level-items > li.active')).to have_content(content)
+ expect(find('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)')).to have_content(content)
end
def ensure_active_sub_nav(content)
@@ -23,7 +23,7 @@ module SharedActiveTab
end
step 'no other sub tabs should be active' do
- expect(page).to have_selector('.sidebar-sub-level-items > li.active', count: 1)
+ expect(page).to have_selector('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)', count: 1)
end
step 'no other sub navs should be active' do
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index 605c9a3ab71..96cc0745e97 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -89,7 +89,7 @@ module SharedProject
step 'I should see project settings' do
expect(current_path).to eq edit_project_path(@project)
expect(page).to have_content("Project name")
- expect(page).to have_content("Sharing and permissions")
+ expect(page).to have_content("Permissions")
end
def current_project
diff --git a/features/steps/user.rb b/features/steps/user.rb
index 59385a6ab59..321c1e942d5 100644
--- a/features/steps/user.rb
+++ b/features/steps/user.rb
@@ -17,14 +17,9 @@ class Spinach::Features::User < Spinach::FeatureSteps
Issues::CreateService.new(project, user, issue_params).execute
# Push code contribution
- push_params = {
- project: project,
- action: Event::PUSHED,
- author_id: user.id,
- data: { commit_count: 3 }
- }
-
- Event.create(push_params)
+ 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
@@ -38,6 +33,6 @@ class Spinach::Features::User < Spinach::FeatureSteps
end
def contributed_project
- @contributed_project ||= create(:project, :public)
+ @contributed_project ||= create(:project, :public, :empty_repo)
end
end
diff --git a/features/support/gitaly.rb b/features/support/gitaly.rb
new file mode 100644
index 00000000000..3cd5f4ce497
--- /dev/null
+++ b/features/support/gitaly.rb
@@ -0,0 +1,3 @@
+Spinach.hooks.before_scenario do
+ allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_return(true)
+end