summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorkaren Carias <karen@gitlab.com>2015-09-30 13:33:51 -0700
committerkaren Carias <karen@gitlab.com>2015-09-30 13:33:51 -0700
commit126dd008e110dce5dfe7d1d076bc57f33250ee7b (patch)
tree4ce96f2fd7e50faff65df7b556153c08d16a888c /features
parent6a1d695f861e4c5251a2333c673f78705b34891f (diff)
parent54452412f765d9e6e6166e105db9adbc7553aec2 (diff)
downloadgitlab-ce-126dd008e110dce5dfe7d1d076bc57f33250ee7b.tar.gz
solved conflict
Diffstat (limited to 'features')
-rw-r--r--features/admin/labels.feature38
-rw-r--r--features/dashboard/dashboard.feature4
-rw-r--r--features/explore/groups.feature14
-rw-r--r--features/groups.feature11
-rw-r--r--features/project/commits/commits.feature5
-rw-r--r--features/project/graph.feature6
-rw-r--r--features/project/issues/milestones.feature8
-rw-r--r--features/project/merge_requests.feature36
-rw-r--r--features/project/project.feature6
-rw-r--r--features/project/source/browse_files.feature23
-rw-r--r--features/steps/admin/labels.rb117
-rw-r--r--features/steps/admin/settings.rb1
-rw-r--r--features/steps/admin/users.rb6
-rw-r--r--features/steps/dashboard/dashboard.rb4
-rw-r--r--features/steps/groups.rb22
-rw-r--r--features/steps/invites.rb2
-rw-r--r--features/steps/project/commits/commits.rb9
-rw-r--r--features/steps/project/fork.rb5
-rw-r--r--features/steps/project/graph.rb18
-rw-r--r--features/steps/project/issues/milestones.rb7
-rw-r--r--features/steps/project/merge_requests.rb36
-rw-r--r--features/steps/project/project.rb18
-rw-r--r--features/steps/project/services.rb4
-rw-r--r--features/steps/project/source/browse_files.rb83
-rw-r--r--features/steps/shared/paths.rb4
-rw-r--r--features/steps/shared/project.rb15
-rw-r--r--features/steps/snippets/user.rb2
27 files changed, 431 insertions, 73 deletions
diff --git a/features/admin/labels.feature b/features/admin/labels.feature
new file mode 100644
index 00000000000..1af0e700bd4
--- /dev/null
+++ b/features/admin/labels.feature
@@ -0,0 +1,38 @@
+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/dashboard/dashboard.feature b/features/dashboard/dashboard.feature
index 392d4235eff..b667b587c5b 100644
--- a/features/dashboard/dashboard.feature
+++ b/features/dashboard/dashboard.feature
@@ -4,12 +4,14 @@ Feature: Dashboard
Given I sign in as a user
And I own project "Shop"
And project "Shop" has push event
+ And project "Shop" has CI enabled
+ And project "Shop" has CI build
And I visit dashboard page
- @javascript
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
@javascript
Scenario: I should see activity list
diff --git a/features/explore/groups.feature b/features/explore/groups.feature
index c11634bd74a..a42e59c98f2 100644
--- a/features/explore/groups.feature
+++ b/features/explore/groups.feature
@@ -3,20 +3,6 @@ Feature: Explore Groups
Background:
Given group "TestGroup" has private project "Enterprise"
- Scenario: I should not see group with private projects as visitor
- When I visit group "TestGroup" page
- Then I should be redirected to sign in page
-
- Scenario: I should not see group with private projects group as user
- When I sign in as a user
- And I visit group "TestGroup" page
- Then page status code should be 404
-
- Scenario: I should not see group with private and internal projects as visitor
- Given group "TestGroup" has internal project "Internal"
- When I visit group "TestGroup" page
- Then I should be redirected to sign in page
-
Scenario: I should see group with private and internal projects as user
Given group "TestGroup" has internal project "Internal"
When I sign in as a user
diff --git a/features/groups.feature b/features/groups.feature
index d5272fdddcf..db37fa3b375 100644
--- a/features/groups.feature
+++ b/features/groups.feature
@@ -159,3 +159,14 @@ Feature: Groups
When I visit group "Owned" projects page
Then I should see group "Owned" projects list
And I should see "archived" label
+
+ # Public group
+ @javascript
+ Scenario: Signed out user should see group
+ Given "Mary Jane" is owner of group "Owned"
+ And I am a signed out user
+ And Group "Owned" has a public project "Public-project"
+ When I visit group "Owned" page
+ Then I should see group "Owned"
+ Then I should see project "Public-project"
+
diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature
index 3ebc8a39aae..34161b81d44 100644
--- a/features/project/commits/commits.feature
+++ b/features/project/commits/commits.feature
@@ -16,6 +16,11 @@ Feature: Project Commits
Then I see commit info
And I see side-by-side diff button
+ Scenario: I browse commit with ci from list
+ Given commit has ci status
+ And I click on commit link
+ Then I see commit ci info
+
Scenario: I browse commit with side-by-side diff view
Given I click on commit link
And I click side-by-side diff button
diff --git a/features/project/graph.feature b/features/project/graph.feature
index 89064242c1c..2acd65aea5f 100644
--- a/features/project/graph.feature
+++ b/features/project/graph.feature
@@ -12,3 +12,9 @@ Feature: Project Graph
Scenario: I should see project commits graphs
When I visit project "Shop" commits graph page
Then page should have commits graphs
+
+ @javascript
+ Scenario: I should see project ci graphs
+ Given project "Shop" has CI enabled
+ When I visit project "Shop" CI graph page
+ Then page should have CI graphs
diff --git a/features/project/issues/milestones.feature b/features/project/issues/milestones.feature
index bfbaaec5a35..c1a20e9b488 100644
--- a/features/project/issues/milestones.feature
+++ b/features/project/issues/milestones.feature
@@ -12,13 +12,17 @@ Feature: Project Issues Milestones
Given I click link "v2.2"
Then I should see milestone "v2.2"
- Scenario: I create new milestone
+ @javascript
+ Scenario: I create and delete new milestone
Given I click link "New Milestone"
And I submit new milestone "v2.3"
Then I should see milestone "v2.3"
+ Given I click link to remove milestone
+ When I visit project "Shop" activity page
+ Then I should see deleted milestone activity
Scenario: I delete new milestone
- Given I click link to remove milestone "v2.2"
+ Given I click link to remove milestone
And I should see no milestones
@javascript
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature
index 947f668e432..83055188bac 100644
--- a/features/project/merge_requests.feature
+++ b/features/project/merge_requests.feature
@@ -115,40 +115,40 @@ Feature: Project Merge Requests
Given project "Shop" have "Bug NS-05" open merge request with diffs inside
And I visit merge request page "Bug NS-05"
And I click on the Changes tab
- And I leave a comment like "Line is wrong" on line 39 of the second file
- And I click link "Hide inline discussion" of the second file
- Then I should not see a comment like "Line is wrong here" in the second file
+ And I leave a comment like "Line is wrong" on line 39 of the third file
+ And I click link "Hide inline discussion" of the third file
+ Then I should not see a comment like "Line is wrong here" in the third file
@javascript
Scenario: I show comments on a merge request diff with comments in a single file
Given project "Shop" have "Bug NS-05" open merge request with diffs inside
And I visit merge request page "Bug NS-05"
And I click on the Changes tab
- And I leave a comment like "Line is wrong" on line 39 of the second file
- Then I should see a comment like "Line is wrong" in the second file
+ And I leave a comment like "Line is wrong" on line 39 of the third file
+ Then I should see a comment like "Line is wrong" in the third file
@javascript
Scenario: I hide comments on a merge request diff with comments in multiple files
Given project "Shop" have "Bug NS-05" open merge request with diffs inside
And I visit merge request page "Bug NS-05"
And I click on the Changes tab
- And I leave a comment like "Line is correct" on line 12 of the first file
- And I leave a comment like "Line is wrong" on line 39 of the second file
- And I click link "Hide inline discussion" of the second file
- Then I should not see a comment like "Line is wrong here" in the second file
- And I should still see a comment like "Line is correct" in the first file
+ And I leave a comment like "Line is correct" on line 12 of the second file
+ And I leave a comment like "Line is wrong" on line 39 of the third file
+ And I click link "Hide inline discussion" of the third file
+ Then I should not see a comment like "Line is wrong here" in the third file
+ And I should still see a comment like "Line is correct" in the second file
@javascript
Scenario: I show comments on a merge request diff with comments in multiple files
Given project "Shop" have "Bug NS-05" open merge request with diffs inside
And I visit merge request page "Bug NS-05"
And I click on the Changes tab
- And I leave a comment like "Line is correct" on line 12 of the first file
- And I leave a comment like "Line is wrong" on line 39 of the second file
- And I click link "Hide inline discussion" of the second file
- And I click link "Show inline discussion" of the second file
- Then I should see a comment like "Line is wrong" in the second file
- And I should still see a comment like "Line is correct" in the first file
+ And I leave a comment like "Line is correct" on line 12 of the second file
+ And I leave a comment like "Line is wrong" on line 39 of the third file
+ And I click link "Hide inline discussion" of the third file
+ And I click link "Show inline discussion" of the third file
+ Then I should see a comment like "Line is wrong" in the third file
+ And I should still see a comment like "Line is correct" in the second file
@javascript
Scenario: I unfold diff
@@ -163,8 +163,8 @@ Feature: Project Merge Requests
Given project "Shop" have "Bug NS-05" open merge request with diffs inside
And I visit merge request page "Bug NS-05"
And I click on the Changes tab
- And I leave a comment like "Line is correct" on line 12 of the first file
- And I leave a comment like "Line is wrong" on line 39 of the second file
+ And I leave a comment like "Line is correct" on line 12 of the second file
+ And I leave a comment like "Line is wrong" on line 39 of the third file
And I click Side-by-side Diff tab
Then I should see comments on the side-by-side diff page
diff --git a/features/project/project.feature b/features/project/project.feature
index 089ffcba14a..b3fb0794547 100644
--- a/features/project/project.feature
+++ b/features/project/project.feature
@@ -74,3 +74,9 @@ Feature: Project
Given I disable snippets in project
When I visit project "Shop" page
Then I should not see "Snippets" button
+
+ @javascript
+ Scenario: I edit Project Notifications
+ Given I click notifications drop down button
+ When I choose Mention setting
+ Then I should see Notification saved message
diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature
index d3a77466a35..58574166ef3 100644
--- a/features/project/source/browse_files.feature
+++ b/features/project/source/browse_files.feature
@@ -35,6 +35,29 @@ Feature: Project Source Browse Files
And I should see its new content
@javascript
+ Scenario: I can upload file and commit
+ Given I click on "new file" link in repo
+ Then I can see new file page
+ And I can see "upload an existing one"
+ And I click on "upload"
+ And I upload a new text file
+ And I fill the upload file commit message
+ And I click on "Upload file"
+ Then I can see the new text file
+ And I can see the new commit message
+
+ @javascript
+ Scenario: I can replace file and commit
+ Given I click on ".gitignore" file in repo
+ And I see the ".gitignore"
+ And I click on "Replace"
+ And I replace it with a text file
+ And I fill the replace file commit message
+ And I click on "Replace file"
+ Then I can see the new text file
+ And I can see the replacement commit message
+
+ @javascript
Scenario: I can create and commit file and specify new branch
Given I click on "new file" link in repo
And I edit code
diff --git a/features/steps/admin/labels.rb b/features/steps/admin/labels.rb
new file mode 100644
index 00000000000..b45d98658bc
--- /dev/null
+++ b/features/steps/admin/labels.rb
@@ -0,0 +1,117 @@
+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 'Remove'
+ 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 is invalid'
+ 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/settings.rb b/features/steps/admin/settings.rb
index 7a6aec23af8..6acbf46eb20 100644
--- a/features/steps/admin/settings.rb
+++ b/features/steps/admin/settings.rb
@@ -7,6 +7,7 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps
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
diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb
index 2e17d5c4c2e..4bc290b6bdf 100644
--- a/features/steps/admin/users.rb
+++ b/features/steps/admin/users.rb
@@ -4,11 +4,13 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
include SharedAdmin
before do
- allow(Devise).to receive(:omniauth_providers).and_return([:twitter, :twitter_updated])
+ 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(Devise).to receive(:omniauth_providers).and_call_original
+ 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
diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb
index cb3a80cac29..f0fbd8a826a 100644
--- a/features/steps/dashboard/dashboard.rb
+++ b/features/steps/dashboard/dashboard.rb
@@ -11,6 +11,10 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
expect(page).to have_link "Shop"
end
+ step 'I should see "Shop" project CI status' do
+ expect(page).to have_link "Build status: skipped"
+ end
+
step 'I should see last push widget' do
expect(page).to have_content "You pushed to fix"
expect(page).to have_link "Create Merge Request"
diff --git a/features/steps/groups.rb b/features/steps/groups.rb
index 18a1c4d32ce..95bc9baf8d8 100644
--- a/features/steps/groups.rb
+++ b/features/steps/groups.rb
@@ -6,7 +6,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
include Select2Helper
step 'I should see back to dashboard button' do
- expect(page).to have_content 'Back to Dashboard'
+ expect(page).to have_content 'Back to dashboard'
end
step 'gitlab user "Mike"' do
@@ -17,6 +17,26 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
find(:css, 'button.btn-new').click
end
+ step 'I should see group "Owned"' do
+ expect(page).to have_content '@owned'
+ end
+
+ step 'I am a signed out user' do
+ logout
+ end
+
+ step 'Group "Owned" has a public project "Public-project"' do
+ group = Group.find_by(name: "Owned")
+
+ @project = create :empty_project, :public,
+ group: group,
+ name: "Public-project"
+ end
+
+ step 'I should see project "Public-project"' do
+ expect(page).to have_content 'Public-project'
+ end
+
step 'I select "Mike" as "Reporter"' do
user = User.find_by(name: "Mike")
diff --git a/features/steps/invites.rb b/features/steps/invites.rb
index 5e8feff5095..dac972172aa 100644
--- a/features/steps/invites.rb
+++ b/features/steps/invites.rb
@@ -63,7 +63,7 @@ class Spinach::Features::Invites < Spinach::FeatureSteps
end
step 'I should be redirected to the dashboard' do
- expect(current_path).to eq(dashboard_path)
+ expect(current_path).to eq(dashboard_projects_path)
end
step 'I should see a notice telling me I have declined' do
diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb
index 23e67371f96..47f58091b93 100644
--- a/features/steps/project/commits/commits.rb
+++ b/features/steps/project/commits/commits.rb
@@ -101,4 +101,13 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
step 'I click side-by-side diff button' do
find('#parallel-diff-btn').click
end
+
+ step 'commit has ci status' do
+ @project.enable_ci(@user)
+ create :ci_commit, gl_project: @project, sha: sample_commit.id
+ end
+
+ step 'I see commit ci info' do
+ expect(page).to have_content "build: skipped"
+ end
end
diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb
index 0e433781d7a..b0230add34f 100644
--- a/features/steps/project/fork.rb
+++ b/features/steps/project/fork.rb
@@ -5,8 +5,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
step 'I click link "Fork"' do
expect(page).to have_content "Shop"
- expect(page).to have_content "Fork"
- click_link "Fork"
+ click_link "Fork project"
end
step 'I am a member of project "Shop"' do
@@ -15,7 +14,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
end
step 'I should see the forked project page' do
- expect(page).to have_content "Project was successfully forked."
+ expect(page).to have_content "Forked from"
end
step 'I already have a project named "Shop" in my namespace' do
diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb
index 5e7e573a6ab..9453d636445 100644
--- a/features/steps/project/graph.rb
+++ b/features/steps/project/graph.rb
@@ -7,12 +7,10 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
end
When 'I visit project "Shop" graph page' do
- project = Project.find_by(name: "Shop")
visit namespace_project_graph_path(project.namespace, project, "master")
end
step 'I visit project "Shop" commits graph page' do
- project = Project.find_by(name: "Shop")
visit commits_namespace_project_graph_path(project.namespace, project, "master")
end
@@ -20,4 +18,20 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
expect(page).to have_content "Commit statistics for master"
expect(page).to have_content "Commits per day of month"
end
+
+ step 'I visit project "Shop" CI graph page' do
+ visit ci_namespace_project_graph_path(project.namespace, project, 'master')
+ end
+
+ step 'page should have CI graphs' do
+ expect(page).to have_content 'Overall'
+ expect(page).to have_content 'Builds chart for last week'
+ expect(page).to have_content 'Builds chart for last month'
+ expect(page).to have_content 'Builds chart for last year'
+ expect(page).to have_content 'Commit duration in minutes for last 30 commits'
+ end
+
+ def project
+ project ||= Project.find_by(name: "Shop")
+ end
end
diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb
index 61e62c2adbd..c8708572ec6 100644
--- a/features/steps/project/issues/milestones.rb
+++ b/features/steps/project/issues/milestones.rb
@@ -49,6 +49,11 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
create(:closed_issue, project: project, milestone: milestone)
end
+ step 'I should see deleted milestone activity' do
+ expect(page).to have_content('opened milestone in')
+ expect(page).to have_content('destroyed milestone in')
+ end
+
When 'I click link "All Issues"' do
click_link 'All Issues'
end
@@ -57,7 +62,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
expect(page).to have_selector('#tab-issues li.issue-row', count: 4)
end
- step 'I click link to remove milestone "v2.2"' do
+ step 'I click link to remove milestone' do
click_link 'Remove'
end
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index c92998631ff..875bf6c4676 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -224,43 +224,43 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
- step 'I click link "Hide inline discussion" of the second file' do
- page.within '.files [id^=diff]:nth-child(2)' do
+ step 'I click link "Hide inline discussion" of the third file' do
+ page.within '.files [id^=diff]:nth-child(3)' do
find('.js-toggle-diff-comments').trigger('click')
end
end
- step 'I click link "Show inline discussion" of the second file' do
- page.within '.files [id^=diff]:nth-child(2)' do
+ step 'I click link "Show inline discussion" of the third file' do
+ page.within '.files [id^=diff]:nth-child(3)' do
find('.js-toggle-diff-comments').trigger('click')
end
end
- step 'I should not see a comment like "Line is wrong" in the second file' do
- page.within '.files [id^=diff]:nth-child(2)' do
+ step 'I should not see a comment like "Line is wrong" in the third file' do
+ page.within '.files [id^=diff]:nth-child(3)' do
expect(page).not_to have_visible_content "Line is wrong"
end
end
- step 'I should see a comment like "Line is wrong" in the second file' do
- page.within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do
+ step 'I should see a comment like "Line is wrong" in the third file' do
+ page.within '.files [id^=diff]:nth-child(3) .note-body > .note-text' do
expect(page).to have_visible_content "Line is wrong"
end
end
- step 'I should not see a comment like "Line is wrong here" in the second file' do
- page.within '.files [id^=diff]:nth-child(2)' do
+ step 'I should not see a comment like "Line is wrong here" in the third file' do
+ page.within '.files [id^=diff]:nth-child(3)' do
expect(page).not_to have_visible_content "Line is wrong here"
end
end
- step 'I should see a comment like "Line is wrong here" in the second file' do
- page.within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do
+ step 'I should see a comment like "Line is wrong here" in the third file' do
+ page.within '.files [id^=diff]:nth-child(3) .note-body > .note-text' do
expect(page).to have_visible_content "Line is wrong here"
end
end
- step 'I leave a comment like "Line is correct" on line 12 of the first file' do
+ step 'I leave a comment like "Line is correct" on line 12 of the second file' do
init_diff_note_first_file
page.within(".js-discussion-note-form") do
@@ -268,12 +268,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
click_button "Add Comment"
end
- page.within ".files [id^=diff]:nth-child(1) .note-body > .note-text" do
+ page.within ".files [id^=diff]:nth-child(2) .note-body > .note-text" do
expect(page).to have_content "Line is correct"
end
end
- step 'I leave a comment like "Line is wrong" on line 39 of the second file' do
+ step 'I leave a comment like "Line is wrong" on line 39 of the third file' do
init_diff_note_second_file
page.within(".js-discussion-note-form") do
@@ -282,8 +282,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
- step 'I should still see a comment like "Line is correct" in the first file' do
- page.within '.files [id^=diff]:nth-child(1) .note-body > .note-text' do
+ step 'I should still see a comment like "Line is correct" in the second file' do
+ page.within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do
expect(page).to have_visible_content "Line is correct"
end
end
@@ -303,7 +303,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I should see comments on the side-by-side diff page' do
- page.within '.files [id^=diff]:nth-child(1) .parallel .note-body > .note-text' do
+ page.within '.files [id^=diff]:nth-child(2) .parallel .note-body > .note-text' do
expect(page).to have_visible_content "Line is correct"
end
end
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
index 0404fd5e594..15f77734cb2 100644
--- a/features/steps/project/project.rb
+++ b/features/steps/project/project.rb
@@ -124,10 +124,24 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
step 'I should see back to dashboard button' do
- expect(page).to have_content 'Back to Dashboard'
+ expect(page).to have_content 'Back to dashboard'
end
step 'I should see back to group button' do
- expect(page).to have_content 'Back to Group'
+ expect(page).to have_content 'Back to group'
+ end
+
+ step 'I click notifications drop down button' do
+ click_link 'notifications-button'
+ end
+
+ step 'I choose Mention setting' do
+ click_link 'On mention'
+ end
+
+ step 'I should see Notification saved message' do
+ page.within '.flash-container' do
+ expect(page).to have_content 'Notification settings saved'
+ end
end
end
diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb
index 0327fd61981..d3b462bfd31 100644
--- a/features/steps/project/services.rb
+++ b/features/steps/project/services.rb
@@ -26,13 +26,11 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
step 'I fill gitlab-ci settings' do
check 'Active'
- fill_in 'Project url', with: 'http://ci.gitlab.org/projects/3'
- fill_in 'Token', with: 'verySecret'
click_button 'Save'
end
step 'I should see service settings saved' do
- expect(find_field('Project url').value).to eq 'http://ci.gitlab.org/projects/3'
+ expect(find_field('Active').value).to eq '1'
end
step 'I click hipchat service link' do
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 5cb085db207..a1a49dd58a6 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
@@ -78,7 +79,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I fill the commit message' do
- fill_in :commit_message, with: 'Not yet a commit message.'
+ fill_in :commit_message, with: 'Not yet a commit message.', visible: true
end
step 'I click link "Diff"' do
@@ -97,6 +98,14 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
click_button 'Remove file'
end
+ step 'I click on "Replace"' do
+ click_button "Replace"
+ end
+
+ step 'I click on "Replace file"' do
+ click_button 'Replace file'
+ end
+
step 'I see diff' do
expect(page).to have_css '.line_holder.new'
end
@@ -106,10 +115,55 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I can see new file page' do
- expect(page).to have_content "New file"
+ expect(page).to have_content "new file"
expect(page).to have_content "Commit message"
end
+ step 'I can see "upload an existing one"' do
+ expect(page).to have_content "upload an existing one"
+ end
+
+ step 'I click on "upload"' do
+ click_link 'upload'
+ end
+
+ step 'I click on "Upload file"' do
+ click_button 'Upload file'
+ end
+
+ step 'I can see the new commit message' do
+ expect(page).to have_content "New upload commit message"
+ end
+
+ step 'I upload a new text file' do
+ drop_in_dropzone test_text_file
+ end
+
+ step 'I fill the upload file commit message' do
+ page.within('#modal-upload-blob') do
+ fill_in :commit_message, with: 'New upload commit message'
+ end
+ end
+
+ step 'I replace it with a text file' do
+ drop_in_dropzone test_text_file
+ end
+
+ step 'I fill the replace file commit message' do
+ page.within('#modal-upload-blob') do
+ fill_in :commit_message, with: 'Replacement file commit message'
+ end
+ end
+
+ step 'I can see the replacement commit message' do
+ expect(page).to have_content "Replacement file commit message"
+ end
+
+ step 'I can see the new text file' do
+ expect(page).to have_content "Lorem ipsum dolor sit amet"
+ expect(page).to have_content "Sed ut perspiciatis unde omnis"
+ end
+
step 'I click on files directory' do
click_link 'files'
end
@@ -232,4 +286,29 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
def new_file_name
'not_a_file.md'
end
+
+ def drop_in_dropzone(file_path)
+ # Generate a fake input selector
+ page.execute_script <<-JS
+ var fakeFileInput = window.$('<input/>').attr(
+ {id: 'fakeFileInput', type: 'file'}
+ ).appendTo('body');
+ JS
+ # Attach the file to the fake input selector with Capybara
+ attach_file("fakeFileInput", file_path)
+ # Add the file to a fileList array and trigger the fake drop event
+ page.execute_script <<-JS
+ var fileList = [$('#fakeFileInput')[0].files[0]];
+ var e = jQuery.Event('drop', { dataTransfer : { files : fileList } });
+ $('.dropzone')[0].dropzone.listeners[0].events.drop(e);
+ JS
+ end
+
+ def test_text_file
+ File.join(Rails.root, 'spec', 'fixtures', 'doc_sample.txt')
+ end
+
+ def test_image_file
+ File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
+ end
end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index b4deccb6520..eb978620da6 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -68,7 +68,7 @@ module SharedPaths
# ----------------------------------------
step 'I visit dashboard page' do
- visit dashboard_path
+ visit dashboard_projects_path
end
step 'I visit dashboard activity page' do
@@ -460,7 +460,7 @@ module SharedPaths
end
step 'I visit snippets page' do
- visit snippets_path
+ visit explore_snippets_path
end
step 'I visit new snippet page' do
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index ccbe8f96a4c..fc51cec150e 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -51,6 +51,11 @@ module SharedProject
visit namespace_project_path(project.namespace, project)
end
+ step 'I visit project "Shop" activity page' do
+ project = Project.find_by(name: 'Shop')
+ visit namespace_project_path(project.namespace, project)
+ end
+
step 'project "Shop" has push event' do
@project = Project.find_by(name: "Shop")
@@ -191,4 +196,14 @@ module SharedProject
create(:label, project: project, title: 'feature')
create(:label, project: project, title: 'enhancement')
end
+
+ step 'project "Shop" has CI enabled' do
+ project = Project.find_by(name: "Shop")
+ project.enable_ci(@user)
+ end
+
+ step 'project "Shop" has CI build' do
+ project = Project.find_by(name: "Shop")
+ create :ci_commit, gl_project: project, sha: project.commit.sha
+ end
end
diff --git a/features/steps/snippets/user.rb b/features/steps/snippets/user.rb
index 007fcb2893f..dea3256229f 100644
--- a/features/steps/snippets/user.rb
+++ b/features/steps/snippets/user.rb
@@ -4,7 +4,7 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
include SharedSnippet
step 'I visit my snippets page' do
- visit user_snippets_path(current_user)
+ visit dashboard_snippets_path
end
step 'I should see "Personal snippet one" in snippets' do