diff options
Diffstat (limited to 'features')
92 files changed, 509 insertions, 1958 deletions
diff --git a/features/admin/active_tab.feature b/features/admin/active_tab.feature deleted file mode 100644 index f5bb06dea7d..00000000000 --- a/features/admin/active_tab.feature +++ /dev/null @@ -1,54 +0,0 @@ -@admin -Feature: Admin Active Tab - Background: - Given I sign in as an admin - - Scenario: On Admin Home - Given I visit admin page - Then the active main tab should be Overview - And no other main tabs should be active - - Scenario: On Admin Projects - Given I visit admin projects page - Then the active main tab should be Overview - And the active sub tab should be Projects - And no other main tabs should be active - And no other sub tabs should be active - - Scenario: On Admin Groups - Given I visit admin groups page - Then the active main tab should be Overview - And the active sub tab should be Groups - And no other main tabs should be active - And no other sub tabs should be active - - Scenario: On Admin Users - Given I visit admin users page - Then the active main tab should be Overview - And the active sub tab should be Users - And no other main tabs should be active - And no other sub tabs should be active - - Scenario: On Admin Logs - Given I visit admin logs page - Then the active main tab should be Monitoring - And the active sub tab should be Logs - And no other main tabs should be active - And no other sub tabs should be active - - Scenario: On Admin Messages - Given I visit admin messages page - Then the active main tab should be Messages - And no other main tabs should be active - - Scenario: On Admin Hooks - Given I visit admin hooks page - Then the active main tab should be Hooks - And no other main tabs should be active - - Scenario: On Admin Resque - Given I visit admin Resque page - Then the active main tab should be Monitoring - And the active sub tab should be Resque - And no other main tabs should be active - And no other sub tabs should be active diff --git a/features/admin/appearance.feature b/features/admin/appearance.feature deleted file mode 100644 index 5c1dd7531c1..00000000000 --- a/features/admin/appearance.feature +++ /dev/null @@ -1,37 +0,0 @@ -Feature: Admin Appearance - Scenario: Create new appearance - Given I sign in as an admin - And I visit admin appearance page - When submit form with new appearance - Then I should be redirected to admin appearance page - And I should see newly created appearance - - Scenario: Preview appearance - Given application has custom appearance - And I sign in as an admin - When I visit admin appearance page - And I click preview button - Then I should see a customized appearance - - Scenario: Custom sign-in page - Given application has custom appearance - When I visit login page - Then I should see a customized appearance - - Scenario: Appearance logo - Given application has custom appearance - And I sign in as an admin - And I visit admin appearance page - When I attach a logo - Then I should see a logo - And I remove the logo - Then I should see logo removed - - Scenario: Header logos - Given application has custom appearance - And I sign in as an admin - And I visit admin appearance page - When I attach header logos - Then I should see header logos - And I remove the header logos - Then I should see header logos removed diff --git a/features/admin/applications.feature b/features/admin/applications.feature deleted file mode 100644 index 2a00e1666c0..00000000000 --- a/features/admin/applications.feature +++ /dev/null @@ -1,18 +0,0 @@ -@admin -Feature: Admin Applications - Background: - Given I sign in as an admin - And I visit applications page - - Scenario: I can manage application - Then I click on new application button - And 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 applications page - And I click to remove application - Then I see that application is removed
\ No newline at end of file diff --git a/features/admin/broadcast_messages.feature b/features/admin/broadcast_messages.feature deleted file mode 100644 index 4f9c651561e..00000000000 --- a/features/admin/broadcast_messages.feature +++ /dev/null @@ -1,33 +0,0 @@ -@admin -Feature: Admin Broadcast Messages - Background: - Given I sign in as an admin - And application already has a broadcast message - And I visit admin messages page - - Scenario: See broadcast messages list - Then I should see all broadcast messages - - Scenario: Create a customized broadcast message - When submit form with new customized broadcast message - Then I should be redirected to admin messages page - And I should see newly created broadcast message - Then I visit dashboard page - And I should see a customized broadcast message - - Scenario: Edit an existing broadcast message - When I edit an existing broadcast message - And I change the broadcast message text - Then I should be redirected to admin messages page - And I should see the updated broadcast message - - Scenario: Remove an existing broadcast message - When I remove an existing broadcast message - Then I should be redirected to admin messages page - And I should not see the removed broadcast message - - @javascript - Scenario: Live preview a customized broadcast message - When I visit admin messages page - And I enter a broadcast message with Markdown - Then I should see a live preview of the rendered broadcast message diff --git a/features/admin/deploy_keys.feature b/features/admin/deploy_keys.feature deleted file mode 100644 index 33439cd1e85..00000000000 --- a/features/admin/deploy_keys.feature +++ /dev/null @@ -1,16 +0,0 @@ -@admin -Feature: Admin Deploy Keys - Background: - Given I sign in as an admin - And there are public deploy keys in system - - Scenario: Deploy Keys list - When I visit admin deploy keys page - Then I should see all public deploy keys - - Scenario: Deploy Keys new - When I visit admin deploy keys page - And I click 'New Deploy Key' - And I submit new deploy key - Then I should be on admin deploy keys page - And I should see newly created deploy key diff --git a/features/admin/groups.feature b/features/admin/groups.feature deleted file mode 100644 index 657e847cf4a..00000000000 --- a/features/admin/groups.feature +++ /dev/null @@ -1,49 +0,0 @@ -@admin -Feature: Admin Groups - Background: - Given I sign in as an admin - And I have group with projects - And User "John Doe" exists - And I visit admin groups page - - Scenario: See group list - Then I should be all groups - - Scenario: Create a group - When I click new group link - And submit form with new group info - Then I should be redirected to group page - And I should see newly created group - - @javascript - Scenario: Add user into projects in group - When I visit admin group page - When I select user "John Doe" from user list as "Reporter" - Then I should see "John Doe" in team list in every project as "Reporter" - - Scenario: Shared projects - Given group has shared projects - When I visit group page - Then I should see project shared with group - - @javascript - Scenario: Invite user to a group by e-mail - When I visit admin group page - When I select user "johndoe@gitlab.com" from user list as "Reporter" - Then I should see "johndoe@gitlab.com" in team list in every project as "Reporter" - - @javascript - Scenario: Signed in admin should be able to add himself to a group - Given "John Doe" is owner of group "Owned" - When I visit group "Owned" members page - When I select current user as "Developer" - Then I should see current user as "Developer" - - @javascript - Scenario: Signed in admin should be able to remove himself from group - Given current user is developer of group "Owned" - When I visit group "Owned" members page - Then I should see current user as "Developer" - When I click on the "Remove User From Group" button for current user - When I visit group "Owned" members page - Then I should not see current user as "Developer" diff --git a/features/admin/labels.feature b/features/admin/labels.feature deleted file mode 100644 index 1af0e700bd4..00000000000 --- a/features/admin/labels.feature +++ /dev/null @@ -1,38 +0,0 @@ -Feature: Admin Issues Labels - Background: - Given I sign in as an admin - And I have labels: "bug", "feature", "enhancement" - Given I visit admin labels page - - Scenario: I should see labels list - Then I should see label 'bug' - And I should see label 'feature' - - Scenario: I create new label - Given I submit new label 'support' - Then I should see label 'support' - - Scenario: I edit label - Given I visit 'bug' label edit page - When I change label 'bug' to 'fix' - Then I should not see label 'bug' - Then I should see label 'fix' - - Scenario: I remove label - When I remove label 'bug' - Then I should not see label 'bug' - - @javascript - Scenario: I delete all labels - When I delete all labels - Then I should see labels help message - - Scenario: I create a label with invalid color - Given I visit admin new label page - When I submit new label with invalid color - Then I should see label color error message - - Scenario: I create a label that already exists - Given I visit admin new label page - When I submit new label 'bug' - Then I should see label exist error message diff --git a/features/admin/projects.feature b/features/admin/projects.feature deleted file mode 100644 index 8929bcf8d80..00000000000 --- a/features/admin/projects.feature +++ /dev/null @@ -1,47 +0,0 @@ -@admin -Feature: Admin Projects - Background: - Given I sign in as an admin - And there are projects in system - - Scenario: I should see non-archived projects in the list - Given archived project "Archive" - When I visit admin projects page - Then I should see all non-archived projects - And I should not see project "Archive" - - @javascript - Scenario: I should see all projects in the list - Given archived project "Archive" - When I visit admin projects page - And I select "Show archived projects" - Then I should see all projects - And I should see "archived" label - - Scenario: Projects show - When I visit admin projects page - And I click on first project - Then I should see project details - - @javascript - Scenario: Transfer project - Given group 'Web' - And I visit admin project page - When I transfer project to group 'Web' - Then I should see project transfered - - @javascript - Scenario: Signed in admin should be able to add himself to a project - Given "John Doe" owns private project "Enterprise" - When I visit project "Enterprise" members page - When I select current user as "Developer" - Then I should see current user as "Developer" - - @javascript - Scenario: Signed in admin should be able to remove himself from a project - Given "John Doe" owns private project "Enterprise" - And current user is developer of project "Enterprise" - When I visit project "Enterprise" members page - Then I should see current user as "Developer" - When I click on the "Remove User From Project" button for current user - Then I should not see current user as "Developer" diff --git a/features/admin/settings.feature b/features/admin/settings.feature deleted file mode 100644 index e38eea2cfed..00000000000 --- a/features/admin/settings.feature +++ /dev/null @@ -1,19 +0,0 @@ -@admin -Feature: Admin Settings - Background: - Given I sign in as an admin - And I visit admin settings page - - Scenario: Change application settings - When I modify settings and save form - Then I should see application settings saved - - Scenario: Change Slack Service Template settings - When I click on "Service Templates" - And I click on "Slack" service - And I fill out Slack settings - Then I check all events and submit form - And I should see service template settings saved - Then I click on "Slack" service - And I should see all checkboxes checked - And I should see Slack settings saved diff --git a/features/admin/users.feature b/features/admin/users.feature deleted file mode 100644 index 6755645778a..00000000000 --- a/features/admin/users.feature +++ /dev/null @@ -1,65 +0,0 @@ -@admin -Feature: Admin Users - Background: - Given I sign in as an admin - And system has users - - Scenario: On Admin Users - Given I visit admin users page - Then I should see all users - - Scenario: Edit user and change username to non ascii char - When I visit admin users page - And Click edit - And Input non ascii char in username - And Click save - Then See username error message - And Not changed form action url - - Scenario: Show user attributes - Given user "Mike" with groups and projects - Given I visit admin users page - And click on "Mike" link - Then I should see user "Mike" details - - Scenario: Edit my user attributes - Given I visit admin users page - And click edit on my user - When I submit modified user - Then I see user attributes changed - - @javascript - Scenario: Remove users secondary email - Given I visit admin users page - And I view the user with secondary email - And I see the secondary email - When I click remove secondary email - Then I should not see secondary email anymore - - Scenario: Show user keys - Given user "Pete" with ssh keys - And I visit admin users page - And click on user "Pete" - And click on ssh keys tab - Then I should see key list - And I click on the key title - Then I should see key details - And I click on remove key - Then I should see the key removed - - Scenario: Show user identities - Given user "Pete" with twitter account - And I visit "Pete" identities page in admin - Then I should see twitter details - - Scenario: Update user identities - Given user "Pete" with twitter account - And I visit "Pete" identities page in admin - And I modify twitter identity - Then I should see twitter details updated - - Scenario: Remove user identities - Given user "Pete" with twitter account - And I visit "Pete" identities page in admin - And I remove twitter identity - Then I should not see twitter details diff --git a/features/dashboard/active_tab.feature b/features/dashboard/active_tab.feature deleted file mode 100644 index bd883a0ebfa..00000000000 --- a/features/dashboard/active_tab.feature +++ /dev/null @@ -1,24 +0,0 @@ -@dashboard -Feature: Dashboard Active Tab - Background: - Given I sign in as a user - - Scenario: On Dashboard Home - Given I visit dashboard page - Then the active main tab should be Home - And no other main tabs should be active - - Scenario: On Dashboard Issues - Given I visit dashboard issues page - Then the active main tab should be Issues - And no other main tabs should be active - - Scenario: On Dashboard Merge Requests - Given I visit dashboard merge requests page - Then the active main tab should be Merge Requests - And no other main tabs should be active - - Scenario: On Dashboard Groups - Given I visit dashboard groups page - Then the active main tab should be Groups - And no other main tabs should be active diff --git a/features/dashboard/archived_projects.feature b/features/dashboard/archived_projects.feature deleted file mode 100644 index bed9282f1c6..00000000000 --- a/features/dashboard/archived_projects.feature +++ /dev/null @@ -1,17 +0,0 @@ -@dashboard -Feature: Dashboard Archived Projects - Background: - Given I sign in as a user - And I own project "Shop" - And I own project "Forum" - And project "Forum" is archived - And I visit dashboard page - - Scenario: I should see non-archived projects on dashboard - Then I should see "Shop" project link - And I should not see "Forum" project link - - Scenario: I toggle show of archived projects on dashboard - When I click "Show archived projects" link - Then I should see "Shop" project link - And I should see "Forum" project link diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature index 92061dac7f4..b1d5e4a7acb 100644 --- a/features/dashboard/dashboard.feature +++ b/features/dashboard/dashboard.feature @@ -11,6 +11,7 @@ Feature: Dashboard And I visit dashboard page Scenario: I should see projects list + Then I should see "New Project" link Then I should see "Shop" project link Then I should see "Shop" project CI status diff --git a/features/dashboard/group.feature b/features/dashboard/group.feature deleted file mode 100644 index 3ae2c679dc1..00000000000 --- a/features/dashboard/group.feature +++ /dev/null @@ -1,13 +0,0 @@ -@dashboard -Feature: Dashboard Group - 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: Create a group from dasboard - And I visit dashboard groups page - And I click new group link - And submit form with new group "Samurai" info - Then I should be redirected to group "Samurai" page - And I should see newly created group "Samurai" diff --git a/features/dashboard/help.feature b/features/dashboard/help.feature deleted file mode 100644 index bca2772897b..00000000000 --- a/features/dashboard/help.feature +++ /dev/null @@ -1,9 +0,0 @@ -@dashboard -Feature: Dashboard Help - Background: - Given I sign in as a user - And I visit the "Rake Tasks" help page - - Scenario: The markdown should be rendered correctly - Then I should see "Rake Tasks" page markdown rendered - And Header "Rebuild project satellites" should have correct ids and links diff --git a/features/dashboard/issues.feature b/features/dashboard/issues.feature deleted file mode 100644 index 99dad88a402..00000000000 --- a/features/dashboard/issues.feature +++ /dev/null @@ -1,21 +0,0 @@ -@dashboard -Feature: Dashboard Issues - Background: - Given I sign in as a user - And I have authored issues - And I have assigned issues - And I have other issues - And I visit dashboard issues page - - Scenario: I should see assigned issues - Then I should see issues assigned to me - - @javascript - Scenario: I should see authored issues - When I click "Authored by me" link - Then I should see issues authored by me - - @javascript - Scenario: I should see all issues - When I click "All" link - Then I should see all issues diff --git a/features/dashboard/shortcuts.feature b/features/dashboard/shortcuts.feature deleted file mode 100644 index 41d79aa6ec8..00000000000 --- a/features/dashboard/shortcuts.feature +++ /dev/null @@ -1,21 +0,0 @@ -@dashboard -Feature: Dashboard Shortcuts - Background: - Given I sign in as a user - And I visit dashboard page - - @javascript - Scenario: Navigate to projects tab - Given I press "g" and "p" - Then the active main tab should be Projects - - @javascript - Scenario: Navigate to issue tab - Given I press "g" and "i" - Then the active main tab should be Issues - - @javascript - Scenario: Navigate to merge requests tab - Given I press "g" and "m" - Then the active main tab should be Merge Requests - diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature index 57dda9c2234..0d6f7350181 100644 --- a/features/project/active_tab.feature +++ b/features/project/active_tab.feature @@ -7,8 +7,9 @@ Feature: Project Active Tab Scenario: On Project Home Given I visit my project's home page - Then the active main tab should be Home - And no other main tabs should be active + Then the active sub tab should be Home + And no other sub tabs should be active + And the active main tab should be Project Scenario: On Project Repository Given I visit my project's files page @@ -34,29 +35,45 @@ Feature: Project Active Tab Scenario: On Project Home/Show Given I visit my project's home page - Then the active main tab should be Home + Then the active sub tab should be Home + And no other sub tabs should be active + And the active main tab should be Project And no other main tabs should be active + Scenario: On Project Home/Activity + Given I visit my project's home page + And I click the "Activity" tab + Then the active sub tab should be Activity + And no other sub tabs should be active + And the active main tab should be Project + # Sub Tabs: Settings - Scenario: On Project Settings/Hooks + Scenario: On Project Settings/Integrations Given I visit my project's settings page - And I click the "Hooks" tab - Then the active sub nav should be Hooks - And no other sub navs should be active + And I click the "Integrations" tab + Then the active sub tab should be Integrations + And no other sub tabs should be active And the active main tab should be Settings - Scenario: On Project Settings/Deploy Keys + Scenario: On Project Settings/Repository Given I visit my project's settings page - And I click the "Deploy Keys" tab - Then the active sub nav should be Deploy Keys - And no other sub navs should be active + And I click the "Repository" tab + Then the active sub tab should be Repository + And no other sub tabs should be active + And the active main tab should be Settings + + Scenario: On Project Settings/Pages + Given I visit my project's settings page + And I click the "Pages" tab + Then the active sub tab should be Pages + And no other sub tabs should be active And the active main tab should be Settings Scenario: On Project Members Given I visit my project's members page - Then the active sub nav should be Members - And no other sub navs should be active + Then the active sub tab should be Members + And no other sub tabs should be active And the active main tab should be Settings # Sub Tabs: Repository @@ -73,9 +90,9 @@ Feature: Project Active Tab And no other sub tabs should be active And the active main tab should be Repository - Scenario: On Project Repository/Network - Given I visit my project's network page - Then the active sub tab should be Network + Scenario: On Project Repository/Graph + Given I visit my project's graph page + Then the active sub tab should be Graph And no other sub tabs should be active And the active main tab should be Repository @@ -86,6 +103,13 @@ Feature: Project Active Tab And no other sub tabs should be active And the active main tab should be Repository + Scenario: On Project Repository/Charts + Given I visit my project's commits page + And I click the "Charts" tab + Then the active sub tab should be Charts + And no other sub tabs should be active + And the active main tab should be Repository + Scenario: On Project Repository/Branches Given I visit my project's commits page And I click the "Branches" tab diff --git a/features/project/commits/branches.feature b/features/project/commits/branches.feature index 88fef674c0c..c57376aecff 100644 --- a/features/project/commits/branches.feature +++ b/features/project/commits/branches.feature @@ -13,6 +13,7 @@ Feature: Project Commits Branches Given I visit project protected branches page Then I should see "Shop" protected branches list + @javascript Scenario: I create a branch Given I visit project branches page And I click new branch link @@ -33,12 +34,7 @@ Feature: Project Commits Branches And I submit new branch form with invalid name Then I should see new an error that branch is invalid - Scenario: I create a branch with invalid reference - Given I visit project branches page - And I click new branch link - And I submit new branch form with invalid reference - Then I should see new an error that ref is invalid - + @javascript Scenario: I create a branch that already exists Given I visit project branches page And I click new branch link diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature index 1776c07e60e..3459cce03f9 100644 --- a/features/project/commits/commits.feature +++ b/features/project/commits/commits.feature @@ -47,8 +47,6 @@ Feature: Project Commits And repository contains ".gitlab-ci.yml" file When I click on commit link Then I see commit ci info - And I click status link - Then I see builds list Scenario: I browse commit with side-by-side diff view Given I click on commit link diff --git a/features/project/graph.feature b/features/project/graph.feature index 63793d6f989..b25c73ad870 100644 --- a/features/project/graph.feature +++ b/features/project/graph.feature @@ -9,9 +9,10 @@ Feature: Project Graph Then page should have graphs @javascript - Scenario: I should see project commits graphs + Scenario: I should see project languages & commits graphs on commits graph url When I visit project "Shop" commits graph page Then page should have commits graphs + Then page should have languages graphs @javascript Scenario: I should see project ci graphs @@ -20,6 +21,13 @@ Feature: Project Graph Then page should have CI graphs @javascript - Scenario: I should see project languages graphs + Scenario: I should see project languages & commits graphs on language graph url When I visit project "Shop" languages graph page Then page should have languages graphs + Then page should have commits graphs + + @javascript + Scenario: I should see project languages & commits graphs on charts url + When I visit project "Shop" chart page + Then page should have languages graphs + Then page should have commits graphs diff --git a/features/project/issues/award_emoji.feature b/features/project/issues/award_emoji.feature index f0fd414a9f9..1d7adfdd2c2 100644 --- a/features/project/issues/award_emoji.feature +++ b/features/project/issues/award_emoji.feature @@ -42,4 +42,4 @@ Feature: Award Emoji @javascript Scenario: I add award emoji using regular comment Given I leave comment with a single emoji - Then I have award added + Then I have new comment with emoji added diff --git a/features/project/issues/filter_labels.feature b/features/project/issues/filter_labels.feature deleted file mode 100644 index 49d7a3b9af2..00000000000 --- a/features/project/issues/filter_labels.feature +++ /dev/null @@ -1,28 +0,0 @@ -@project_issues -Feature: Project Issues Filter Labels - 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 issue "Bugfix1" with labels: "bug", "feature" - And project "Shop" has issue "Bugfix2" with labels: "bug", "enhancement" - And project "Shop" has issue "Feature1" with labels: "feature" - Given I visit project "Shop" issues page - - @javascript - Scenario: I filter by one label - Given I click link "bug" - And I click "dropdown close button" - Then I should see "Bugfix1" in issues list - And I should see "Bugfix2" in issues list - And I should not see "Feature1" in issues list - - # TODO: make labels filter works according to this scanario - # right now it looks for label 1 OR label 2. Old behaviour (this test) was - # all issues that have both label 1 AND label 2 - #Scenario: I filter by two labels - #Given I click link "bug" - #And I click link "feature" - #Then I should see "Bugfix1" in issues list - #And I should not see "Bugfix2" in issues list - #And I should not see "Feature1" in issues list diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature index 80670063ea0..b2b4fe72220 100644 --- a/features/project/issues/issues.feature +++ b/features/project/issues/issues.feature @@ -26,12 +26,6 @@ Feature: Project Issues Given I click link "Release 0.4" Then I should see issue "Release 0.4" - @javascript - Scenario: I filter by author - Given I add a user to project "Shop" - And I click "author" dropdown - Then I see current user as the first user - Scenario: I submit new unassigned issue Given I click link "New Issue" And I submit new issue "500 error on profile" @@ -84,56 +78,6 @@ Feature: Project Issues And I sort the list by "Least popular" Then The list should be sorted by "Least popular" - @javascript - Scenario: I search issue - Given I fill in issue search with "Re" - Then I should see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - And I should not see "Tweet control" in issues - - @javascript - Scenario: I search issue that not exist - Given I fill in issue search with "Bu" - Then I should not see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - - @javascript - Scenario: I search all issues - Given I click link "All" - And I fill in issue search with ".3" - Then I should see "Release 0.3" in issues - And I should not see "Release 0.4" in issues - - @javascript - Scenario: Search issues when search string exactly matches issue description - Given project 'Shop' has issue 'Bugfix1' with description: 'Description for issue1' - And I fill in issue search with 'Description for issue1' - Then I should see 'Bugfix1' in issues - And I should not see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - And I should not see "Tweet control" in issues - - @javascript - Scenario: Search issues when search string partially matches issue description - Given project 'Shop' has issue 'Bugfix1' with description: 'Description for issue1' - And project 'Shop' has issue 'Feature1' with description: 'Feature submitted for issue1' - And I fill in issue search with 'issue1' - Then I should see 'Feature1' in issues - Then I should see 'Bugfix1' in issues - And I should not see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - And I should not see "Tweet control" in issues - - @javascript - Scenario: Search issues when search string matches no issue description - Given project 'Shop' has issue 'Bugfix1' with description: 'Description for issue1' - And I fill in issue search with 'Rock and roll' - Then I should not see 'Bugfix1' in issues - And I should not see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - And I should not see "Tweet control" in issues - - # Markdown Scenario: Headers inside the description should have ids generated for them. diff --git a/features/project/labels.feature b/features/project/labels.feature deleted file mode 100644 index 955bc3d8b1b..00000000000 --- a/features/project/labels.feature +++ /dev/null @@ -1,15 +0,0 @@ -@labels -Feature: Labels - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" has labels: "bug", "feature", "enhancement" - When I visit project "Shop" labels page - - @javascript - Scenario: I can subscribe to a label - Then I should see that I am not subscribed to the "bug" label - When I click button "Subscribe" for the "bug" label - Then I should see that I am subscribed to the "bug" label - When I click button "Unsubscribe" for the "bug" label - Then I should see that I am not subscribed to the "bug" label diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature index 5aa592e9067..bcde497553b 100644 --- a/features/project/merge_requests.feature +++ b/features/project/merge_requests.feature @@ -294,13 +294,6 @@ Feature: Project Merge Requests Then I should see the Markdown write tab @javascript - Scenario: I search merge request - Given I click link "All" - When I fill in merge request search with "Fe" - Then I should see "Feature NS-03" in merge requests - And I should not see "Bug NS-04" in merge requests - - @javascript Scenario: I can unsubscribe from merge request Given I visit merge request page "Bug NS-04" Then I should see that I am subscribed diff --git a/features/project/merge_requests/revert.feature b/features/project/merge_requests/revert.feature index d767b088883..ec6666f227f 100644 --- a/features/project/merge_requests/revert.feature +++ b/features/project/merge_requests/revert.feature @@ -5,6 +5,7 @@ Feature: Revert Merge Requests 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 diff --git a/features/project/pages.feature b/features/project/pages.feature new file mode 100644 index 00000000000..87d88348d09 --- /dev/null +++ b/features/project/pages.feature @@ -0,0 +1,82 @@ +Feature: Project Pages + Background: + Given I sign in as a user + And I own a project + + Scenario: Pages are disabled + Given pages are disabled + When I visit the Project Pages + Then I should see that GitLab Pages are disabled + + 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/project/service.feature b/features/project/service.feature index 3a7b8308524..cce5f58adec 100644 --- a/features/project/service.feature +++ b/features/project/service.feature @@ -37,11 +37,11 @@ Feature: Project Services And I fill Assembla settings Then I should see Assembla service settings saved - Scenario: Activate Slack service + Scenario: Activate Slack notifications service When I visit project "Shop" services page - And I click Slack service link - And I fill Slack settings - Then I should see Slack service settings saved + And I click Slack notifications service link + And I fill Slack notifications settings + Then I should see Slack Notifications service settings saved Scenario: Activate Pushover service When I visit project "Shop" services page diff --git a/features/project/shortcuts.feature b/features/project/shortcuts.feature index f71f69ef060..b47fca31ef2 100644 --- a/features/project/shortcuts.feature +++ b/features/project/shortcuts.feature @@ -19,15 +19,16 @@ Feature: Project Shortcuts Then the active sub tab should be Commits @javascript - Scenario: Navigate to network tab + Scenario: Navigate to graph tab Given I press "g" and "n" - Then the active sub tab should be Network + Then the active sub tab should be Graph And the active main tab should be Repository @javascript - Scenario: Navigate to graphs tab + Scenario: Navigate to repository charts tab Given I press "g" and "g" - Then the active main tab should be Graphs + Then the active sub tab should be Charts + And the active main tab should be Repository @javascript Scenario: Navigate to issues tab @@ -52,9 +53,11 @@ Feature: Project Shortcuts @javascript Scenario: Navigate to project home Given I press "g" and "p" - Then the active main tab should be Home + Then the active sub tab should be Home + And the active main tab should be Project @javascript Scenario: Navigate to project feed Given I press "g" and "e" - Then the active main tab should be Activity + Then the active sub tab should be Activity + And the active main tab should be Project diff --git a/features/snippets/user.feature b/features/snippets/user.feature deleted file mode 100644 index 5b5dadb7b39..00000000000 --- a/features/snippets/user.feature +++ /dev/null @@ -1,34 +0,0 @@ -@snippets -Feature: Snippets User - Background: - Given I sign in as a user - And I have public "Personal snippet one" snippet - And I have private "Personal snippet private" snippet - And I have internal "Personal snippet internal" snippet - - Scenario: I should see all my snippets - Given I visit my snippets page - Then I should see "Personal snippet one" in snippets - And I should see "Personal snippet private" in snippets - And I should see "Personal snippet internal" in snippets - - Scenario: I can see only my private snippets - Given I visit my snippets page - And I click "Private" filter - Then I should not see "Personal snippet one" in snippets - And I should not see "Personal snippet internal" in snippets - And I should see "Personal snippet private" in snippets - - Scenario: I can see only my public snippets - Given I visit my snippets page - And I click "Public" filter - Then I should see "Personal snippet one" in snippets - And I should not see "Personal snippet private" in snippets - And I should not see "Personal snippet internal" in snippets - - Scenario: I can see only my internal snippets - Given I visit my snippets page - And I click "Internal" filter - Then I should see "Personal snippet internal" in snippets - And I should not see "Personal snippet private" in snippets - And I should not see "Personal snippet one" in snippets diff --git a/features/steps/admin/active_tab.rb b/features/steps/admin/active_tab.rb deleted file mode 100644 index 9b1689a8198..00000000000 --- a/features/steps/admin/active_tab.rb +++ /dev/null @@ -1,41 +0,0 @@ -class Spinach::Features::AdminActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedActiveTab - - step 'the active main tab should be Overview' do - ensure_active_main_tab('Overview') - end - - step 'the active sub tab should be Projects' do - ensure_active_sub_tab('Projects') - end - - step 'the active sub tab should be Groups' do - ensure_active_sub_tab('Groups') - end - - step 'the active sub tab should be Users' do - ensure_active_sub_tab('Users') - end - - step 'the active main tab should be Hooks' do - ensure_active_main_tab('Hooks') - end - - step 'the active main tab should be Monitoring' do - ensure_active_main_tab('Monitoring') - end - - step 'the active sub tab should be Resque' do - ensure_active_sub_tab('Background Jobs') - end - - step 'the active sub tab should be Logs' do - ensure_active_sub_tab('Logs') - end - - step 'the active main tab should be Messages' do - ensure_active_main_tab('Messages') - end -end diff --git a/features/steps/admin/appearance.rb b/features/steps/admin/appearance.rb deleted file mode 100644 index 0d1be46d11d..00000000000 --- a/features/steps/admin/appearance.rb +++ /dev/null @@ -1,72 +0,0 @@ -class Spinach::Features::AdminAppearance < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - - step 'submit form with new appearance' do - fill_in 'appearance_title', with: 'MyCompany' - fill_in 'appearance_description', with: 'dev server' - click_button 'Save' - end - - step 'I should be redirected to admin appearance page' do - expect(current_path).to eq admin_appearances_path - expect(page).to have_content 'Appearance settings' - end - - step 'I should see newly created appearance' do - expect(page).to have_field('appearance_title', with: 'MyCompany') - expect(page).to have_field('appearance_description', with: 'dev server') - expect(page).to have_content 'Last edit' - end - - step 'I click preview button' do - click_link "Preview" - end - - step 'application has custom appearance' do - create(:appearance) - end - - step 'I should see a customized appearance' do - expect(page).to have_content appearance.title - expect(page).to have_content appearance.description - end - - step 'I attach a logo' do - attach_file(:appearance_logo, Rails.root.join('spec', 'fixtures', 'dk.png')) - click_button 'Save' - end - - step 'I attach header logos' do - attach_file(:appearance_header_logo, Rails.root.join('spec', 'fixtures', 'dk.png')) - click_button 'Save' - end - - step 'I should see a logo' do - expect(page).to have_xpath('//img[@src="/uploads/appearance/logo/1/dk.png"]') - end - - step 'I should see header logos' do - expect(page).to have_xpath('//img[@src="/uploads/appearance/header_logo/1/dk.png"]') - end - - step 'I remove the logo' do - click_link 'Remove logo' - end - - step 'I remove the header logos' do - click_link 'Remove header logo' - end - - step 'I should see logo removed' do - expect(page).not_to have_xpath('//img[@src="/uploads/appearance/logo/1/gitlab_logo.png"]') - end - - step 'I should see header logos removed' do - expect(page).not_to have_xpath('//img[@src="/uploads/appearance/header_logo/1/header_logo_light.png"]') - end - - def appearance - Appearance.last - end -end diff --git a/features/steps/admin/applications.rb b/features/steps/admin/applications.rb deleted file mode 100644 index 7c12cb96921..00000000000 --- a/features/steps/admin/applications.rb +++ /dev/null @@ -1,55 +0,0 @@ -class Spinach::Features::AdminApplications < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'I click on new application button' do - click_on 'New Application' - end - - step 'I should see application form' do - expect(page).to have_content "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 "Submit" - 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 "Submit" - 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/admin/broadcast_messages.rb b/features/steps/admin/broadcast_messages.rb deleted file mode 100644 index af2b4a29313..00000000000 --- a/features/steps/admin/broadcast_messages.rb +++ /dev/null @@ -1,66 +0,0 @@ -class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - - step 'application already has a broadcast message' do - FactoryGirl.create(:broadcast_message, :expired, message: "Migration to new server") - end - - step 'I should see all broadcast messages' do - expect(page).to have_content "Migration to new server" - end - - step 'I should be redirected to admin messages page' do - expect(current_path).to eq admin_broadcast_messages_path - end - - step 'I should see newly created broadcast message' do - expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST' - end - - step 'submit form with new customized broadcast message' do - fill_in 'broadcast_message_message', with: 'Application update from **4:00 CST to 5:00 CST**' - fill_in 'broadcast_message_color', with: '#f2dede' - fill_in 'broadcast_message_font', with: '#b94a48' - select Date.today.next_year.year, from: "broadcast_message_ends_at_1i" - click_button "Add broadcast message" - end - - step 'I should see a customized broadcast message' do - expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST' - expect(page).to have_selector 'strong', text: '4:00 CST to 5:00 CST' - expect(page).to have_selector %(div[style="background-color: #f2dede; color: #b94a48"]) - end - - step 'I edit an existing broadcast message' do - click_link 'Edit' - end - - step 'I change the broadcast message text' do - fill_in 'broadcast_message_message', with: 'Application update RIGHT NOW' - click_button 'Update broadcast message' - end - - step 'I should see the updated broadcast message' do - expect(page).to have_content "Application update RIGHT NOW" - end - - step 'I remove an existing broadcast message' do - click_link 'Remove' - end - - step 'I should not see the removed broadcast message' do - expect(page).not_to have_content 'Migration to new server' - end - - step 'I enter a broadcast message with Markdown' do - fill_in 'broadcast_message_message', with: "Live **Markdown** previews. :tada:" - end - - step 'I should see a live preview of the rendered broadcast message' do - page.within('.broadcast-message-preview') do - expect(page).to have_selector('strong', text: 'Markdown') - expect(page).to have_selector('img.emoji') - end - end -end diff --git a/features/steps/admin/deploy_keys.rb b/features/steps/admin/deploy_keys.rb deleted file mode 100644 index 56787eeb6b3..00000000000 --- a/features/steps/admin/deploy_keys.rb +++ /dev/null @@ -1,46 +0,0 @@ -class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'there are public deploy keys in system' do - create(:deploy_key, public: true) - create(:another_deploy_key, public: true) - end - - step 'I should see all public deploy keys' do - DeployKey.are_public.each do |p| - expect(page).to have_content p.title - end - end - - step 'I visit admin deploy key page' do - visit admin_deploy_key_path(deploy_key) - end - - step 'I visit admin deploy keys page' do - visit admin_deploy_keys_path - end - - step 'I click \'New Deploy Key\'' do - click_link 'New Deploy Key' - end - - step 'I submit new deploy key' do - fill_in "deploy_key_title", with: "laptop" - fill_in "deploy_key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop" - click_button "Create" - end - - step 'I should be on admin deploy keys page' do - expect(current_path).to eq admin_deploy_keys_path - end - - step 'I should see newly created deploy key' do - expect(page).to have_content(deploy_key.title) - end - - def deploy_key - @deploy_key ||= DeployKey.are_public.first - end -end diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb deleted file mode 100644 index 9396a76f0a2..00000000000 --- a/features/steps/admin/groups.rb +++ /dev/null @@ -1,143 +0,0 @@ -class Spinach::Features::AdminGroups < Spinach::FeatureSteps - include SharedAuthentication - include SharedGroup - include SharedPaths - include SharedUser - include SharedActiveTab - include Select2Helper - - When 'I visit admin group page' do - visit admin_group_path(current_group) - end - - When 'I click new group link' do - click_link "New Group" - end - - step 'I have group with projects' do - @group = create(:group) - @project = create(:project, group: @group) - @event = create(:closed_issue_event, project: @project) - - @project.team << [current_user, :master] - end - - step 'submit form with new group info' do - fill_in 'group_path', with: 'gitlab' - fill_in 'group_description', with: 'Group description' - click_button "Create group" - end - - step 'I should see newly created group' do - expect(page).to have_content "Group: gitlab" - expect(page).to have_content "Group description" - end - - step 'I should be redirected to group page' do - expect(current_path).to eq admin_group_path(Group.find_by(path: 'gitlab')) - end - - When 'I select user "John Doe" from user list as "Reporter"' do - select2(user_john.id, from: "#user_ids", multiple: true) - page.within "#new_project_member" do - select "Reporter", from: "access_level" - end - click_button "Add users to group" - end - - When 'I select user "johndoe@gitlab.com" from user list as "Reporter"' do - select2('johndoe@gitlab.com', from: "#user_ids", multiple: true) - page.within "#new_project_member" do - select "Reporter", from: "access_level" - end - click_button "Add users to group" - end - - step 'I should see "John Doe" in team list in every project as "Reporter"' do - page.within ".group-users-list" do - expect(page).to have_content "John Doe" - expect(page).to have_content "Reporter" - end - end - - step 'I should see "johndoe@gitlab.com" in team list in every project as "Reporter"' do - page.within ".group-users-list" do - expect(page).to have_content "johndoe@gitlab.com" - expect(page).to have_content "Invited by" - expect(page).to have_content "Reporter" - end - end - - step 'I should be all groups' do - Group.all.each do |group| - expect(page).to have_content group.name - end - end - - step 'group has shared projects' do - share_link = shared_project.project_group_links.new(group_access: Gitlab::Access::MASTER) - share_link.group_id = current_group.id - share_link.save! - end - - step 'I visit group page' do - visit admin_group_path(current_group) - end - - step 'I should see project shared with group' do - expect(page).to have_content(shared_project.name_with_namespace) - expect(page).to have_content "Projects shared with" - end - - step 'we have user "John Doe" in group' do - current_group.add_reporter(user_john) - end - - step 'I should not see "John Doe" in team list' do - page.within ".group-users-list" do - expect(page).not_to have_content "John Doe" - end - end - - step 'I select current user as "Developer"' do - page.within ".users-group-form" do - select2(current_user.id, from: "#user_ids", multiple: true) - select "Developer", from: "access_level" - end - - click_button "Add to group" - end - - step 'I should see current user as "Developer"' do - page.within '.content-list' do - expect(page).to have_content(current_user.name) - expect(page).to have_content('Developer') - end - end - - step 'I click on the "Remove User From Group" button for current user' do - find(:css, 'li', text: current_user.name).find(:css, 'a.btn-remove').click - # poltergeist always confirms popups. - end - - step 'I should not see current user as "Developer"' do - page.within '.content-list' do - expect(page).not_to have_content(current_user.name) - expect(page).not_to have_content('Developer') - end - end - - protected - - def current_group - @group ||= Group.first - end - - def shared_project - @shared_project ||= create(:empty_project) - end - - def user_john - @user_john ||= User.find_by(name: "John Doe") - end -end diff --git a/features/steps/admin/labels.rb b/features/steps/admin/labels.rb deleted file mode 100644 index 55ddcc25085..00000000000 --- a/features/steps/admin/labels.rb +++ /dev/null @@ -1,117 +0,0 @@ -class Spinach::Features::AdminIssuesLabels < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I visit \'bug\' label edit page' do - visit edit_admin_label_path(bug_label) - end - - step 'I visit admin new label page' do - visit new_admin_label_path - end - - step 'I visit admin labels page' do - visit admin_labels_path - end - - step 'I remove label \'bug\'' do - page.within "#label_#{bug_label.id}" do - click_link 'Delete' - end - end - - step 'I have labels: "bug", "feature", "enhancement"' do - ["bug", "feature", "enhancement"].each do |title| - Label.create(title: title, template: true) - end - end - - step 'I delete all labels' do - page.within '.labels' do - page.all('.btn-remove').each do |remove| - remove.click - sleep 0.05 - end - end - end - - step 'I should see labels help message' do - page.within '.labels' do - expect(page).to have_content 'There are no labels yet' - end - end - - step 'I submit new label \'support\'' do - visit new_admin_label_path - fill_in 'Title', with: 'support' - fill_in 'Background color', with: '#F95610' - click_button 'Save' - end - - step 'I submit new label \'bug\'' do - visit new_admin_label_path - fill_in 'Title', with: 'bug' - fill_in 'Background color', with: '#F95610' - click_button 'Save' - end - - step 'I submit new label with invalid color' do - visit new_admin_label_path - fill_in 'Title', with: 'support' - fill_in 'Background color', with: '#12' - click_button 'Save' - end - - step 'I should see label exist error message' do - page.within '.label-form' do - expect(page).to have_content 'Title has already been taken' - end - end - - step 'I should see label color error message' do - page.within '.label-form' do - expect(page).to have_content 'Color must be a valid color code' - end - end - - step 'I should see label \'feature\'' do - page.within '.manage-labels-list' do - expect(page).to have_content 'feature' - end - end - - step 'I should see label \'bug\'' do - page.within '.manage-labels-list' do - expect(page).to have_content 'bug' - end - end - - step 'I should not see label \'bug\'' do - page.within '.manage-labels-list' do - expect(page).not_to have_content 'bug' - end - end - - step 'I should see label \'support\'' do - page.within '.manage-labels-list' do - expect(page).to have_content 'support' - end - end - - step 'I change label \'bug\' to \'fix\'' do - fill_in 'Title', with: 'fix' - fill_in 'Background color', with: '#F15610' - click_button 'Save' - end - - step 'I should see label \'fix\'' do - page.within '.manage-labels-list' do - expect(page).to have_content 'fix' - end - end - - def bug_label - Label.templates.find_or_create_by(title: 'bug') - end -end diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb deleted file mode 100644 index 2b8cd030ace..00000000000 --- a/features/steps/admin/projects.rb +++ /dev/null @@ -1,104 +0,0 @@ -class Spinach::Features::AdminProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - include SharedProject - include SharedUser - include Select2Helper - - step 'I should see all non-archived projects' do - Project.non_archived.each do |p| - expect(page).to have_content p.name_with_namespace - end - end - - step 'I should see all projects' do - Project.all.each do |p| - expect(page).to have_content p.name_with_namespace - end - end - - step 'I select "Show archived projects"' do - find(:css, '#sort-projects-dropdown').click - click_link 'Show archived projects' - end - - step 'I should see "archived" label' do - expect(page).to have_xpath("//span[@class='label label-warning']", text: 'archived') - end - - step 'I click on first project' do - click_link Project.first.name_with_namespace - end - - step 'I should see project details' do - project = Project.first - expect(current_path).to eq admin_namespace_project_path(project.namespace, project) - expect(page).to have_content(project.name_with_namespace) - expect(page).to have_content(project.creator.name) - end - - step 'I visit admin project page' do - visit admin_namespace_project_path(project.namespace, project) - end - - step 'I transfer project to group \'Web\'' do - allow_any_instance_of(Projects::TransferService). - to receive(:move_uploads_to_new_namespace).and_return(true) - click_button 'Search for Namespace' - click_link 'group: web' - click_button 'Transfer' - end - - step 'group \'Web\'' do - create(:group, name: 'Web') - end - - step 'I should see project transfered' do - expect(page).to have_content 'Web / ' + project.name - expect(page).to have_content 'Namespace: Web' - end - - step 'I visit project "Enterprise" members page' do - project = Project.find_by!(name: "Enterprise") - visit namespace_project_project_members_path(project.namespace, project) - end - - step 'I select current user as "Developer"' do - page.within ".users-project-form" do - select2(current_user.id, from: "#user_ids", multiple: true) - select "Developer", from: "access_level" - end - - click_button "Add to project" - end - - step 'I should see current user as "Developer"' do - page.within '.content-list' do - expect(page).to have_content(current_user.name) - expect(page).to have_content('Developer') - end - end - - step 'current user is developer of project "Enterprise"' do - project = Project.find_by!(name: "Enterprise") - project.team << [current_user, :developer] - end - - step 'I click on the "Remove User From Project" button for current user' do - find(:css, 'li', text: current_user.name).find(:css, 'a.btn-remove').click - # poltergeist always confirms popups. - end - - step 'I should not see current_user as "Developer"' do - expect(page).not_to have_selector(:css, '.content-list') - end - - def project - @project ||= Project.first - end - - def group - Group.find_by(name: 'Web') - end -end diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb deleted file mode 100644 index 11dc7f580f0..00000000000 --- a/features/steps/admin/settings.rb +++ /dev/null @@ -1,62 +0,0 @@ -class Spinach::Features::AdminSettings < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - include Gitlab::CurrentSettings - - step 'I modify settings and save form' do - uncheck 'Gravatar enabled' - fill_in 'Home page URL', with: 'https://about.gitlab.com/' - fill_in 'Help page text', with: 'Example text' - click_button 'Save' - end - - step 'I should see application settings saved' do - expect(current_application_settings.gravatar_enabled).to be_falsey - expect(current_application_settings.home_page_url).to eq "https://about.gitlab.com/" - expect(page).to have_content "Application settings saved successfully" - end - - step 'I click on "Service Templates"' do - click_link 'Service Templates' - end - - step 'I click on "Slack" service' do - click_link 'Slack' - end - - step 'I check all events and submit form' do - page.check('Active') - page.check('Push') - page.check('Tag push') - page.check('Note') - page.check('Issue') - page.check('Merge request') - page.check('Build') - page.check('Pipeline') - click_on 'Save' - end - - step 'I fill out Slack settings' do - fill_in 'Webhook', with: 'http://localhost' - fill_in 'Username', with: 'test_user' - fill_in 'service_push_channel', with: '#test_channel' - page.check('Notify only broken builds') - end - - step 'I should see service template settings saved' do - expect(page).to have_content 'Application settings saved successfully' - end - - step 'I should see all checkboxes checked' do - page.all('input[type=checkbox]').each do |checkbox| - expect(checkbox).to be_checked - end - end - - step 'I should see Slack settings saved' do - expect(find_field('Webhook').value).to eq 'http://localhost' - expect(find_field('Username').value).to eq 'test_user' - expect(find('#service_push_channel').value).to eq '#test_channel' - end -end diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb deleted file mode 100644 index 8fb8a86d58b..00000000000 --- a/features/steps/admin/users.rb +++ /dev/null @@ -1,167 +0,0 @@ -class Spinach::Features::AdminUsers < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - before do - allow(Gitlab::OAuth::Provider).to receive(:providers).and_return([:twitter, :twitter_updated]) - allow_any_instance_of(ApplicationHelper).to receive(:user_omniauth_authorize_path).and_return(root_path) - end - - after do - allow(Gitlab::OAuth::Provider).to receive(:providers).and_call_original - allow_any_instance_of(ApplicationHelper).to receive(:user_omniauth_authorize_path).and_call_original - end - - step 'I should see all users' do - User.all.each do |user| - expect(page).to have_content user.name - end - end - - step 'Click edit' do - @user = User.first - find("#edit_user_#{@user.id}").click - end - - step 'Input non ascii char in username' do - fill_in 'user_username', with: "\u3042\u3044" - end - - step 'Click save' do - click_button("Save") - end - - step 'See username error message' do - page.within "#error_explanation" do - expect(page).to have_content "Username" - end - end - - step 'Not changed form action url' do - expect(page).to have_selector %(form[action="/admin/users/#{@user.username}"]) - end - - step 'I submit modified user' do - check :user_can_create_group - click_button 'Save' - end - - step 'I see user attributes changed' do - expect(page).to have_content 'Can create groups: Yes' - end - - step 'click edit on my user' do - find("#edit_user_#{current_user.id}").click - end - - step 'I view the user with secondary email' do - @user_with_secondary_email = User.last - @user_with_secondary_email.emails.new(email: "secondary@example.com") - @user_with_secondary_email.save - visit "/admin/users/#{@user_with_secondary_email.username}" - end - - step 'I see the secondary email' do - expect(page).to have_content "Secondary email: #{@user_with_secondary_email.emails.last.email}" - end - - step 'I click remove secondary email' do - find("#remove_email_#{@user_with_secondary_email.emails.last.id}").click - end - - step 'I should not see secondary email anymore' do - expect(page).not_to have_content "Secondary email:" - end - - step 'user "Mike" with groups and projects' do - user = create(:user, name: 'Mike') - - project = create(:empty_project) - project.team << [user, :developer] - - group = create(:group) - group.add_developer(user) - end - - step 'click on "Mike" link' do - click_link "Mike" - end - - step 'I should see user "Mike" details' do - expect(page).to have_content 'Account' - expect(page).to have_content 'Personal projects limit' - end - - step 'user "Pete" with ssh keys' do - user = create(:user, name: 'Pete') - create(:key, user: user, title: "ssh-rsa Key1", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4FIEBXGi4bPU8kzxMefudPIJ08/gNprdNTaO9BR/ndy3+58s2HCTw2xCHcsuBmq+TsAqgEidVq4skpqoTMB+Uot5Uzp9z4764rc48dZiI661izoREoKnuRQSsRqUTHg5wrLzwxlQbl1MVfRWQpqiz/5KjBC7yLEb9AbusjnWBk8wvC1bQPQ1uLAauEA7d836tgaIsym9BrLsMVnR4P1boWD3Xp1B1T/ImJwAGHvRmP/ycIqmKdSpMdJXwxcb40efWVj0Ibbe7ii9eeoLdHACqevUZi6fwfbymdow+FeqlkPoHyGg3Cu4vD/D8+8cRc7mE/zGCWcQ15Var83Tczour Key1") - create(:key, user: user, title: "ssh-rsa Key2", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2") - end - - step 'click on user "Pete"' do - click_link 'Pete' - end - - step 'I should see key list' do - expect(page).to have_content 'ssh-rsa Key2' - expect(page).to have_content 'ssh-rsa Key1' - end - - step 'I click on the key title' do - click_link 'ssh-rsa Key2' - end - - step 'I should see key details' do - expect(page).to have_content 'ssh-rsa Key2' - expect(page).to have_content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2' - end - - step 'I click on remove key' do - click_link 'Remove' - end - - step 'I should see the key removed' do - expect(page).not_to have_content 'ssh-rsa Key2' - end - - step 'user "Pete" with twitter account' do - @user = create(:user, name: 'Pete') - @user.identities.create!(extern_uid: '123456', provider: 'twitter') - end - - step 'I visit "Pete" identities page in admin' do - visit admin_user_identities_path(@user) - end - - step 'I should see twitter details' do - expect(page).to have_content 'Pete' - expect(page).to have_content 'twitter' - end - - step 'I modify twitter identity' do - find('.table').find(:link, 'Edit').click - fill_in 'identity_extern_uid', with: '654321' - select 'twitter_updated', from: 'identity_provider' - click_button 'Save changes' - end - - step 'I should see twitter details updated' do - expect(page).to have_content 'Pete' - expect(page).to have_content 'twitter_updated' - expect(page).to have_content '654321' - end - - step 'I remove twitter identity' do - click_link 'Delete' - end - - step 'I should not see twitter details' do - expect(page).to have_content 'Pete' - expect(page).not_to have_content 'twitter' - end - - step 'click on ssh keys tab' do - click_link 'SSH keys' - end -end diff --git a/features/steps/dashboard/active_tab.rb b/features/steps/dashboard/active_tab.rb deleted file mode 100644 index 04fe96cef22..00000000000 --- a/features/steps/dashboard/active_tab.rb +++ /dev/null @@ -1,5 +0,0 @@ -class Spinach::Features::DashboardActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSidebarActiveTab -end diff --git a/features/steps/dashboard/archived_projects.rb b/features/steps/dashboard/archived_projects.rb deleted file mode 100644 index 6510f8d9b32..00000000000 --- a/features/steps/dashboard/archived_projects.rb +++ /dev/null @@ -1,26 +0,0 @@ -class Spinach::Features::DashboardArchivedProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - When 'project "Forum" is archived' do - project = Project.find_by(name: "Forum") - project.update_attribute(:archived, true) - end - - step 'I should see "Shop" project link' do - expect(page).to have_link "Shop" - end - - step 'I should not see "Forum" project link' do - expect(page).not_to have_link "Forum" - end - - step 'I should see "Forum" project link' do - expect(page).to have_link "Forum" - end - - step 'I click "Show archived projects" link' do - click_link "Show archived projects" - end -end diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index b2bec369e0f..33a1c88e33c 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -35,7 +35,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps step 'I have group with projects' do @group = create(:group) - @project = create(:project, namespace: @group) + @project = create(:empty_project, namespace: @group) @event = create(:closed_issue_event, project: @project) @project.team << [current_user, :master] @@ -54,8 +54,8 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps end step 'group has a projects that does not belongs to me' do - @forbidden_project1 = create(:project, group: @group) - @forbidden_project2 = create(:project, group: @group) + @forbidden_project1 = create(:empty_project, group: @group) + @forbidden_project2 = create(:empty_project, group: @group) end step 'I should see 1 project at group list' do diff --git a/features/steps/dashboard/group.rb b/features/steps/dashboard/group.rb deleted file mode 100644 index cf679fea530..00000000000 --- a/features/steps/dashboard/group.rb +++ /dev/null @@ -1,25 +0,0 @@ -class Spinach::Features::DashboardGroup < Spinach::FeatureSteps - include SharedAuthentication - include SharedGroup - include SharedPaths - include SharedUser - - step 'I click new group link' do - click_link "New Group" - end - - step 'submit form with new group "Samurai" info' do - fill_in 'group_path', with: 'Samurai' - fill_in 'group_description', with: 'Tokugawa Shogunate' - click_button "Create group" - end - - step 'I should be redirected to group "Samurai" page' do - expect(current_path).to eq group_path(Group.find_by(name: 'Samurai')) - end - - step 'I should see newly created group "Samurai"' do - expect(page).to have_content "Samurai" - expect(page).to have_content "Tokugawa Shogunate" - end -end diff --git a/features/steps/dashboard/help.rb b/features/steps/dashboard/help.rb deleted file mode 100644 index 3c5bf44c538..00000000000 --- a/features/steps/dashboard/help.rb +++ /dev/null @@ -1,21 +0,0 @@ -class Spinach::Features::DashboardHelp < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedMarkdown - - step 'I visit the help page' do - visit help_path - end - - step 'I visit the "Rake Tasks" help page' do - visit help_page_path("administration/raketasks/maintenance") - end - - step 'I should see "Rake Tasks" page markdown rendered' do - expect(page).to have_content "Gather information about GitLab and the system it runs on" - end - - step 'Header "Rebuild project satellites" should have correct ids and links' do - header_should_have_correct_id_and_link(2, 'Check GitLab configuration', 'check-gitlab-configuration', '.documentation') - end -end diff --git a/features/steps/dashboard/issues.rb b/features/steps/dashboard/issues.rb deleted file mode 100644 index 39c65bb6cde..00000000000 --- a/features/steps/dashboard/issues.rb +++ /dev/null @@ -1,91 +0,0 @@ -class Spinach::Features::DashboardIssues < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include Select2Helper - - step 'I should see issues assigned to me' do - should_see(assigned_issue) - should_not_see(authored_issue) - should_not_see(other_issue) - end - - step 'I should see issues authored by me' do - should_see(authored_issue) - should_see(authored_issue_on_public_project) - should_not_see(assigned_issue) - should_not_see(other_issue) - end - - step 'I should see all issues' do - should_see(authored_issue) - should_see(assigned_issue) - should_see(other_issue) - end - - step 'I have authored issues' do - authored_issue - authored_issue_on_public_project - end - - step 'I have assigned issues' do - assigned_issue - end - - step 'I have other issues' do - other_issue - end - - step 'I click "Authored by me" link' do - find("#assignee_id").set("") - find(".js-author-search", match: :first).click - find(".dropdown-menu-author li a", match: :first, text: current_user.to_reference).click - end - - step 'I click "All" link' do - find(".js-author-search").click - expect(page).to have_selector(".dropdown-menu-author li a") - find(".dropdown-menu-author li a", match: :first).click - expect(page).not_to have_selector(".dropdown-menu-author li a") - - find(".js-assignee-search").click - expect(page).to have_selector(".dropdown-menu-assignee li a") - find(".dropdown-menu-assignee li a", match: :first).click - expect(page).not_to have_selector(".dropdown-menu-assignee li a") - end - - def should_see(issue) - expect(page).to have_content(issue.title[0..10]) - end - - def should_not_see(issue) - expect(page).not_to have_content(issue.title[0..10]) - end - - def assigned_issue - @assigned_issue ||= create :issue, assignee: current_user, project: project - end - - def authored_issue - @authored_issue ||= create :issue, author: current_user, project: project - end - - def other_issue - @other_issue ||= create :issue, project: project - end - - def authored_issue_on_public_project - @authored_issue_on_public_project ||= create :issue, author: current_user, project: public_project - end - - def project - @project ||= begin - project = create :project - project.team << [current_user, :master] - project - end - end - - def public_project - @public_project ||= create :project, :public - end -end diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb index 6777101fb15..909ffec3646 100644 --- a/features/steps/dashboard/merge_requests.rb +++ b/features/steps/dashboard/merge_requests.rb @@ -105,14 +105,14 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps def project @project ||= begin - project = create :project + project = create(:project, :repository) project.team << [current_user, :master] project end end def public_project - @public_project ||= create :project, :public + @public_project ||= create(:project, :public, :repository) end def forked_project diff --git a/features/steps/dashboard/shortcuts.rb b/features/steps/dashboard/shortcuts.rb deleted file mode 100644 index 118d27888df..00000000000 --- a/features/steps/dashboard/shortcuts.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Spinach::Features::DashboardShortcuts < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedSidebarActiveTab - include SharedShortcuts -end diff --git a/features/steps/dashboard/todos.rb b/features/steps/dashboard/todos.rb index 344b6fda9a6..eb906a55a83 100644 --- a/features/steps/dashboard/todos.rb +++ b/features/steps/dashboard/todos.rb @@ -25,15 +25,18 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps end step 'I should see todos assigned to me' do + merge_request_reference = merge_request.to_reference(full: true) + issue_reference = issue.to_reference(full: true) + page.within('.todos-pending-count') { expect(page).to have_content '4' } expect(page).to have_content 'To do 4' expect(page).to have_content 'Done 0' expect(page).to have_link project.name_with_namespace - should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference}", merge_request.title) - should_see_todo(2, "John Doe mentioned you on issue #{issue.to_reference}", "#{current_user.to_reference} Wdyt?") - should_see_todo(3, "John Doe assigned you issue #{issue.to_reference}", issue.title) - should_see_todo(4, "Mary Jane mentioned you on issue #{issue.to_reference}", issue.title) + should_see_todo(1, "John Doe assigned you merge request #{merge_request_reference}", merge_request.title) + should_see_todo(2, "John Doe mentioned you on issue #{issue_reference}", "#{current_user.to_reference} Wdyt?") + should_see_todo(3, "John Doe assigned you issue #{issue_reference}", issue.title) + should_see_todo(4, "Mary Jane mentioned you on issue #{issue_reference}", issue.title) end step 'I mark the todo as done' do @@ -44,10 +47,13 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps page.within('.todos-pending-count') { expect(page).to have_content '3' } expect(page).to have_content 'To do 3' expect(page).to have_content 'Done 1' - should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference}" + should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference(full: true)}", merge_request.title, state: :done_reversible) end step 'I mark all todos as done' do + merge_request_reference = merge_request.to_reference(full: true) + issue_reference = issue.to_reference(full: true) + click_link 'Mark all as done' page.within('.todos-pending-count') { expect(page).to have_content '0' } @@ -55,27 +61,30 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps expect(page).to have_content 'Done 4' expect(page).to have_content "You're all done!" expect('.prepend-top-default').not_to have_link project.name_with_namespace - should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference}" - should_not_see_todo "John Doe mentioned you on issue #{issue.to_reference}" - should_not_see_todo "John Doe assigned you issue #{issue.to_reference}" - should_not_see_todo "Mary Jane mentioned you on issue #{issue.to_reference}" + should_not_see_todo "John Doe assigned you merge request #{merge_request_reference}" + should_not_see_todo "John Doe mentioned you on issue #{issue_reference}" + should_not_see_todo "John Doe assigned you issue #{issue_reference}" + should_not_see_todo "Mary Jane mentioned you on issue #{issue_reference}" end step 'I should see the todo marked as done' do click_link 'Done 1' expect(page).to have_link project.name_with_namespace - should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference}", merge_request.title, false) + should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference(full: true)}", merge_request.title, state: :done_irreversible) end step 'I should see all todos marked as done' do + merge_request_reference = merge_request.to_reference(full: true) + issue_reference = issue.to_reference(full: true) + click_link 'Done 4' expect(page).to have_link project.name_with_namespace - should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference}", merge_request.title, false) - should_see_todo(2, "John Doe mentioned you on issue #{issue.to_reference}", "#{current_user.to_reference} Wdyt?", false) - should_see_todo(3, "John Doe assigned you issue #{issue.to_reference}", issue.title, false) - should_see_todo(4, "Mary Jane mentioned you on issue #{issue.to_reference}", issue.title, false) + should_see_todo(1, "John Doe assigned you merge request #{merge_request_reference}", merge_request.title, state: :done_irreversible) + should_see_todo(2, "John Doe mentioned you on issue #{issue_reference}", "#{current_user.to_reference} Wdyt?", state: :done_irreversible) + should_see_todo(3, "John Doe assigned you issue #{issue_reference}", issue.title, state: :done_irreversible) + should_see_todo(4, "Mary Jane mentioned you on issue #{issue_reference}", issue.title, state: :done_irreversible) end step 'I filter by "Enterprise"' do @@ -111,16 +120,16 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps end step 'I should not see todos related to "Mary Jane" in the list' do - should_not_see_todo "Mary Jane mentioned you on issue #{issue.to_reference}" + should_not_see_todo "Mary Jane mentioned you on issue #{issue.to_reference(full: true)}" end step 'I should not see todos related to "Merge Requests" in the list' do - should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference}" + should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference(full: true)}" end step 'I should not see todos related to "Assignments" in the list' do - should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference}" - should_not_see_todo "John Doe assigned you issue #{issue.to_reference}" + should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference(full: true)}" + should_not_see_todo "John Doe assigned you issue #{issue.to_reference(full: true)}" end step 'I click on the todo' do @@ -131,15 +140,20 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps page.should have_css('.identifier', text: 'Merge Request !1') end - def should_see_todo(position, title, body, pending = true) + def should_see_todo(position, title, body, state: :pending) page.within(".todo:nth-child(#{position})") do expect(page).to have_content title expect(page).to have_content body - if pending + if state == :pending expect(page).to have_link 'Done' - else + elsif state == :done_reversible + expect(page).to have_link 'Undo' + elsif state == :done_irreversible + expect(page).not_to have_link 'Undo' expect(page).not_to have_link 'Done' + else + raise 'Invalid state given, valid states: :pending, :done_reversible, :done_irreversible' end end end diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb index 2b4a5ab0864..7dc33ab5683 100644 --- a/features/steps/explore/projects.rb +++ b/features/steps/explore/projects.rb @@ -49,7 +49,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps step 'I should see an http link to the repository' do project = Project.find_by(name: 'Community') - expect(page).to have_field('project_clone', with: project.http_url_to_repo) + expect(page).to have_field('project_clone', with: project.http_url_to_repo(@user)) end step 'I should see an ssh link to the repository' do diff --git a/features/steps/group/members.rb b/features/steps/group/members.rb index cefc55d07ab..adaf375453c 100644 --- a/features/steps/group/members.rb +++ b/features/steps/group/members.rb @@ -117,7 +117,12 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps member = mary_jane_member page.within "#group_member_#{member.id}" do - select 'Developer', from: "member_access_level_#{member.id}" + click_button member.human_access + + page.within '.dropdown-menu' do + click_link 'Developer' + end + wait_for_ajax end end diff --git a/features/steps/group/milestones.rb b/features/steps/group/milestones.rb index f5fddab357d..20204ad8654 100644 --- a/features/steps/group/milestones.rb +++ b/features/steps/group/milestones.rb @@ -5,9 +5,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps include SharedUser step 'I click on group milestones' do - page.within('.layout-nav') do - click_link 'Milestones' - end + visit group_milestones_path('owned') end step 'I should see group milestones index page has no milestones' do @@ -104,7 +102,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps group = owned_group %w(gitlabhq gitlab-ci cookbook-gitlab).each do |path| - project = create :project, path: path, group: group + project = create(:empty_project, path: path, group: group) milestone = create :milestone, title: "Version 7.2", project: project create(:label, project: project, title: 'bug') @@ -131,5 +129,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps 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/groups.rb b/features/steps/groups.rb index 0c88838767c..4dc87dc4d9c 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -109,7 +109,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps step 'Group "Owned" has archived project' do group = Group.find_by(name: 'Owned') - @archived_project = create(:project, namespace: group, archived: true, path: "archived-project") + @archived_project = create(:empty_project, :archived, namespace: group, path: "archived-project") end step 'I should see "archived" label' do diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index ea480d2ad68..24cfbaad7fe 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -162,7 +162,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps step 'I have group with projects' do @group = create(:group) @group.add_owner(current_user) - @project = create(:project, namespace: @group) + @project = create(:project, :repository, namespace: @group) @event = create(:closed_issue_event, project: @project) @project.team << [current_user, :master] diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb index 58225032859..4befd49ac81 100644 --- a/features/steps/project/active_tab.rb +++ b/features/steps/project/active_tab.rb @@ -22,29 +22,53 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps end step 'I click the "Edit Project"' do - page.within '.layout-nav .controls' do + page.within '.sub-nav' do click_link('Edit Project') end end - step 'I click the "Hooks" tab' do - click_link('Webhooks') + step 'I click the "Integrations" tab' do + page.within '.sub-nav' do + click_link('Integrations') + end end - step 'I click the "Deploy Keys" tab' do - click_link('Deploy Keys') + step 'I click the "Repository" tab' do + page.within '.sub-nav' do + click_link('Repository') + end end - step 'the active sub nav should be Members' do - ensure_active_sub_nav('Members') + step 'I click the "Pages" tab' do + page.within '.sub-nav' do + click_link('Pages') + end + end + + step 'I click the "Activity" tab' do + page.within '.sub-nav' do + click_link('Activity') + end end - step 'the active sub nav should be Hooks' do - ensure_active_sub_nav('Webhooks') + step 'the active sub tab should be Members' do + ensure_active_sub_tab('Members') end - step 'the active sub nav should be Deploy Keys' do - ensure_active_sub_nav('Deploy Keys') + step 'the active sub tab should be Integrations' do + ensure_active_sub_tab('Integrations') + end + + step 'the active sub tab should be Repository' do + ensure_active_sub_tab('Repository') + end + + step 'the active sub tab should be Pages' do + ensure_active_sub_tab('Pages') + end + + step 'the active sub tab should be Activity' do + ensure_active_sub_tab('Activity') end # Sub Tabs: Commits @@ -63,6 +87,12 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps click_link('Tags') end + step 'I click the "Charts" tab' do + page.within '.sub-nav' do + click_link('Charts') + end + end + step 'the active sub tab should be Compare' do ensure_active_sub_tab('Compare') end diff --git a/features/steps/project/builds/artifacts.rb b/features/steps/project/builds/artifacts.rb index 055fca036d3..be0f6eee55a 100644 --- a/features/steps/project/builds/artifacts.rb +++ b/features/steps/project/builds/artifacts.rb @@ -76,7 +76,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps base64_params = send_data.sub(/\Aartifacts\-entry:/, '') params = JSON.parse(Base64.urlsafe_decode64(base64_params)) - expect(params.keys).to eq(['Archive', 'Entry']) + expect(params.keys).to eq(%w(Archive Entry)) expect(params['Archive']).to end_with('build_artifacts.zip') expect(params['Entry']).to eq(Base64.encode64('ci_artifacts.txt')) end diff --git a/features/steps/project/builds/summary.rb b/features/steps/project/builds/summary.rb index 374eb0b0e07..19ff92f6dc6 100644 --- a/features/steps/project/builds/summary.rb +++ b/features/steps/project/builds/summary.rb @@ -33,7 +33,7 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps step 'recent build summary contains information saying that build has been erased' do page.within('.erased') do - expect(page).to have_content 'Build has been erased' + expect(page).to have_content 'Job has been erased' end end diff --git a/features/steps/project/commits/branches.rb b/features/steps/project/commits/branches.rb index 5f9b9e0445e..ccaf3237815 100644 --- a/features/steps/project/commits/branches.rb +++ b/features/steps/project/commits/branches.rb @@ -34,25 +34,19 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps step 'I submit new branch form' do fill_in 'branch_name', with: 'deploy_keys' - fill_in 'ref', with: 'master' + select_branch('master') click_button 'Create branch' end step 'I submit new branch form with invalid name' do fill_in 'branch_name', with: '1.0 stable' - fill_in 'ref', with: 'master' - click_button 'Create branch' - end - - step 'I submit new branch form with invalid reference' do - fill_in 'branch_name', with: 'foo' - fill_in 'ref', with: 'foo' + select_branch('master') click_button 'Create branch' end step 'I submit new branch form with branch that already exists' do fill_in 'branch_name', with: 'master' - fill_in 'ref', with: 'master' + select_branch('master') click_button 'Create branch' end @@ -65,10 +59,6 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps expect(page).to have_content "can't contain spaces" end - step 'I should see new an error that ref is invalid' do - expect(page).to have_content 'Invalid reference name' - end - step 'I should see new an error that branch already exists' do expect(page).to have_content 'Branch already exists' end @@ -88,4 +78,12 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps step "I should not see branch 'improve/awesome'" do expect(page.all(visible: true)).not_to have_content 'improve/awesome' end + + def select_branch(branch_name) + click_button 'master' + + page.within '#new-branch-form .dropdown-menu' do + click_link branch_name + end + end end diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index 007dfb67a77..18e267294e4 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -166,15 +166,6 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps expect(page).to have_content "Pipeline #1 for 570e7b2a pending" end - step 'I click status link' do - find('.commit-ci-menu').click_link "Builds" - end - - step 'I see builds list' do - expect(page).to have_content "Pipeline #1 for 570e7b2a pending" - expect(page).to have_content "1 build" - end - step 'I search "submodules" commits' do fill_in 'commits-search', with: 'submodules' end diff --git a/features/steps/project/commits/revert.rb b/features/steps/project/commits/revert.rb index 94a5d4e2e4d..c9746407344 100644 --- a/features/steps/project/commits/revert.rb +++ b/features/steps/project/commits/revert.rb @@ -36,5 +36,6 @@ class Spinach::Features::RevertCommits < Spinach::FeatureSteps step 'I should see the new merge request notice' do page.should have_content('The commit has been successfully reverted. You can now submit a merge request to get this change into the original branch.') + page.should have_content("From revert-#{Commit.truncate_sha(sample_commit.id)} into master") end end diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb index 83b9ef48392..580a19494c2 100644 --- a/features/steps/project/deploy_keys.rb +++ b/features/steps/project/deploy_keys.rb @@ -36,7 +36,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'I should be on deploy keys page' do - expect(current_path).to eq namespace_project_deploy_keys_path(@project.namespace, @project) + expect(current_path).to eq namespace_project_settings_repository_path(@project.namespace, @project) end step 'I should see newly created deploy key' do @@ -46,11 +46,11 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'other projects have deploy keys' do - @second_project = create(:project, namespace: create(:group)) + @second_project = create(:empty_project, namespace: create(:group)) @second_project.team << [current_user, :master] create(:deploy_keys_project, project: @second_project) - @third_project = create(:project, namespace: create(:group)) + @third_project = create(:empty_project, namespace: create(:group)) @third_project.team << [current_user, :master] create(:deploy_keys_project, project: @third_project, deploy_key: @second_project.deploy_keys.first) end diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 70dbd030003..79db9728227 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -9,7 +9,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I am a member of project "Shop"' do - @project = create(:project, name: "Shop") + @project = create(:project, :repository, name: "Shop") @project.team << [@user, :reporter] end @@ -18,7 +18,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I already have a project named "Shop" in my namespace' do - @my_project = create(:project, name: "Shop", namespace: current_user.namespace) + @my_project = create(:project, :repository, name: "Shop", namespace: current_user.namespace) end step 'I should see a "Name has already been taken" warning' do @@ -56,7 +56,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I should see my fork on the list' do - page.within('.projects-list-holder') do + page.within('.js-projects-list-holder') do project = @user.fork_of(@project) expect(page).to have_content("#{project.namespace.human_name} / #{project.name}") end diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index 6c14d835004..c0827ff8fc7 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -7,7 +7,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps step 'I am a member of project "Shop"' do @project = Project.find_by(name: "Shop") - @project ||= create(:project, name: "Shop") + @project ||= create(:project, :repository, name: "Shop") @project.team << [@user, :reporter] end diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb index 7490d2bc6e7..176d04d721c 100644 --- a/features/steps/project/graph.rb +++ b/features/steps/project/graph.rb @@ -18,6 +18,10 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps visit languages_namespace_project_graph_path(project.namespace, project, "master") end + step 'I visit project "Shop" chart page' do + visit charts_namespace_project_graph_path(project.namespace, project, "master") + end + step 'page should have languages graphs' do expect(page).to have_content /Ruby 66.* %/ expect(page).to have_content /JavaScript 22.* %/ @@ -34,9 +38,9 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps step 'page should have CI graphs' do expect(page).to have_content 'Overall' - expect(page).to have_content 'Builds for last week' - expect(page).to have_content 'Builds for last month' - expect(page).to have_content 'Builds for last year' + expect(page).to have_content 'Jobs for last week' + expect(page).to have_content 'Jobs for last month' + expect(page).to have_content 'Jobs for last year' expect(page).to have_content 'Commit duration in minutes for last 30 commits' end diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb index 13c0713669a..37b608ffbd3 100644 --- a/features/steps/project/hooks.rb +++ b/features/steps/project/hooks.rb @@ -36,12 +36,12 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps end step 'I should see newly created hook' do - expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project) + expect(current_path).to eq namespace_project_settings_integrations_path(current_project.namespace, current_project) expect(page).to have_content(@url) end step 'I should see newly created hook with SSL verification enabled' do - expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project) + expect(current_path).to eq namespace_project_settings_integrations_path(current_project.namespace, current_project) expect(page).to have_content(@url) expect(page).to have_content("SSL Verification: enabled") end @@ -57,7 +57,7 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps end step 'hook should be triggered' do - expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project) + expect(current_path).to eq namespace_project_settings_integrations_path(current_project.namespace, current_project) expect(page).to have_selector '.flash-notice', text: 'Hook executed successfully: HTTP 200' end diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb index cbe5738e7e4..1762d5bdf95 100644 --- a/features/steps/project/issues/award_emoji.rb +++ b/features/steps/project/issues/award_emoji.rb @@ -44,6 +44,10 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps end end + step 'I have new comment with emoji added' do + expect(page).to have_selector ".emoji[title=':smile:']" + end + step 'I have award added' do page.within '.awards' do expect(page).to have_selector '.js-emoji-btn' @@ -86,7 +90,7 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps step 'I see search result for "hand"' do page.within '.emoji-menu-content' do - expect(page).to have_selector '[data-emoji="raised_hand"]' + expect(page).to have_selector '[data-name="raised_hand"]' end end diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb index f74a9b5df47..4a35b71af2f 100644 --- a/features/steps/project/issues/labels.rb +++ b/features/steps/project/issues/labels.rb @@ -15,17 +15,16 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps step 'I delete all labels' do page.within '.labels' do - page.all('.remove-row').each do |remove| - remove.click - sleep 0.05 + page.all('.remove-row').each do + first('.remove-row').click end end end step 'I should see labels help message' do page.within '.labels' do - expect(page).to have_content 'Create a label or generate a default set '\ - 'of labels' + expect(page).to have_content 'Generate a default set of labels' + expect(page).to have_content 'New label' end end diff --git a/features/steps/project/labels.rb b/features/steps/project/labels.rb deleted file mode 100644 index dbeb07c78db..00000000000 --- a/features/steps/project/labels.rb +++ /dev/null @@ -1,32 +0,0 @@ -class Spinach::Features::Labels < Spinach::FeatureSteps - include SharedAuthentication - include SharedIssuable - include SharedProject - include SharedPaths - - step 'And I visit project "Shop" labels page' do - visit namespace_project_labels_path(project.namespace, project) - end - - step 'I should see that I am subscribed to the "bug" label' do - expect(subscribe_button).to have_content 'Unsubscribe' - end - - step 'I should see that I am not subscribed to the "bug" label' do - expect(subscribe_button).to have_content 'Subscribe' - end - - step 'I click button "Unsubscribe" for the "bug" label' do - subscribe_button.click - end - - step 'I click button "Subscribe" for the "bug" label' do - subscribe_button.click - end - - private - - def subscribe_button - first('.js-subscribe-button', visible: true) - end -end diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index d2fa8cd39af..9f0057cace7 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -501,6 +501,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I fill in merge request search with "Fe"' do fill_in 'issuable_search', with: "Fe" + page.within '.merge-requests-holder' do + find('.merge-request') + end end step 'I click the "Target branch" dropdown' do diff --git a/features/steps/project/merge_requests/acceptance.rb b/features/steps/project/merge_requests/acceptance.rb index 4fda0731e2f..0a3f4649870 100644 --- a/features/steps/project/merge_requests/acceptance.rb +++ b/features/steps/project/merge_requests/acceptance.rb @@ -28,7 +28,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps step 'There is an open Merge Request' do @user = create(:user) - @project = create(:project, :public) + @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 diff --git a/features/steps/project/merge_requests/revert.rb b/features/steps/project/merge_requests/revert.rb index efbc4831ce1..31f95b524b3 100644 --- a/features/steps/project/merge_requests/revert.rb +++ b/features/steps/project/merge_requests/revert.rb @@ -30,14 +30,13 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps end step 'I am signed in as a developer of the project' do + @user = create(:user) { |u| @project.add_developer(u) } login_as(@user) end step 'There is an open Merge Request' do - @user = create(:user) - @project = create(:project, :public) - @project_member = create(:project_member, :developer, user: @user, project: @project) - @merge_request = create(:merge_request, :with_diffs, :simple, source_project: @project) + @merge_request = create(:merge_request, :with_diffs, :simple) + @project = @merge_request.source_project end step 'I should see a revert error' do diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb index ff9251615c9..370e46265c7 100644 --- a/features/steps/project/network_graph.rb +++ b/features/steps/project/network_graph.rb @@ -66,7 +66,7 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps end step 'page should have "v1.0.0" in title' do - expect(page).to have_css 'title', text: 'Network · v1.0.0', visible: false + 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 diff --git a/features/steps/project/pages.rb b/features/steps/project/pages.rb new file mode 100644 index 00000000000..c80c6273807 --- /dev/null +++ b/features/steps/project/pages.rb @@ -0,0 +1,139 @@ +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 namespace_project_pages_path(@project.namespace, @project) + end + + step 'I should see that GitLab Pages are disabled' do + expect(page).to have_content('GitLab Pages are disabled') + end + + step 'I should see the usage of GitLab Pages' do + expect(page).to have_content('Configure pages') + end + + step 'pages are deployed' do + pipeline = @project.ensure_pipeline('HEAD', @project.commit('HEAD').sha) + build = build(:ci_build, + project: @project, + pipeline: pipeline, + ref: 'HEAD', + artifacts_file: fixture_file_upload(Rails.root + 'spec/fixtures/pages.zip'), + 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_namespace_project_pages_domain_path(@project.namespace, @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/redirects.rb b/features/steps/project/redirects.rb index 1ffd5cb9de5..92936f27c20 100644 --- a/features/steps/project/redirects.rb +++ b/features/steps/project/redirects.rb @@ -4,11 +4,11 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps include SharedProject step 'public project "Community"' do - create :project, :public, name: 'Community' + create(:empty_project, :public, name: 'Community') end step 'private project "Enterprise"' do - create :project, name: 'Enterprise' + create(:empty_project, :private, name: 'Enterprise') end step 'I visit project "Community" page' do diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index bd6466f3686..772b07d0ad8 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps include SharedPaths step 'I visit project "Shop" services page' do - visit namespace_project_services_path(@project.namespace, @project) + visit namespace_project_settings_integrations_path(@project.namespace, @project) end step 'I should see list of available services' do @@ -137,17 +137,17 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps expect(find_field('Colorize messages').value).to eq '1' end - step 'I click Slack service link' do - click_link 'Slack' + step 'I click Slack notifications service link' do + click_link 'Slack notifications' end - step 'I fill Slack settings' do + step 'I fill Slack notifications settings' do check 'Active' fill_in 'Webhook', with: 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' click_button 'Save' end - step 'I should see Slack service settings saved' do + step 'I should see Slack Notifications service settings saved' do expect(find_field('Webhook').value).to eq 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' end diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index 5e7d539add6..a3bebfa4b71 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -22,7 +22,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I click link "New snippet"' do - click_link "New snippet" + first(:link, "New snippet").click end step 'I click link "Snippet one"' do diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 1cc9e37b075..6845f75f22f 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -6,7 +6,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps include RepoHelpers step "I don't have write access" do - @project = create(:project, name: "Other Project", path: "other-project") + @project = create(:project, :repository, name: "Other Project", path: "other-project") @project.team << [@user, :reporter] visit namespace_project_tree_path(@project.namespace, @project, root_ref) end @@ -82,7 +82,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I fill the new branch name' do - fill_in :target_branch, with: 'new_branch_name', visible: true + first('button.js-target-branch', visible: true).click + first('.create-new-branch', visible: true).click + first('#new_branch_name', visible: true).set('new_branch_name') + first('.js-new-branch-btn', visible: true).click end step 'I fill the new file name with an illegal name' do @@ -334,6 +337,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I click on "files/lfs/lfs_object.iso" file in repo' do + allow_any_instance_of(Project).to receive(:lfs_enabled?).and_return(true) visit namespace_project_tree_path(@project.namespace, @project, "lfs") click_link 'files' click_link "lfs" diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb index dee6a8a5558..9183de76881 100644 --- a/features/steps/project/source/markdown_render.rb +++ b/features/steps/project/source/markdown_render.rb @@ -8,7 +8,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps step 'I own project "Delta"' do @project = Project.find_by(name: "Delta") - @project ||= create(:project, name: "Delta", namespace: @user.namespace) + @project ||= create(:project, :repository, name: "Delta", namespace: @user.namespace) @project.team << [@user, :master] end diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb index b21d0849ad1..6986c7ede56 100644 --- a/features/steps/project/team_management.rb +++ b/features/steps/project/team_management.rb @@ -65,7 +65,11 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps 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 - select "Reporter", from: "member_access_level_#{project_member.id}" + click_button project_member.human_access + + page.within '.dropdown-menu' do + click_link 'Reporter' + end end end @@ -109,8 +113,10 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps project.team << [user, :reporter] end - step 'I click link "Import team from another project"' do - click_link "Import" + 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 @@ -131,7 +137,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps 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) + create(:empty_project, group: os_group) @os_user1 = create(:user) @os_user2 = create(:user) os_group.add_owner(@os_user1) @@ -144,7 +150,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps step 'I should see "Opensource" group user listing' do page.within '.project-members-groups' do expect(page).to have_content('OpenSource') - expect(find('select').value).to eq('40') + expect(first('.group_member')).to have_content('Master') end end end diff --git a/features/steps/shared/admin.rb b/features/steps/shared/admin.rb index fbaa408226e..ac0a1764147 100644 --- a/features/steps/shared/admin.rb +++ b/features/steps/shared/admin.rb @@ -2,7 +2,7 @@ module SharedAdmin include Spinach::DSL step 'there are projects in system' do - 2.times { create(:project) } + 2.times { create(:project, :repository) } end step 'system has users' do diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb index 735e0ef6108..5c3e724746b 100644 --- a/features/steps/shared/authentication.rb +++ b/features/steps/shared/authentication.rb @@ -33,6 +33,6 @@ module SharedAuthentication end def current_user - @user || User.first + @user || User.reorder(nil).first end end diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb index 70e6d4836b2..5bc3a1f5ac4 100644 --- a/features/steps/shared/builds.rb +++ b/features/steps/shared/builds.rb @@ -11,7 +11,7 @@ module SharedBuilds step 'project has a recent build' do @pipeline = create(:ci_empty_pipeline, project: @project, sha: @project.commit.sha, ref: 'master') - @build = create(:ci_build_with_coverage, pipeline: @pipeline) + @build = create(:ci_build, :coverage, pipeline: @pipeline) end step 'recent build is successful' do @@ -47,7 +47,7 @@ module SharedBuilds end step 'recent build has a build trace' do - @build.trace = 'build trace' + @build.trace = 'job trace' end step 'download of build artifacts archive starts' do @@ -60,7 +60,7 @@ module SharedBuilds end step 'I see details of a build' do - expect(page).to have_content "Build ##{@build.id}" + expect(page).to have_content "Job ##{@build.id}" end step 'I see build trace' do diff --git a/features/steps/shared/group.rb b/features/steps/shared/group.rb index fe6736dacd4..de119f2c6c0 100644 --- a/features/steps/shared/group.rb +++ b/features/steps/shared/group.rb @@ -40,7 +40,7 @@ module SharedGroup user = User.find_by(name: username) || create(:user, name: username) group = Group.find_by(name: groupname) || create(:group, name: groupname) group.add_user(user, role) - project ||= create(:project, namespace: group, path: "project#{@project_count}") + project ||= create(:project, :repository, namespace: group, path: "project#{@project_count}") create(:closed_issue_event, project: project) project.team << [user, :master] @project_count += 1 diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb index 79dde620265..3d9cedf5c2d 100644 --- a/features/steps/shared/issuable.rb +++ b/features/steps/shared/issuable.rb @@ -153,7 +153,7 @@ module SharedIssuable case type when :issue - attrs.merge!(project: project) + attrs[:project] = project when :merge_request attrs.merge!( source_project: project, diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 2bd8ea745e4..d5b3bb34d7a 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -168,7 +168,7 @@ module SharedPaths end step 'I visit admin projects page' do - visit admin_namespaces_projects_path + visit admin_projects_path end step 'I visit admin users page' do @@ -191,30 +191,14 @@ module SharedPaths visit admin_background_jobs_path end - step 'I visit admin groups page' do - visit admin_groups_path - end - - step 'I visit admin appearance page' do - visit admin_appearances_path - end - step 'I visit admin teams page' do visit admin_teams_path end - step 'I visit admin settings page' do - visit admin_application_settings_path - end - step 'I visit spam logs page' do visit admin_spam_logs_path end - step 'I visit applications page' do - visit admin_applications_path - end - # ---------------------------------------- # Generic Project # ---------------------------------------- @@ -248,7 +232,7 @@ module SharedPaths visit stats_namespace_project_repository_path(@project.namespace, @project) end - step "I visit my project's network page" do + step "I visit my project's graph page" do # Stub Graph max_size to speed up test (10 commits vs. 650) Network::Graph.stub(max_count: 10) @@ -272,7 +256,7 @@ module SharedPaths end step 'I visit project hooks page' do - visit namespace_project_hooks_path(@project.namespace, @project) + visit namespace_project_settings_integrations_path(@project.namespace, @project) end step 'I visit project deploy keys page' do diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index b51152c79c6..345a28f27dc 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -3,19 +3,25 @@ module SharedProject # Create a project without caring about what it's called step "I own a project" do - @project = create(:project, namespace: @user.namespace) + @project = create(:project, :repository, namespace: @user.namespace) + @project.team << [@user, :master] + end + + step "I own a project in some group namespace" do + @group = create(:group, name: 'some group') + @project = create(:project, namespace: @group) @project.team << [@user, :master] end step "project exists in some group namespace" do @group = create(:group, name: 'some group') - @project = create(:project, namespace: @group, public_builds: false) + @project = create(:project, :repository, namespace: @group, public_builds: false) end # Create a specific project called "Shop" step 'I own project "Shop"' do @project = Project.find_by(name: "Shop") - @project ||= create(:project, name: "Shop", namespace: @user.namespace) + @project ||= create(:project, :repository, name: "Shop", namespace: @user.namespace) @project.team << [@user, :master] end @@ -40,7 +46,7 @@ module SharedProject # Create another specific project called "Forum" step 'I own project "Forum"' do @project = Project.find_by(name: "Forum") - @project ||= create(:project, name: "Forum", namespace: @user.namespace, path: 'forum_project') + @project ||= create(:project, :repository, name: "Forum", namespace: @user.namespace, path: 'forum_project') @project.build_project_feature @project.project_feature.save @project.team << [@user, :master] @@ -97,7 +103,7 @@ module SharedProject step 'I should see project settings' do expect(current_path).to eq edit_namespace_project_path(@project.namespace, @project) expect(page).to have_content("Project name") - expect(page).to have_content("Feature Visibility") + expect(page).to have_content("Sharing & Permissions") end def current_project @@ -121,7 +127,7 @@ module SharedProject # ---------------------------------------- step 'archived project "Archive"' do - create :project, :public, archived: true, name: 'Archive' + create(:project, :archived, :public, :repository, name: 'Archive') end step 'I should not see project "Archive"' do @@ -144,7 +150,7 @@ module SharedProject # ---------------------------------------- step 'private project "Enterprise"' do - create :project, name: 'Enterprise' + create(:project, :private, :repository, name: 'Enterprise') end step 'I should see project "Enterprise"' do @@ -156,19 +162,23 @@ module SharedProject end step 'internal project "Internal"' do - create :project, :internal, name: 'Internal' + create(:project, :internal, :repository, name: 'Internal') end step 'I should see project "Internal"' do - expect(page).to have_content "Internal" + page.within '.js-projects-list-holder' do + expect(page).to have_content "Internal" + end end step 'I should not see project "Internal"' do - expect(page).not_to have_content "Internal" + page.within '.js-projects-list-holder' do + expect(page).not_to have_content "Internal" + end end step 'public project "Community"' do - create :project, :public, name: 'Community' + create(:project, :public, :repository, name: 'Community') end step 'I should see project "Community"' do diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb index d6024212601..0cb9229dbae 100644 --- a/features/steps/shared/project_tab.rb +++ b/features/steps/shared/project_tab.rb @@ -4,7 +4,7 @@ module SharedProjectTab include Spinach::DSL include SharedActiveTab - step 'the active main tab should be Home' do + step 'the active main tab should be Project' do ensure_active_main_tab('Project') end @@ -12,16 +12,12 @@ module SharedProjectTab ensure_active_main_tab('Repository') end - step 'the active main tab should be Graphs' do - ensure_active_main_tab('Graphs') - end - step 'the active main tab should be Issues' do ensure_active_main_tab('Issues') end - step 'the active main tab should be Members' do - ensure_active_main_tab('Members') + step 'the active sub tab should be Members' do + ensure_active_sub_tab('Members') end step 'the active main tab should be Merge Requests' do @@ -37,15 +33,11 @@ module SharedProjectTab end step 'the active main tab should be Settings' do - expect(page).to have_selector('.layout-nav .nav-links > li.active', count: 0) + ensure_active_main_tab('Settings') end - step 'the active main tab should be Activity' do - ensure_active_main_tab('Activity') - end - - step 'the active sub tab should be Network' do - ensure_active_sub_tab('Network') + step 'the active sub tab should be Graph' do + ensure_active_sub_tab('Graph') end step 'the active sub tab should be Files' do @@ -55,4 +47,16 @@ module SharedProjectTab step 'the active sub tab should be Commits' do ensure_active_sub_tab('Commits') end + + step 'the active sub tab should be Home' do + ensure_active_sub_tab('Home') + end + + step 'the active sub tab should be Activity' do + ensure_active_sub_tab('Activity') + end + + step 'the active sub tab should be Charts' do + ensure_active_sub_tab('Charts') + end end diff --git a/features/steps/snippets/user.rb b/features/steps/snippets/user.rb deleted file mode 100644 index 997c605bce2..00000000000 --- a/features/steps/snippets/user.rb +++ /dev/null @@ -1,55 +0,0 @@ -class Spinach::Features::SnippetsUser < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - - step 'I visit my snippets page' do - visit dashboard_snippets_path - end - - step 'I should see "Personal snippet one" in snippets' do - expect(page).to have_content "Personal snippet one" - end - - step 'I should see "Personal snippet private" in snippets' do - expect(page).to have_content "Personal snippet private" - end - - step 'I should see "Personal snippet internal" in snippets' do - expect(page).to have_content "Personal snippet internal" - end - - step 'I should not see "Personal snippet one" in snippets' do - expect(page).not_to have_content "Personal snippet one" - end - - step 'I should not see "Personal snippet private" in snippets' do - expect(page).not_to have_content "Personal snippet private" - end - - step 'I should not see "Personal snippet internal" in snippets' do - expect(page).not_to have_content "Personal snippet internal" - end - - step 'I click "Internal" filter' do - page.within('.snippet-scope-menu') do - click_link "Internal" - end - end - - step 'I click "Private" filter' do - page.within('.snippet-scope-menu') do - click_link "Private" - end - end - - step 'I click "Public" filter' do - page.within('.snippet-scope-menu') do - click_link "Public" - end - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/features/steps/user.rb b/features/steps/user.rb index 59385a6ab59..271c9b097d4 100644 --- a/features/steps/user.rb +++ b/features/steps/user.rb @@ -38,6 +38,6 @@ class Spinach::Features::User < Spinach::FeatureSteps end def contributed_project - @contributed_project ||= create(:project, :public) + @contributed_project ||= create(:empty_project, :public) end end diff --git a/features/support/capybara.rb b/features/support/capybara.rb index 0b6a0981a3c..c0c489d2775 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -3,7 +3,7 @@ require 'capybara/poltergeist' require 'capybara-screenshot/spinach' # Give CI some extra time -timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 90 : 15 +timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 30 : 10 Capybara.javascript_driver = :poltergeist Capybara.register_driver :poltergeist do |app| diff --git a/features/support/env.rb b/features/support/env.rb index 8dbe3624410..f394c30d52f 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -4,7 +4,6 @@ SimpleCovEnv.start! ENV['RAILS_ENV'] = 'test' require './config/environment' require 'rspec/expectations' -require 'sidekiq/testing/inline' require_relative 'capybara' require_relative 'db_cleaner' @@ -15,7 +14,7 @@ if ENV['CI'] Knapsack::Adapters::SpinachAdapter.bind end -%w(select2_helper test_env repo_helpers wait_for_ajax).each do |f| +%w(select2_helper test_env repo_helpers wait_for_ajax sidekiq).each do |f| require Rails.root.join('spec', 'support', f) end |