Commit 75984534 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Cleanup codes and address feedback

parent 578a98fb
module QA
module Factory
module Resource
class Pipeline < Factory::Base
end
end
end
end
module QA::Page
module Project::Job
class Show < QA::Page::Base
view 'app/views/projects/jobs/show.html.haml' do
element :build_output, '.js-build-output'
end
def output
css = '.js-build-output'
wait { has_css?(css) }
wait(reload: false) do
has_css?(css)
end
find(css).text
end
end
......
......@@ -6,13 +6,14 @@ module QA::Page
end
def go_to_latest_pipeline
first('.js-pipeline-url-link').click
end
css = '.js-pipeline-url-link'
link = nil
def wait_for_latest_pipeline
wait do
first('.js-pipeline-url-link')
wait(reload: false) do
link = first(css)
end
link.click
end
end
end
......
......@@ -11,6 +11,7 @@ module QA::Page
view 'app/assets/javascripts/pipelines/components/graph/job_component.vue' do
element :job_component, /class.*ci-job-component.*/
element :job_link, /class.*js-pipeline-graph-job-link.*/
end
view 'app/assets/javascripts/vue_shared/components/ci_icon.vue' do
......@@ -34,7 +35,7 @@ module QA::Page
def go_to_first_job
css = '.js-pipeline-graph-job-link'
wait do
wait(reload: false) do
has_css?(css)
end
......
......@@ -62,7 +62,7 @@ module QA
click_link(kind)
end
# Ensure git clone textbox was updated to http URI
# Ensure git clone textbox was updated
repository_location.include?(detect_text)
end
end
......
......@@ -48,10 +48,6 @@ module QA
'gitlab-runner run'
]
if @executor == 'docker'
commands.unshift('apt-get install -y docker-ce')
end
commands.join(' && ')
end
end
......
......@@ -8,7 +8,7 @@ module QA
Service::Runner.new(runner_name).remove!
end
scenario 'user pushes .gitlab-ci.yml to the repository' do
scenario 'user setup a deploy key and use it to pull from CI job' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -52,7 +52,7 @@ module QA
cat-config:
script:
- mkdir -p ~/.ssh
- ssh-keyscan -p #{repository_uri.port} #{repository_uri.host} >> ~/.ssh/known_hosts
- ssh-keyscan -p #{repository_uri.port || 22} #{repository_uri.host} >> ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$DEPLOY_KEY" | ssh-add -
- git clone #{repository_url}
......@@ -73,15 +73,8 @@ module QA
Page::Project::Show.act { wait_for_push }
Page::Menu::Side.act { click_ci_cd_pipelines }
Page::Project::Pipeline::Index.act do
wait_for_latest_pipeline
go_to_latest_pipeline
end
Page::Project::Pipeline::Show.act do
go_to_first_job
end
Page::Project::Pipeline::Index.act { go_to_latest_pipeline }
Page::Project::Pipeline::Show.act { go_to_first_job }
Page::Project::Job::Show.perform do |job|
expect(job.output).to include(sha1sum)
......
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