Commit e4e40b96 authored by Dan Davison's avatar Dan Davison

Merge branch 'ml-qa-push-private-token' into 'master'

Add e2e test to push using a private token

See merge request gitlab-org/gitlab-ce!22628
parents f1f8548f abf3a2d2
......@@ -45,7 +45,7 @@ module QA
repository.use_ssh_key(ssh_key)
else
repository.uri = repository_http_uri
repository.use_default_credentials
repository.use_default_credentials unless user
end
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