-
Notifications
You must be signed in to change notification settings - Fork 1
changes to highlights tests as per latest fixes #2765
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
Conversation
e2e_tests/e2e/ui/pages/home.py
Outdated
| await self.page.locator( | ||
| "p:has-text('formula. Repeat with values')" | ||
| ).select_text() | ||
| await self.page.locator("#fs-id1165134108431").select_text() |
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 method name in home.py is too generic for what it does which is selecting a specific element in a specific page of a specific book...
However, it would probably be an acceptable name if you just moved the method to the one test file that uses it, which is test_highlight_in_show_hide_solution.py
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.
fixed
e2e_tests/e2e/ui/pages/home.py
Outdated
| await self.page.locator("#fs-id1165134108429").get_by_title( | ||
| "Show/Hide Solution" | ||
| await self.page.locator( | ||
| '#fs-id1165134108429[aria-label="Show/Hide Solution"]' |
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.
Same thing here
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 I keep as is as there are 9 uses of this
.github/workflows/playwright.yml
Outdated
| python-version: '3.11' | ||
| cache: 'pip' # caching pip dependencies | ||
| - run: python -m pip install --upgrade pip | ||
| - run: pip install pytest-playwright |
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 already added this package to e2e_tests/requirements.txt so this line shouldn't be needed, it should install in the line below.
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.
Fixed
| async def clear_all_blockers(self): | ||
| await self.page.evaluate( | ||
| """() => { | ||
| document.querySelectorAll('div[class*="ClickBlocker"]').forEach(el => el.remove()); |
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.
Well my concern with removing it this way instead of clicking the X button is that you could leave other junk related to the modal around, which may interfere with tests in the future.
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 leave it for now but revisit it again
| await home.click_show_hide_solution_link() | ||
|
|
||
| await home.click_text_in_solution_block() | ||
| await home.clear_all_blockers() |
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 the blocker is not related to clicking the solution link, it's related to loading the page, but maybe it has a delay, so I worry that this is flaky.
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 leave this as well for now and see how it goes
https://openstax.atlassian.net/browse/CORE-988