Read about our upcoming Code of Conduct on this issue

Commit 82b5d9a1 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

New selenium test case for pipeline pages.

This reproduces the problems encountered with the Mercurial
native mode, see hgitaly#23.
parent 70751a6b612a
Pipeline #13410 waiting for manual action with stages
in 26 seconds
from .utils.hg import LocalRepo
from .utils.runner import Runner
from import WebDriverWait
def test_register_grab_job(test_project, tmpdir):
......@@ -53,3 +54,34 @@ def test_register_grab_job(test_project, tmpdir):
resp = runner.api_get()
assert resp.status_code == 404
def test_pipeline_pages(test_project, tmpdir):
with Runner.api_register(test_project, 'test_register') as runner:
# push something and grab a job
repo_path = tmpdir.join('repo1')
repo = LocalRepo.init(repo_path)
# let's not depend on auto-devops
repo.init_gitlab_ci(message="With .gitlab-ci.yml")
repo.hg('push', '-r', ".", '--publish',
job = runner.wait_assert_one_job()
# find the pipeline id in job payload
job_vars = {var['key']: var['value'] for var in job['variables']}
pipeline_id = int(job_vars['CI_PIPELINE_ID'])
# visit pipeline list and page
webdriver = test_project.owner_webdriver
webdriver.get(test_project.url + '/-/pipelines')
wait = WebDriverWait(webdriver, 10)
span = wait.until(lambda d: d.find_element_by_css_selector(
assert span.text.strip() == '#%d' % pipeline_id
webdriver = test_project.owner_webdriver
webdriver.get(test_project.url + '/-/pipelines/%s' % pipeline_id)
assert '(500)' not in webdriver.title
assert '(503)' not in webdriver.title
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