adjustments to highlight tests as per current deploy#2786
adjustments to highlight tests as per current deploy#2786
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Playwright E2E highlight-related tests to align with current deployed UI behavior (CORE-988), including changing the interaction for opening the highlight edit box and adding coverage for OpenStax homepage links.
Changes:
- Re-enabled and adjusted highlight/login dialog assertions and flows.
- Updated multiple highlight tests to open the highlight edit box via keyboard (
Enter) and removed the old infobox-click helper. - Added new OSWeb homepage link navigation tests and supporting
HomeRexhelpers; updated a highlight-note edit locator.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| e2e_tests/e2e/ui/test_login_to_highlight_dialog.py | Re-enables small login dialog cancel flow and continues highlight flow with Enter. |
| e2e_tests/e2e/ui/test_highlights_page_edit_note.py | Switches highlight edit-box open action; edits note via highlights panel. |
| e2e_tests/e2e/ui/test_highlight_unsaved_confirmation_dialog.py | Switches highlight edit-box open action to Enter in unsaved-confirmation dialog coverage. |
| e2e_tests/e2e/ui/test_highlight_unsaved_confirmation.py | Switches highlight edit-box open action to Enter across multiple navigation scenarios. |
| e2e_tests/e2e/ui/test_highlight_in_show_hide_solution.py | Updates solution-dropdown highlight flows to use keyboard navigation/Enter. |
| e2e_tests/e2e/ui/test_highlight_editbox.py | Updates editbox-open interaction from click to Enter. |
| e2e_tests/e2e/ui/test_highlight_box_save_note.py | Updates editbox-open interaction and wraps long comment lines. |
| e2e_tests/e2e/ui/test_highlight_box_delete_note.py | Updates editbox-open interaction from click to Enter. |
| e2e_tests/e2e/ui/test_book_opens.py | Closes chrome_page at end of content-portal test. |
| e2e_tests/e2e/ui/pages/home.py | Adds OSWeb helpers, updates edit-note textarea selector, removes oneclick_highlight_infobox. |
| e2e_tests/e2e/osweb/test_osweb_homepage_links.py | New OSWeb navigation tests (“I’m interested!” and “Try OpenStax Assignable”). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if "staging" in chrome_page.url: | ||
| await home.click_try_assignable_link() | ||
|
|
||
| assert "assignable" in chrome_page.url | ||
|
|
||
| else: | ||
| await home.click_try_assignable_link() | ||
|
|
||
| assert "assignable" in chrome_page.url | ||
|
|
There was a problem hiding this comment.
The if "staging" in chrome_page.url block duplicates the same click + URL assertion in both branches; only the book-count assertion is environment-specific. This can be simplified to always click/assert the URL, then conditionally assert the book list only when not staging to reduce duplication and future drift.
| if "staging" in chrome_page.url: | |
| await home.click_try_assignable_link() | |
| assert "assignable" in chrome_page.url | |
| else: | |
| await home.click_try_assignable_link() | |
| assert "assignable" in chrome_page.url | |
| await home.click_try_assignable_link() | |
| assert "assignable" in chrome_page.url | |
| if "staging" not in chrome_page.url: |
| # THEN: Highlight infobox can be open by pressing Enter key only (as of Feb. 23, 2026) | ||
| await chrome_page.keyboard.press("Enter") | ||
|
|
||
| assert home.highlight_box_is_visible |
There was a problem hiding this comment.
home.highlight_box_is_visible is an async method on HomeRex, but here it’s asserted as a truthy function object (missing await and ()). This assertion will always pass even if the highlight box is not visible. Call and await the method so the test actually checks visibility.
| assert home.highlight_box_is_visible | |
| assert await home.highlight_box_is_visible() |
| # THEN: Highlight infobox can be open by pressing Enter key only (as of Feb. 23, 2026) | ||
| await chrome_page.keyboard.press("Enter") | ||
|
|
||
| assert home.highlight_box_is_visible |
There was a problem hiding this comment.
home.highlight_box_is_visible is an async method, but it’s being asserted without calling/awaiting it. This makes the test pass regardless of UI state. Update this assertion to call the method and await the result.
| assert home.highlight_box_is_visible | |
| assert await home.highlight_box_is_visible() |
| @@ -191,8 +191,8 @@ async def test_highlight_unsaved_confirmation_on_small_highlight_dialog( | |||
|
|
|||
| assert home.small_highlighted_note_box_is_visible | |||
There was a problem hiding this comment.
home.small_highlighted_note_box_is_visible is an async method on HomeRex, but it’s asserted as a function object (missing await and ()). This assertion will always be truthy and won’t validate the UI. Call the method and await its boolean result.
| assert home.small_highlighted_note_box_is_visible | |
| assert await home.small_highlighted_note_box_is_visible() |
https://openstax.atlassian.net/browse/CORE-988