summaryrefslogtreecommitdiff
path: root/features/steps
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-11-17 17:01:28 +0100
committerDouwe Maan <douwe@gitlab.com>2015-11-17 17:01:28 +0100
commit0b540a0fadf172277639910023fcf8b713ad35aa (patch)
tree9efe6d84cebdca7bc31bcc0e6e2e3b7bdf2e3185 /features/steps
parent3d50b99d016af91c06a40f7a8bf4c298e241220a (diff)
parentdf0110ba81a86b3e066c8b703e1c26d6d05a75da (diff)
downloadgitlab-ce-0b540a0fadf172277639910023fcf8b713ad35aa.tar.gz
Merge branch 'master' into dirceu/gitlab-ce-new-merge-request-from-file-edit
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/abuse_reports.rb2
-rw-r--r--features/steps/groups.rb24
-rw-r--r--features/steps/profile/profile.rb15
-rw-r--r--features/steps/project/commits/tags.rb36
-rw-r--r--features/steps/project/graph.rb6
-rw-r--r--features/steps/project/merge_requests.rb33
-rw-r--r--features/steps/project/project.rb8
-rw-r--r--features/steps/project/snippets.rb8
-rw-r--r--features/steps/project/source/browse_files.rb15
-rw-r--r--features/steps/shared/paths.rb4
-rw-r--r--features/steps/shared/project.rb7
-rw-r--r--features/steps/shared/project_tab.rb2
-rw-r--r--features/steps/snippets/snippets.rb6
-rw-r--r--features/steps/snippets/user.rb6
14 files changed, 133 insertions, 39 deletions
diff --git a/features/steps/abuse_reports.rb b/features/steps/abuse_reports.rb
index 56652ff6f05..499accb0b08 100644
--- a/features/steps/abuse_reports.rb
+++ b/features/steps/abuse_reports.rb
@@ -23,7 +23,7 @@ class Spinach::Features::AbuseReports < Spinach::FeatureSteps
end
step 'I should see a red "Report abuse" button' do
- expect(find(:css, '.report_abuse')).to have_selector(:css, 'span.btn-close')
+ expect(page).to have_button("Already reported for abuse")
end
def user_mike
diff --git a/features/steps/groups.rb b/features/steps/groups.rb
index 69ddfa42c06..a8fba2406ae 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 'Go to dashboard'
end
step 'gitlab user "Mike"' do
@@ -255,6 +255,28 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
expect(page).to have_xpath("//span[@class='label label-warning']", text: 'archived')
end
+ step 'I fill milestone name' do
+ fill_in 'milestone_title', with: 'v2.9.0'
+ end
+
+ step 'I click new milestone button' do
+ click_link "New Milestone"
+ end
+
+ step 'I press create mileston button' do
+ click_button "Create Milestone"
+ end
+
+ step 'milestone in each project should be created' do
+ group = Group.find_by(name: 'Owned')
+ expect(page).to have_content "Milestone v2.9.0"
+ expect(group.projects).to be_present
+
+ group.projects.each do |project|
+ expect(page).to have_content project.name
+ end
+ end
+
protected
def assigned_to_me(key)
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb
index 8cf24705a5e..40b2aa7c357 100644
--- a/features/steps/profile/profile.rb
+++ b/features/steps/profile/profile.rb
@@ -59,7 +59,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
step 'I should not see the "Remove avatar" button' do
expect(page).not_to have_link("Remove avatar")
end
-
+
step 'I should see the gravatar host link' do
expect(page).to have_link("gravatar.com")
end
@@ -159,10 +159,9 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
step 'I should see my user page' do
- expect(page).to have_content "User Activity"
-
- page.within '.navbar-gitlab' do
+ page.within ".cover-block" do
expect(page).to have_content current_user.name
+ expect(page).to have_content current_user.username
end
end
@@ -176,7 +175,13 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
step 'I should see groups I belong to' do
- expect(page).to have_css('.profile-groups-avatars', visible: true)
+ page.within ".content" do
+ click_link "Groups"
+ end
+
+ page.within "#groups" do
+ expect(page).to have_content @group.name
+ end
end
step 'I click on new application button' do
diff --git a/features/steps/project/commits/tags.rb b/features/steps/project/commits/tags.rb
index e6f8faf50fd..eff4234a44a 100644
--- a/features/steps/project/commits/tags.rb
+++ b/features/steps/project/commits/tags.rb
@@ -18,6 +18,18 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
click_button 'Create tag'
end
+ step 'I submit new tag form with release notes' do
+ fill_in 'tag_name', with: 'v7.0'
+ fill_in 'ref', with: 'master'
+ fill_in 'release_description', with: 'Awesome release notes'
+ click_button 'Create tag'
+ end
+
+ step 'I fill release notes and submit form' do
+ fill_in 'release_description', with: 'Awesome release notes'
+ click_button 'Save changes'
+ end
+
step 'I submit new tag form with invalid name' do
fill_in 'tag_name', with: 'v 1.0'
fill_in 'ref', with: 'master'
@@ -52,31 +64,27 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
expect(page).to have_content 'Tag already exists'
end
+ step "I visit tag 'v1.1.0' page" do
+ click_link 'v1.1.0'
+ end
+
step "I delete tag 'v1.1.0'" do
- page.within '.tags' do
+ page.within('.content') do
first('.btn-remove').click
- sleep 0.05
end
end
step "I should not see tag 'v1.1.0'" do
page.within '.tags' do
- expect(page.all(visible: true)).not_to have_content 'v1.1.0'
+ expect(page).not_to have_link 'v1.1.0'
end
end
- step 'I delete all tags' do
- page.within '.tags' do
- page.all('.btn-remove').each do |remove|
- remove.click
- sleep 0.05
- end
- end
+ step 'I click edit tag link' do
+ click_link 'Edit release notes'
end
- step 'I should see tags info message' do
- page.within '.tags' do
- expect(page).to have_content 'Repository has no tags yet.'
- end
+ step 'I should see tag release notes' do
+ expect(page).to have_content 'Awesome release notes'
end
end
diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb
index 4abd5288d51..98f31f3b76a 100644
--- a/features/steps/project/graph.rb
+++ b/features/steps/project/graph.rb
@@ -25,9 +25,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 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 '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 'Commit duration in minutes for last 30 commits'
end
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index 875bf6c4676..d5f2c4209a1 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -40,6 +40,14 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
expect(page).to have_content "Bug NS-04"
end
+ step 'I should not see "master" branch' do
+ expect(page).not_to have_content "master"
+ end
+
+ step 'I should see "other_branch" branch' do
+ expect(page).to have_content "other_branch"
+ end
+
step 'I should see "Bug NS-04" in merge requests' do
expect(page).to have_content "Bug NS-04"
end
@@ -93,6 +101,18 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
)
end
+ step 'project "Shop" have "Bug NS-06" open merge request' do
+ create(:merge_request,
+ title: "Bug NS-06",
+ source_project: project,
+ target_project: project,
+ source_branch: 'fix',
+ target_branch: 'other_branch',
+ author: project.users.first,
+ description: "# Description header"
+ )
+ end
+
step 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do
create(:merge_request_with_diffs,
title: "Bug NS-05",
@@ -338,6 +358,19 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
expect(page).to have_content('diff --git')
end
+ step '"Bug NS-05" has CI status' do
+ project = merge_request.source_project
+ project.enable_ci
+ ci_commit = create :ci_commit, gl_project: project, sha: merge_request.last_commit.id
+ create :ci_build, commit: ci_commit
+ end
+
+ step 'I should see merge request "Bug NS-05" with CI status' do
+ page.within ".mr-list" do
+ expect(page).to have_link "Build status: pending"
+ end
+ end
+
def merge_request
@merge_request ||= MergeRequest.find_by!(title: "Bug NS-05")
end
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
index 15f77734cb2..9ca7c8ebbc7 100644
--- a/features/steps/project/project.rb
+++ b/features/steps/project/project.rb
@@ -86,13 +86,13 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
step 'I should see project "Forum" README' do
- page.within('#README') do
+ page.within('.readme-holder') do
expect(page).to have_content 'Sample repo for testing gitlab features'
end
end
step 'I should see project "Shop" README' do
- page.within('#README') do
+ page.within('.readme-holder') do
expect(page).to have_content 'testme'
end
end
@@ -124,11 +124,11 @@ 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 'Go 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 'Go to group'
end
step 'I click notifications drop down button' do
diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb
index db8ad08bb9e..a3aef9bf8c3 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 "Add new snippet"
+ click_link "New Snippet"
end
step 'I click link "Snippet one"' do
@@ -42,13 +42,13 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
end
step 'I click link "Edit"' do
- page.within ".file-title" do
+ page.within ".page-title" do
click_link "Edit"
end
end
- step 'I click link "Remove Snippet"' do
- click_link "remove"
+ step 'I click link "Delete"' do
+ click_link "Delete"
end
step 'I submit new snippet "Snippet three"' do
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 1b27500497a..84725b9b585 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -78,6 +78,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
fill_in :file_name, with: 'Spaces Not Allowed'
end
+ step 'I fill the new file name with a new directory' do
+ fill_in :file_name, with: new_file_name_with_directory
+ end
+
step 'I fill the commit message' do
fill_in :commit_message, with: 'Not yet a commit message.', visible: true
end
@@ -238,6 +242,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
@project.namespace, @project, 'master/' + new_file_name))
end
+ step 'I am redirected to the new file with directory' do
+ expect(current_path).to eq(namespace_project_blob_path(
+ @project.namespace, @project, 'master/' + new_file_name_with_directory))
+ end
+
step 'I am redirected to the new file on new branch' do
expect(current_path).to eq(namespace_project_blob_path(
@project.namespace, @project, 'new_branch_name/' + new_file_name))
@@ -335,6 +344,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
'not_a_file.md'
end
+ # Constant value that is a valid filename with directory and
+ # not a filename present at root of the seed repository.
+ def new_file_name_with_directory
+ 'foo/bar/baz.txt'
+ end
+
# Constant value that is a valid directory and
# not a directory present at root of the seed repository.
def new_dir_name
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index eb978620da6..c74a5fd3bc7 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -31,6 +31,10 @@ module SharedPaths
visit merge_requests_group_path(Group.find_by(name: "Owned"))
end
+ step 'I visit group "Owned" milestones page' do
+ visit group_milestones_path(Group.find_by(name: "Owned"))
+ end
+
step 'I visit group "Owned" members page' do
visit group_group_members_path(Group.find_by(name: "Owned"))
end
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index 5744e455ebd..7021fac5fe4 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -206,4 +206,11 @@ module SharedProject
project = Project.find_by(name: "Shop")
create :ci_commit, gl_project: project, sha: project.commit.sha
end
+
+ step 'I should see last commit with CI status' do
+ page.within ".project-last-commit" do
+ expect(page).to have_content(project.commit.sha[0..6])
+ expect(page).to have_content("skipped")
+ end
+ end
end
diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb
index c67e5e4a06a..33ff7084e30 100644
--- a/features/steps/shared/project_tab.rb
+++ b/features/steps/shared/project_tab.rb
@@ -46,7 +46,7 @@ module SharedProjectTab
step 'the active main tab should be Settings' do
page.within '.nav-sidebar' do
- expect(page).to have_content('Back to project')
+ expect(page).to have_content('Go to project')
end
end
diff --git a/features/steps/snippets/snippets.rb b/features/steps/snippets/snippets.rb
index 6ff48e0c6b8..80d1ddeef05 100644
--- a/features/steps/snippets/snippets.rb
+++ b/features/steps/snippets/snippets.rb
@@ -13,13 +13,13 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
end
step 'I click link "Edit"' do
- page.within ".file-title" do
+ page.within ".page-title" do
click_link "Edit"
end
end
- step 'I click link "Destroy"' do
- click_link "remove"
+ step 'I click link "Delete"' do
+ click_link "Delete"
end
step 'I submit new snippet "Personal snippet three"' do
diff --git a/features/steps/snippets/user.rb b/features/steps/snippets/user.rb
index dea3256229f..997c605bce2 100644
--- a/features/steps/snippets/user.rb
+++ b/features/steps/snippets/user.rb
@@ -32,19 +32,19 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
end
step 'I click "Internal" filter' do
- page.within('.nav-tabs') do
+ page.within('.snippet-scope-menu') do
click_link "Internal"
end
end
step 'I click "Private" filter' do
- page.within('.nav-tabs') do
+ page.within('.snippet-scope-menu') do
click_link "Private"
end
end
step 'I click "Public" filter' do
- page.within('.nav-tabs') do
+ page.within('.snippet-scope-menu') do
click_link "Public"
end
end