Commit 7cf4dfe2 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'minor-improvements-on-create-e2e-tests' into 'master'

Minor improvements on e2e tests from the DevOps Create stage

See merge request gitlab-org/gitlab!25902
parents 09233b18 0c8dba90
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
it 'user rebases source branch of merge request' do it 'user rebases source branch of merge request' do
Flow::Login.sign_in Flow::Login.sign_in
project = Resource::Project.fabricate! do |project| project = Resource::Project.fabricate_via_api! do |project|
project.name = "only-fast-forward" project.name = "only-fast-forward"
end end
project.visit! project.visit!
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
it 'user squashes commits while merging' do it 'user squashes commits while merging' do
Flow::Login.sign_in Flow::Login.sign_in
project = Resource::Project.fabricate! do |project| project = Resource::Project.fabricate_via_api! do |project|
project.name = "squash-before-merge" project.name = "squash-before-merge"
end end
......
...@@ -18,7 +18,7 @@ module QA ...@@ -18,7 +18,7 @@ module QA
before do before do
Flow::Login.sign_in Flow::Login.sign_in
project = Resource::Project.fabricate! do |proj| project = Resource::Project.fabricate_via_api! do |proj|
proj.name = 'project-qa-test' proj.name = 'project-qa-test'
proj.description = 'project for qa test' proj.description = 'project for qa test'
end end
......
...@@ -8,7 +8,7 @@ module QA ...@@ -8,7 +8,7 @@ module QA
Flow::Login.sign_in Flow::Login.sign_in
# Create a project to push to # Create a project to push to
project = Resource::Project.fabricate! do |project| project = Resource::Project.fabricate_via_api! do |project|
project.name = 'git-protocol-project' project.name = 'git-protocol-project'
end end
......
...@@ -34,7 +34,7 @@ module QA ...@@ -34,7 +34,7 @@ module QA
it 'user pushes to the repository' do it 'user pushes to the repository' do
# Create a project to push to # Create a project to push to
project = Resource::Project.fabricate! do |project| project = Resource::Project.fabricate_via_api! do |project|
project.name = 'git-protocol-project' project.name = 'git-protocol-project'
end end
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)
target_project = Resource::Project.fabricate! do |project| target_project = Resource::Project.fabricate_via_api! do |project|
project.name = 'push-mirror-target-project' project.name = 'push-mirror-target-project'
end end
target_project_uri = target_project.repository_http_location.uri target_project_uri = target_project.repository_http_location.uri
......
...@@ -6,12 +6,11 @@ module QA ...@@ -6,12 +6,11 @@ module QA
it 'user pushes code to the repository' do it 'user pushes code to the repository' do
Flow::Login.sign_in Flow::Login.sign_in
project_push = Resource::Repository::ProjectPush.fabricate! do |push| Resource::Repository::ProjectPush.fabricate! do |push|
push.file_name = 'README.md' push.file_name = 'README.md'
push.file_content = '# This is a test project' push.file_content = '# This is a test project'
push.commit_message = 'Add README.md' push.commit_message = 'Add README.md'
end end.project.visit!
project_push.project.visit!
expect(page).to have_content('README.md') expect(page).to have_content('README.md')
expect(page).to have_content('This is a test project') expect(page).to have_content('This is a test project')
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
let(:branch_name) { 'protected-branch' } let(:branch_name) { 'protected-branch' }
let(:commit_message) { 'Protected push commit message' } let(:commit_message) { 'Protected push commit message' }
let(:project) do let(:project) do
Resource::Project.fabricate! do |resource| Resource::Project.fabricate_via_api! do |resource|
resource.name = 'protected-branch-project' resource.name = 'protected-branch-project'
resource.initialize_with_readme = true resource.initialize_with_readme = true
end end
......
...@@ -15,14 +15,12 @@ module QA ...@@ -15,14 +15,12 @@ module QA
resource.title = key_title resource.title = key_title
end end
project_push = Resource::Repository::ProjectPush.fabricate! do |push| Resource::Repository::ProjectPush.fabricate! do |push|
push.ssh_key = key push.ssh_key = key
push.file_name = 'README.md' push.file_name = 'README.md'
push.file_content = '# Test Use SSH Key' push.file_content = '# Test Use SSH Key'
push.commit_message = 'Add README.md' push.commit_message = 'Add README.md'
end end.project.visit!
project_push.project.visit!
expect(page).to have_content('README.md') expect(page).to have_content('README.md')
expect(page).to have_content('Test Use SSH Key') expect(page).to have_content('Test Use SSH Key')
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
it 'user creates, edits, clones, and pushes to the wiki' do it 'user creates, edits, clones, and pushes to the wiki' do
Flow::Login.sign_in Flow::Login.sign_in
wiki = Resource::Wiki.fabricate! do |resource| wiki = Resource::Wiki.fabricate_via_browser_ui! do |resource|
resource.title = 'Home' resource.title = 'Home'
resource.content = '# My First Wiki Content' resource.content = '# My First Wiki Content'
resource.message = 'Update home' resource.message = 'Update home'
......
...@@ -23,7 +23,7 @@ module QA ...@@ -23,7 +23,7 @@ module QA
@user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) @user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
@user2 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2) @user2 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2)
@project = Resource::Project.fabricate! do |project| @project = Resource::Project.fabricate_via_api! do |project|
project.name = "codeowners" project.name = "codeowners"
end end
@project.visit! @project.visit!
......
...@@ -35,7 +35,7 @@ module QA ...@@ -35,7 +35,7 @@ module QA
context 'when only one user is allowed to merge and push to a protected branch' do context 'when only one user is allowed to merge and push to a protected branch' do
let(:project) do let(:project) do
Resource::Project.fabricate! do |resource| Resource::Project.fabricate_via_api! do |resource|
resource.name = 'user-with-access-to-protected-branch' resource.name = 'user-with-access-to-protected-branch'
resource.initialize_with_readme = true resource.initialize_with_readme = true
end end
...@@ -69,7 +69,7 @@ module QA ...@@ -69,7 +69,7 @@ module QA
end end
end end
let(:project) do let(:project) do
Resource::Project.fabricate! do |resource| Resource::Project.fabricate_via_api! do |resource|
resource.name = 'group-with-access-to-protected-branch' resource.name = 'group-with-access-to-protected-branch'
resource.initialize_with_readme = true resource.initialize_with_readme = true
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment