-
Notifications
You must be signed in to change notification settings - Fork 1
amending highlight tests as per upcoming changes and fixes #2583
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates end-to-end highlight tests to align with upcoming UI changes related to the highlight workflow (CORE-988). The changes introduce a new two-step highlight creation flow where an infobox appears first, requiring Enter key press or one-click to open the full highlight box.
Key Changes:
- Introduces a new highlight infobox interaction step requiring Enter key press or click to open the full highlight box
- Updates page object locators from string-based to proper CSS selector format (
"id=foo"→"#foo") - Adds new test methods for small login dialog and highlight box interactions
- Disables several tests in
test_book.pyby removing thetest_prefix
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
test_login_to_highlight_dialog.py |
New test verifying login dialog behavior when attempting to highlight without authentication |
test_highlight_infobox.py |
New test suite for highlight infobox dismiss and interaction behaviors |
test_highlights_page_edit_note.py |
Added Enter key press to accommodate new highlight flow |
test_highlight_unsaved_confirmation_dialog.py |
Updated to new highlight flow, improved formatting, changed search interaction from Enter to magnifier icon |
test_highlight_unsaved_confirmation.py |
Updated existing tests for new highlight flow, added new test for small highlight dialog unsaved confirmation |
test_highlight_in_show_hide_solution.py |
Updated to handle highlight infobox step before accessing highlight box |
test_highlight_box_save_note.py |
Added Enter key press and updated overlapping highlights test flow |
test_highlight_box_delete_note.py |
Renamed function, removed unused import, updated to new highlight flow |
test_highlight_box.py |
Renamed multiple tests to better reflect behavior, updated to use new highlight infobox flow |
test_book.py |
Disabled 5 tests by removing test_ prefix from function names |
pages/home.py |
Updated locators to proper CSS format, added methods for small login box, highlight infobox, and search magnifier icon |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @pytest.mark.asyncio | ||
| async def click_show_hide_solution_link(self): | ||
| await self.page.locator("id=fs-id1165134108429").get_by_title( | ||
| await self.page.locator("#fs-id1165134108429").get_by_title( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these ids are book page-specific, it's probably not great to rely on them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I need a book/page/text block specific element within the solution box as per the aim of the test and this is the best I was able to come up... targetting this text block with this id
playwright/e2e/ui/test_book.py
Outdated
| ) | ||
| @pytest.mark.asyncio | ||
| async def test_accessibility_help(chrome_page, base_url, book_slug, page_slug): | ||
| async def est_accessibility_help(chrome_page, base_url, book_slug, page_slug): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what's happening with these method names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah... this is a "grammar" error...
|
|
||
| # Adjusting the test until the expected behaviour is implemented for click other non-highlighted | ||
| # text (to avoid test fails) | ||
| # assert not await home.highlight_infobox.is_visible() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could probably just have it click the ToC, that should close the box.
But is this working as intended in prod? Clicking elsewhere closes the note box, but not the login box or the "press enter" box.
If it still randomly fails when clicking the ToC, it's also possible there's some flakiness here because of using .is_visible() instead of expect(locator).not_to_be_visible() as mentioned in the warning box in https://playwright.dev/python/docs/api/class-locator#locator-is-visible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is (and other test) waiting for fix. I added them but have to readjust them once Roy fixes these 3 issues...
https://openstax.atlassian.net/browse/CORE-988