Commit abf3a2d2 authored by Mark Lapierre's avatar Mark Lapierre

Add e2e test to push using a private token

Tests pushing over HTTP(S) using a personal access token
parent 48e61c6c
...@@ -45,7 +45,7 @@ module QA ...@@ -45,7 +45,7 @@ module QA
repository.use_ssh_key(ssh_key) repository.use_ssh_key(ssh_key)
else else
repository.uri = repository_http_uri repository.uri = repository_http_uri
repository.use_default_credentials repository.use_default_credentials unless user
end end
username = 'GitLab QA' username = 'GitLab QA'
......
# frozen_string_literal: true
module QA
context 'Create' do
describe 'Git push over HTTP', :ldap_no_tls do
it 'user using a personal access token pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
access_token = Factory::Resource::PersonalAccessToken.fabricate!.access_token
user = Factory::Resource::User.new.tap do |user|
user.username = Runtime::User.username
user.password = access_token
end
push = Factory::Repository::ProjectPush.fabricate! do |push|
push.user = user
push.file_name = 'README.md'
push.file_content = '# This is a test project'
push.commit_message = 'Add README.md'
end
push.project.visit!
Page::Project::Show.perform(&:wait_for_push)
expect(page).to have_content('README.md')
expect(page).to have_content('This is a test project')
end
end
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