Skip to content

adjustments to highlight tests as per current deploy#2786

Draft
omehes wants to merge 6 commits intomainfrom
newchanges
Draft

adjustments to highlight tests as per current deploy#2786
omehes wants to merge 6 commits intomainfrom
newchanges

Conversation

@omehes
Copy link
Contributor

@omehes omehes commented Feb 24, 2026

@omehes omehes requested a review from a team as a code owner February 24, 2026 15:09
@omehes omehes requested a review from TomWoodward February 24, 2026 15:09
@TomWoodward TomWoodward temporarily deployed to rex-web-newchanges-ftxqhklgvwk February 24, 2026 15:10 Inactive
@omehes omehes requested a review from Copilot February 24, 2026 15:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 HomeRex helpers; 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.

Comment on lines +39 to +48
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

Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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:

Copilot uses AI. Check for mistakes.
# 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
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
assert home.highlight_box_is_visible
assert await home.highlight_box_is_visible()

Copilot uses AI. Check for mistakes.
# 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
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
assert home.highlight_box_is_visible
assert await home.highlight_box_is_visible()

Copilot uses AI. Check for mistakes.
@@ -191,8 +191,8 @@ async def test_highlight_unsaved_confirmation_on_small_highlight_dialog(

assert home.small_highlighted_note_box_is_visible
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
assert home.small_highlighted_note_box_is_visible
assert await home.small_highlighted_note_box_is_visible()

Copilot uses AI. Check for mistakes.
@TomWoodward TomWoodward had a problem deploying to rex-web-newchanges-ftxqhklgvwk February 24, 2026 17:01 Failure
@TomWoodward TomWoodward temporarily deployed to rex-web-newchanges-ftxqhklgvwk February 24, 2026 19:28 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-newchanges-ftxqhklgvwk February 24, 2026 19:53 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-newchanges-ftxqhklgvwk February 25, 2026 18:09 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-newchanges-ftxqhklgvwk February 25, 2026 20:46 Inactive
@omehes omehes marked this pull request as draft March 19, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants