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

Drop static page list fallback #37

Merged
merged 1 commit into from
Jan 23, 2024
Merged
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
48 changes: 5 additions & 43 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,6 @@

User = namedtuple('User', ['username', 'password', 'name'])

PAGES = [
'/',
'/architectures',
'/hosts',
'/models',
'/media',
'/operatingsystems',
'/templates/ptables',
'/templates/provisioning_templates',
'/hostgroups',
'/common_parameters',
'/environments',
'/puppetclasses',
'/config_groups',
'/variable_lookup_keys',
'/puppetclass_lookup_keys',
'/smart_proxies',
'/compute_resources',
'/compute_profiles',
'/subnets',
'/domains',
'/http_proxies',
'/realms',
'/locations',
'/organizations',
'/auth_source_ldaps',
'/users',
'/usergroups',
'/roles',
'/bookmarks',
'/settings',
'/about',
]


def pytest_generate_tests(metafunc):
variables = metafunc.config._variables # pylint: disable=protected-access
Expand All @@ -54,15 +20,11 @@ def pytest_generate_tests(metafunc):

response = requests.get(f'{base_url}/menu', auth=(user_obj.username, user_obj.password),
verify=False)
if response.status_code == 404:
# Menu is only available since Foreman 2.0
pages = [base_url + page for page in PAGES]
else:
assert response
pages = [pytest.param(base_url + page['url'], id=page['name'])
for page in response.json()
# logout has an error "Cannot read property 'icon' of null"
if page['url'] != '/users/logout']
assert response
pages = [pytest.param(base_url + page['url'], id=page['name'])
for page in response.json()
# logout has an error "Cannot read property 'icon' of null"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that still true?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I literally removed the line at first and then thought this was already big enough of a change that I didn't want to dig further to see when it was fixed (if at all).

if page['url'] != '/users/logout']

metafunc.parametrize('url', pages)

Expand Down