Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_positive_documentation_links to test stage doc links #16884

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conf/robottelo.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ ROBOTTELO:
SETTINGS:
GET_FRESH: true
IGNORE_VALIDATION_ERRORS: false
# Stage docs url
STAGE_DOCS_URL: https://docs.redhat.com
1 change: 1 addition & 0 deletions robottelo/config/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
Validator('remotedb.port', default=5432),
],
robottelo=[
Validator('robottelo.stage_docs_url', default='https://docs.redhat.com'),
Validator('robottelo.settings.ignore_validation_errors', is_type_of=bool, default=False),
Validator('robottelo.rhel_source', default='ga', is_in=['ga', 'internal']),
Validator(
Expand Down
11 changes: 7 additions & 4 deletions tests/foreman/ui/test_documentation_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@


@pytest.mark.e2e
@pytest.mark.skipif(
(settings.server.version.release.split('.')[0:2] in settings.robottelo.sat_non_ga_versions),
reason="The test don't yet support verifying documentation links for non GA'ed Satellite release.",
)
def test_positive_documentation_links(target_sat):
"""Verify that Satellite documentation links are working.
Note: At the moment, the test doesn't support verifying links hidden behind a button.
Expand Down Expand Up @@ -67,6 +63,7 @@ def test_positive_documentation_links(target_sat):
'factvalue',
'dashboard',
]
sat_version = ".".join(target_sat.version.split('.')[0:2])
all_links = defaultdict(list)
pages_with_broken_links = defaultdict(list)
with target_sat.ui_session() as session:
Expand All @@ -86,6 +83,12 @@ def test_positive_documentation_links(target_sat):
)
for page in pages:
for link in all_links[page]:
# Test stage docs url for Non-GA'ed Satellite
if sat_version in settings.robottelo.sat_non_ga_versions:
link = link.replace(
'https://docs.redhat.com', settings.robottelo.stage_docs_url
)
link = link.replace('html', 'html-single')
if requests.get(link, verify=False).status_code != 200:
pages_with_broken_links[page].append(link)
logger.info(f"Following link on {page} page seems broken: \n {link}")
Expand Down
Loading