Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new test suite for the Higher Education and bookstore pages in the OpenStax web application. The changes introduce new page object methods to support testing the HE and bookstore page functionality, along with two comprehensive test cases that verify critical bookstore features work across both staging and production environments.
Changes:
- Added 12 new page object properties and 2 new async methods to the
HomeRexclass for interacting with HE and bookstore page elements - Added test file
test_osweb_higher_education_page.pywith two test functions: one for the HE page and one for the bookstore page - Tests validate page navigation, element visibility, and form functionality including multi-tab form submission
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
e2e_tests/e2e/ui/pages/home.py |
Added page object methods and properties for Higher Education and bookstore page interactions |
e2e_tests/e2e/osweb/test_osweb_higher_education_page.py |
New test file with two test functions validating HE page and bookstore functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # THEN: Bookstore page elements are visible/enabled in both staging and prod envs | ||
| assert await home.higher_education_bookstore_order_access_code.is_enabled() | ||
| assert await home.higher_education_bookstore_view_print_options.first.is_enabled() | ||
| assert await home.obtain_access_codes_via_vitalsource.is_visible() | ||
| assert await home.obtain_access_codes_via_openstax.is_visible() | ||
| assert await home.know_before_your_order_columns.is_visible() | ||
| assert await home.higher_education_bookstore_view_print_options.last.is_enabled() | ||
| assert await home.access_pdf.is_enabled() |
There was a problem hiding this comment.
Link elements (HTML <a> tags) do not have an "enabled" state. The .is_enabled() method is designed for form controls like buttons and inputs. For links, use .is_visible() or .is_clickable() instead. This applies to lines 49, 50, 55, and 54 which all call .is_enabled() on link elements.
| # THEN: Bookstore page elements are visible/enabled in both staging and prod envs | |
| assert await home.higher_education_bookstore_order_access_code.is_enabled() | |
| assert await home.higher_education_bookstore_view_print_options.first.is_enabled() | |
| assert await home.obtain_access_codes_via_vitalsource.is_visible() | |
| assert await home.obtain_access_codes_via_openstax.is_visible() | |
| assert await home.know_before_your_order_columns.is_visible() | |
| assert await home.higher_education_bookstore_view_print_options.last.is_enabled() | |
| assert await home.access_pdf.is_enabled() | |
| # THEN: Bookstore page elements are visible in both staging and prod envs | |
| assert await home.higher_education_bookstore_order_access_code.is_visible() | |
| assert await home.higher_education_bookstore_view_print_options.first.is_visible() | |
| assert await home.obtain_access_codes_via_vitalsource.is_visible() | |
| assert await home.obtain_access_codes_via_openstax.is_visible() | |
| assert await home.know_before_your_order_columns.is_visible() | |
| assert await home.higher_education_bookstore_view_print_options.last.is_visible() | |
| assert await home.access_pdf.is_visible() |
TomWoodward
left a comment
There was a problem hiding this comment.
this is ok to merge, but you should consider:
you're putting osweb tests in the rex repo. the rex repo only serves the reading pages, so they're a little out of place here. i understand that its probably easier to have just the one test suite for all the automated tests, but its still a little weird
this page is manged by the CMS, and all the assertions that you have are likely to become broken as the team optimizes the content of the page to communicate what it needs to communicate. these style of tests for CMS pages are going to be very brittle and need frequent updating
https://openstax.atlassian.net/browse/CORE-988