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