diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/dashboard/new_project.feature | 10 | ||||
-rw-r--r-- | features/project/commits/commits.feature | 2 | ||||
-rw-r--r-- | features/project/source/browse_files.feature | 33 | ||||
-rw-r--r-- | features/steps/admin/projects.rb | 2 | ||||
-rw-r--r-- | features/steps/dashboard/new_project.rb | 6 | ||||
-rw-r--r-- | features/steps/project/commits/commits.rb | 14 | ||||
-rw-r--r-- | features/steps/project/source/browse_files.rb | 61 |
7 files changed, 100 insertions, 28 deletions
diff --git a/features/dashboard/new_project.feature b/features/dashboard/new_project.feature index bbd82a85e3a..76392068357 100644 --- a/features/dashboard/new_project.feature +++ b/features/dashboard/new_project.feature @@ -7,24 +7,24 @@ Background: And I click "New project" link @javascript - Scenario: I should see New projects page - Then I see "New project" page + Scenario: I should see New Projects page + Then I see "New Project" page Then I see all possible import optios @javascript Scenario: I should see instructions on how to import from Git URL - Given I see "New project" page + Given I see "New Project" page When I click on "Any repo by URL" Then I see instructions on how to import from Git URL @javascript Scenario: I should see instructions on how to import from GitHub - Given I see "New project" page + Given I see "New Project" page When I click on "Import project from GitHub" Then I see instructions on how to import from GitHub @javascript Scenario: I should see Google Code import page - Given I see "New project" page + Given I see "New Project" page When I click on "Google Code" Then I redirected to Google Code import page diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature index 34161b81d44..e4beeb59adc 100644 --- a/features/project/commits/commits.feature +++ b/features/project/commits/commits.feature @@ -20,6 +20,8 @@ Feature: Project Commits Given commit has ci status And 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/source/browse_files.feature b/features/project/source/browse_files.feature index 58574166ef3..377c5e1a9a7 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -21,12 +21,12 @@ Feature: Project Source Browse Files Then I should see raw file content Scenario: I can create file - Given I click on "new file" link in repo + Given I click on "New file" link in repo Then I can see new file page @javascript Scenario: I can create and commit file - Given I click on "new file" link in repo + Given I click on "New file" link in repo And I edit code And I fill the new file name And I fill the commit message @@ -36,14 +36,13 @@ Feature: Project Source Browse Files @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" + Given I click on "Upload file" link in repo And I upload a new text file And I fill the upload file commit message + And I fill the new branch name And I click on "Upload file" Then I can see the new text file + And I am redirected to the uploaded file on new branch And I can see the new commit message @javascript @@ -59,7 +58,7 @@ Feature: Project Source Browse Files @javascript Scenario: I can create and commit file and specify new branch - Given I click on "new file" link in repo + Given I click on "New file" link in repo And I edit code And I fill the new file name And I fill the commit message @@ -83,7 +82,7 @@ Feature: Project Source Browse Files @javascript Scenario: If I enter an illegal file name I see an error message - Given I click on "new file" link in repo + Given I click on "New file" link in repo And I fill the new file name with an illegal name And I edit code And I fill the commit message @@ -139,6 +138,24 @@ Feature: Project Source Browse Files And I see a commit error message @javascript + Scenario: I can create directory in repo + When I click on "New directory" link in repo + And I fill the new directory name + And I fill the commit message + And I fill the new branch name + And I click on "Create directory" + Then I am redirected to the new directory + + @javascript + Scenario: I attempt to create an existing directory + When I click on "New directory" link in repo + And I fill an existing directory name + And I fill the commit message + And I click on "Create directory" + Then I see "Unable to create directory" + And I am redirected to the root directory + + @javascript Scenario: I can see editing preview Given I click on ".gitignore" file in repo And I click button "Edit" diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb index 17233f89f38..5a1cc9aa151 100644 --- a/features/steps/admin/projects.rb +++ b/features/steps/admin/projects.rb @@ -41,6 +41,8 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps 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) find(:xpath, "//input[@id='new_namespace_id']").set group.id click_button 'Transfer' end diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 1e09162a5b5..44a4aa9844a 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -3,13 +3,13 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps include SharedPaths include SharedProject - step 'I click "New project" link' do + step 'I click "New Project" link' do page.within('.content') do - click_link "New project" + click_link "New Project" end end - step 'I see "New project" page' do + step 'I see "New Project" page' do expect(page).to have_content('Project path') end diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index 5ebc3a49760..a3cb83880e3 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -104,10 +104,20 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'commit has ci status' do @project.enable_ci - create :ci_commit, gl_project: @project, sha: sample_commit.id + 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 + 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/source/browse_files.rb b/features/steps/project/source/browse_files.rb index a1a49dd58a6..cb100ca0f54 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 @@ -287,6 +322,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 |