summaryrefslogtreecommitdiff
path: root/features/steps/project
diff options
context:
space:
mode:
Diffstat (limited to 'features/steps/project')
-rw-r--r--features/steps/project/commits/commits.rb16
-rw-r--r--features/steps/project/fork.rb3
-rw-r--r--features/steps/project/graph.rb2
-rw-r--r--features/steps/project/issues/issues.rb4
-rw-r--r--features/steps/project/merge_requests.rb36
-rw-r--r--features/steps/project/project.rb4
-rw-r--r--features/steps/project/redirects.rb2
-rw-r--r--features/steps/project/services.rb4
-rw-r--r--features/steps/project/snippets.rb8
-rw-r--r--features/steps/project/source/browse_files.rb74
10 files changed, 109 insertions, 44 deletions
diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb
index 56f1f06fb06..e5b3f27135d 100644
--- a/features/steps/project/commits/commits.rb
+++ b/features/steps/project/commits/commits.rb
@@ -103,11 +103,21 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
step 'commit has ci status' do
- @project.enable_ci(@user)
- create :ci_commit, project: @project.gitlab_ci_project, sha: sample_commit.id
+ @project.enable_ci
+ ci_commit = create :ci_commit, gl_project: @project, sha: sample_commit.id
+ create :ci_build, commit: ci_commit
end
step 'I see commit ci info' do
- expect(page).to have_content "build: skipped"
+ expect(page).to have_content "build: 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 "build: pending"
+ expect(page).to have_content "Latest builds"
end
end
diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb
index 370960845cc..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
diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb
index 9453d636445..4abd5288d51 100644
--- a/features/steps/project/graph.rb
+++ b/features/steps/project/graph.rb
@@ -32,6 +32,6 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
end
def project
- project ||= Project.find_by(name: "Shop")
+ @project ||= Project.find_by(name: "Shop")
end
end
diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb
index 239392eab96..af2da41badb 100644
--- a/features/steps/project/issues/issues.rb
+++ b/features/steps/project/issues/issues.rb
@@ -223,11 +223,11 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
step 'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\'' do
- issue = create(:issue, title: 'Bugfix1', description: 'Description for issue1', project: project)
+ create(:issue, title: 'Bugfix1', description: 'Description for issue1', project: project)
end
step 'project \'Shop\' has issue \'Feature1\' with description: \'Feature submitted for issue1\'' do
- issue = create(:issue, title: 'Feature1', description: 'Feature submitted for issue1', project: project)
+ create(:issue, title: 'Feature1', description: 'Feature submitted for issue1', project: project)
end
step 'I fill in issue search with \'Description for issue1\'' do
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 15f77734cb2..d76891d5bde 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
diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb
index 0e724138a8a..1ffd5cb9de5 100644
--- a/features/steps/project/redirects.rb
+++ b/features/steps/project/redirects.rb
@@ -39,7 +39,6 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step 'Authenticate' do
admin = create(:admin)
- project = Project.find_by(name: 'Community')
fill_in "user_login", with: admin.email
fill_in "user_password", with: admin.password
click_button "Sign in"
@@ -54,7 +53,6 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step 'I get redirected to signin page where I sign in' do
admin = create(:admin)
- project = Project.find_by(name: 'Enterprise')
fill_in "user_login", with: admin.email
fill_in "user_password", with: admin.password
click_button "Sign in"
diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb
index d3b462bfd31..1c700df0c63 100644
--- a/features/steps/project/services.rb
+++ b/features/steps/project/services.rb
@@ -202,6 +202,10 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
expect(find_field('Username').value).to eq 'user'
end
+ step 'I should see empty field Change Password' do
+ expect(find_field('Change Password').value).to be_nil
+ end
+
step 'I click JetBrains TeamCity CI service link' do
click_link 'JetBrains TeamCity CI'
end
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 a1a49dd58a6..1b27500497a 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -71,7 +71,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I fill the new branch name' do
- fill_in :new_branch, with: 'new_branch_name'
+ fill_in :new_branch, with: 'new_branch_name', visible: true
end
step 'I fill the new file name with an illegal name' do
@@ -90,6 +90,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
click_button 'Commit Changes'
end
+ step 'I click on "Create directory"' do
+ click_button 'Create directory'
+ end
+
step 'I click on "Remove"' do
click_button 'Remove'
end
@@ -110,21 +114,32 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
expect(page).to have_css '.line_holder.new'
end
- step 'I click on "new file" link in repo' do
- click_link 'new-file-link'
+ step 'I click on "New file" link in repo' do
+ find('.add-to-tree').click
+ click_link 'Create file'
end
- step 'I can see new file page' do
- expect(page).to have_content "new file"
- expect(page).to have_content "Commit message"
+ step 'I click on "Upload file" link in repo' do
+ find('.add-to-tree').click
+ click_link 'Upload file'
+ end
+
+ step 'I click on "New directory" link in repo' do
+ find('.add-to-tree').click
+ click_link 'New directory'
+ end
+
+ step 'I fill the new directory name' do
+ fill_in :dir_name, with: new_dir_name
end
- step 'I can see "upload an existing one"' do
- expect(page).to have_content "upload an existing one"
+ step 'I fill an existing directory name' do
+ fill_in :dir_name, with: 'files'
end
- step 'I click on "upload"' do
- click_link 'upload'
+ step 'I can see new file page' do
+ expect(page).to have_content "new file"
+ expect(page).to have_content "Commit message"
end
step 'I click on "Upload file"' do
@@ -228,10 +243,30 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
@project.namespace, @project, 'new_branch_name/' + new_file_name))
end
+ step 'I am redirected to the uploaded file on new branch' do
+ expect(current_path).to eq(namespace_project_blob_path(
+ @project.namespace, @project,
+ 'new_branch_name/' + File.basename(test_text_file)))
+ end
+
+ step 'I am redirected to the new directory' do
+ expect(current_path).to eq(namespace_project_tree_path(
+ @project.namespace, @project, 'new_branch_name/' + new_dir_name))
+ end
+
+ step 'I am redirected to the root directory' do
+ expect(current_path).to eq(namespace_project_tree_path(
+ @project.namespace, @project, 'master/'))
+ end
+
step "I don't see the permalink link" do
expect(page).not_to have_link('permalink')
end
+ step 'I see "Unable to create directory"' do
+ expect(page).to have_content('Directory already exists')
+ end
+
step 'I see a commit error message' do
expect(page).to have_content('Your changes could not be committed')
end
@@ -251,6 +286,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
select "'test'", from: 'ref'
end
+ step "I switch ref to fix" do
+ select "fix", from: 'ref'
+ end
+
step "I see the ref 'test' has been selected" do
expect(page).to have_selector '.select2-chosen', text: "'test'"
end
@@ -259,11 +298,20 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
visit namespace_project_tree_path(@project.namespace, @project, "'test'")
end
+ step "I visit the fix tree" do
+ visit namespace_project_tree_path(@project.namespace, @project, "fix/.testdir")
+ end
+
step 'I see the commit data' do
expect(page).to have_css('.tree-commit-link', visible: true)
expect(page).not_to have_content('Loading commit data...')
end
+ step 'I see the commit data for a directory with a leading dot' do
+ expect(page).to have_css('.tree-commit-link', visible: true)
+ expect(page).not_to have_content('Loading commit data...')
+ end
+
private
def set_new_content
@@ -287,6 +335,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
'not_a_file.md'
end
+ # Constant value that is a valid directory and
+ # not a directory present at root of the seed repository.
+ def new_dir_name
+ 'new_dir/subdir'
+ end
+
def drop_in_dropzone(file_path)
# Generate a fake input selector
page.execute_script <<-JS