Skip to content

Commit 343502d

Browse files
authored
chore: roll driver to 1.33.0 (#1271)
1 parent 83837af commit 343502d

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

playwright/src/test/java/com/microsoft/playwright/TestClick.java

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,12 @@ void shouldClickAButtonInScrollingContainerWithOffset() {
405405
assertEquals(isWebKit() ? 1910 + 8 : 1910, page.evaluate("offsetY"));
406406
}
407407

408+
private static void expectCloseTo(double expected, double actual) {
409+
if (Math.abs(expected - actual) > 2)
410+
fail("Expected: " + expected + ", received: " + actual);
411+
}
412+
413+
408414
@Test
409415
@DisabledIf(value="com.microsoft.playwright.TestBase#isFirefox", disabledReason="skip")
410416
void shouldClickTheButtonWithOffsetWithPageScale() {
@@ -419,28 +425,10 @@ void shouldClickTheButtonWithOffsetWithPageScale() {
419425
"}");
420426
page.click("button", new Page.ClickOptions().setPosition(20, 10));
421427
assertEquals("Clicked", page.evaluate("result"));
422-
// 20;10 + 8px of border in each direction
423-
int expectedX = 28;
424-
int expectedY = 18;
425-
426-
if (isWebKit()) {
427-
// WebKit for macOS 12 has different expectations starting r1829.
428-
if (isMac && Utils.osVersion() < 12) {
429-
// WebKit rounds up during css -> dip -> css conversion.
430-
expectedX = 26;
431-
expectedY = 17;
432-
} else {
433-
expectedX = 29;
434-
expectedY = 19;
435-
}
436-
} else if (isChromium() && !headful) {
437-
// Headless Chromium rounds down during css -> dip -> css conversion.
438-
expectedX = 27;
439-
expectedY = 18;
440-
}
441-
442-
assertEquals(expectedX, Math.round((Integer) page.evaluate("pageX") + 0.01));
443-
assertEquals(expectedY, Math.round((Integer) page.evaluate("pageY") + 0.01));
428+
// Expect 20;10 + 8px of border in each direction. Allow some delta as different
429+
// browsers round up or down differently during css -> dip -> css conversion.
430+
expectCloseTo(28, (Integer) page.evaluate("pageX"));
431+
expectCloseTo(18, (Integer) page.evaluate("pageY"));
444432
context.close();
445433
}
446434

scripts/CLI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.33.0-beta-1682447195000
1+
1.33.0

0 commit comments

Comments
 (0)