mraible commented on code in PR #230:
URL: https://github.com/apache/roller/pull/230#discussion_r4424219447
##########
it-playwright/src/test/java/org/apache/roller/playwright/BaseIT.java:
##########
@@ -349,11 +350,19 @@ protected void insertMediaFileThroughDialog(String
weblogHandle) {
* stacked form rows.
*/
protected void assertPublishingTimeOnOneLine() {
+ // Wait for the collapse animation to end, then read all three
positions
+ // in one pass so the panel or page cannot move between readings.
+ page.evaluate("() =>
document.querySelector('#collapseAdvanced').addEventListener('shown.bs.collapse',"
+ + " () => window.rollerAdvancedShown = true, {once: true})");
page.locator("a[href='#collapseAdvanced']").click();
+ page.waitForFunction("() => window.rollerAdvancedShown === true");
assertThat(page.locator("#collapseAdvanced")).isVisible();
- double hours =
page.locator("select[name='bean.hours']").boundingBox().y;
- double minutes =
page.locator("select[name='bean.minutes']").boundingBox().y;
- double seconds =
page.locator("select[name='bean.seconds']").boundingBox().y;
+ @SuppressWarnings("unchecked")
+ List<Number> tops = (List<Number>) page.evaluate("() => ['hours',
'minutes', 'seconds'].map(n =>"
Review Comment:
Non-blocking: `getBoundingClientRect()` returns a top of 0 for an element
that isn't rendered, so if the selects were ever hidden, all three would read 0
and the check would pass. The old `boundingBox()` returned null and failed. An
`assertThat(page.locator("select[name='bean.hours']")).isVisible()` (and the
same for minutes and seconds) before measuring would keep that guard, and it
names the missing select if one is renamed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]