From c910bca730561da3361faec56ef509e25a798c66 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 21 Dec 2015 11:57:51 +0100 Subject: Add tests for new functionality --- features/project/source/browse_files.feature | 106 ++++++++++++++++++++++++--- 1 file changed, 97 insertions(+), 9 deletions(-) (limited to 'features/project') diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature index 02159ee3776..937db23d928 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -24,6 +24,12 @@ Feature: Project Source Browse Files Given I click on "New file" link in repo Then I can see new file page + Scenario: I can create file when I don't have write access + Given I don't have write access + And I click on "New file" link in repo + Then I should see a notice about a new fork having been created + Then I can see new file page + @javascript Scenario: I can create and commit file Given I click on "New file" link in repo @@ -34,6 +40,17 @@ Feature: Project Source Browse Files Then I am redirected to the new file And I should see its new content + @javascript + Scenario: I can create and commit file when I don't have write access + Given I don't have write access + And 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 + And I click on "Commit Changes" + Then I am redirected to the fork's new merge request page + And I can see the new commit message + @javascript Scenario: I can create and commit file with new lines at the end of file Given I click on "New file" link in repo @@ -45,6 +62,17 @@ Feature: Project Source Browse Files And I click button "Edit" And I should see its content with new lines preserved at end of file + @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 + And I fill the new file name + And I fill the commit message + And I fill the new branch name + And I click on "Commit Changes" + Then I am redirected to the fork's new merge request page + And I should see its new content + @javascript Scenario: I can upload file and commit Given I click on "Upload file" link in repo @@ -56,6 +84,19 @@ Feature: Project Source Browse Files And I am redirected to the new merge request page And I can see the new commit message + @javascript + Scenario: I can upload file and commit when I don't have write access + Given I don't have write access + And I click on "Upload file" link in repo + Then I should see a notice about a new fork having been created + When 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 click on "Upload file" + Then I can see the new text file + And I am redirected to the fork's new merge request page + And I can see the new commit message + @javascript Scenario: I can replace file and commit Given I click on ".gitignore" file in repo @@ -68,15 +109,19 @@ Feature: Project Source Browse Files 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 - And I fill the new file name - And I fill the commit message - And I fill the new branch name - And I click on "Commit Changes" - Then I am redirected to the new merge request page - And I should see its new content + Scenario: I can replace file and commit when I don't have write access + Given I don't have write access + And I click on ".gitignore" file in repo + And I see the ".gitignore" + And I click on "Replace" + Then I should see a notice about a new fork having been created + When 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 am redirected to the new merge request page + And I can see the replacement commit message @javascript Scenario: I can create file in empty repo @@ -117,6 +162,14 @@ Feature: Project Source Browse Files And I click button "Edit" Then I can edit code + @javascript + Scenario: I can edit file when I don't have write access + Given I don't have write access + And I click on ".gitignore" file in repo + And I click button "Edit" + Then I should see a notice about a new fork having been created + And I can edit code + Scenario: If the file is binary the edit link is hidden Given I visit a binary file in the repo Then I cannot see the edit button @@ -131,6 +184,17 @@ Feature: Project Source Browse Files Then I am redirected to the ".gitignore" And I should see its new content + @javascript + Scenario: I can edit and commit file when I don't have write access + Given I don't have write access + And I click on ".gitignore" file in repo + And I click button "Edit" + And I edit code + And I fill the commit message + And I click on "Commit Changes" + Then I am redirected to the fork's new merge request page + And I can see the new commit message + @javascript Scenario: I can edit and commit file to new branch Given I click on ".gitignore" file in repo @@ -161,6 +225,17 @@ Feature: Project Source Browse Files And I click on "Create directory" Then I am redirected to the new merge request page + @javascript + Scenario: I can create directory in repo when I don't have write access + Given I don't have write access + When I click on "New directory" link in repo + Then I should see a notice about a new fork having been created + When I click on "New directory" link in repo + And I fill the new directory name + And I fill the commit message + And I click on "Create directory" + Then I am redirected to the fork's new merge request page + @javascript Scenario: I attempt to create an existing directory When I click on "New directory" link in repo @@ -188,6 +263,19 @@ Feature: Project Source Browse Files Then I am redirected to the files URL And I don't see the ".gitignore" + @javascript + Scenario: I can delete file and commit when I don't have write access + Given I don't have write access + And I click on ".gitignore" file in repo + And I see the ".gitignore" + And I click on "Delete" + Then I should see a notice about a new fork having been created + When I click on "Delete" + And I fill the commit message + And I click on "Delete file" + Then I am redirected to the fork's new merge request page + And I can see the new commit message + Scenario: I can browse directory with Browse Dir Given I click on files directory And I click on History link -- cgit v1.2.1 From cfa716ebe0f149fd3f152d90c4dcf32ea450b486 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 21 Dec 2015 12:14:09 +0100 Subject: Fix spec --- features/project/source/browse_files.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/project') diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature index 937db23d928..a8c276b949e 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -70,7 +70,7 @@ Feature: Project Source Browse Files And I fill the commit message And I fill the new branch name And I click on "Commit Changes" - Then I am redirected to the fork's new merge request page + Then I am redirected to the new merge request page And I should see its new content @javascript @@ -120,7 +120,7 @@ Feature: Project Source Browse Files And I fill the replace file commit message And I click on "Replace file" Then I can see the new text file - And I am redirected to the new merge request page + And I am redirected to the fork's new merge request page And I can see the replacement commit message @javascript -- cgit v1.2.1