mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: fix android test failure (#6487)
This commit is contained in:
parent
f1a888de02
commit
00ec43974d
@ -108,6 +108,29 @@ it('should click the button with offset with page scale', async ({browser, serve
|
||||
await context.close();
|
||||
});
|
||||
|
||||
it('should return bounding box with page scale', async ({ browser, server, browserName }) => {
|
||||
it.skip(browserName === 'firefox');
|
||||
|
||||
const context = await browser.newContext({ viewport: { width: 400, height: 400 }, isMobile: true });
|
||||
const page = await context.newPage();
|
||||
await page.goto(server.PREFIX + '/input/button.html');
|
||||
const button = await page.$('button');
|
||||
await button.evaluate(button => {
|
||||
document.body.style.margin = '0';
|
||||
button.style.borderWidth = '0';
|
||||
button.style.width = '200px';
|
||||
button.style.height = '20px';
|
||||
button.style.marginLeft = '17px';
|
||||
button.style.marginTop = '23px';
|
||||
});
|
||||
const box = await button.boundingBox();
|
||||
expect(Math.round(box.x * 100)).toBe(17 * 100);
|
||||
expect(Math.round(box.y * 100)).toBe(23 * 100);
|
||||
expect(Math.round(box.width * 100)).toBe(200 * 100);
|
||||
expect(Math.round(box.height * 100)).toBe(20 * 100);
|
||||
await context.close();
|
||||
});
|
||||
|
||||
it('should not leak listeners during navigation of 20 pages', async ({contextFactory, server}) => {
|
||||
it.slow('We open 20 pages here!');
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { test as it, expect } from './pageTest';
|
||||
import { browserTest } from '../config/browserTest';
|
||||
|
||||
it.skip(({ isAndroid }) => isAndroid);
|
||||
|
||||
@ -88,29 +87,6 @@ it('should work with SVG nodes', async ({ page, server }) => {
|
||||
expect(pwBoundingBox).toEqual(webBoundingBox);
|
||||
});
|
||||
|
||||
browserTest('should work with page scale', async ({ browser, server, browserName }) => {
|
||||
browserTest.skip(browserName === 'firefox');
|
||||
|
||||
const context = await browser.newContext({ viewport: { width: 400, height: 400 }, isMobile: true });
|
||||
const page = await context.newPage();
|
||||
await page.goto(server.PREFIX + '/input/button.html');
|
||||
const button = await page.$('button');
|
||||
await button.evaluate(button => {
|
||||
document.body.style.margin = '0';
|
||||
button.style.borderWidth = '0';
|
||||
button.style.width = '200px';
|
||||
button.style.height = '20px';
|
||||
button.style.marginLeft = '17px';
|
||||
button.style.marginTop = '23px';
|
||||
});
|
||||
const box = await button.boundingBox();
|
||||
expect(Math.round(box.x * 100)).toBe(17 * 100);
|
||||
expect(Math.round(box.y * 100)).toBe(23 * 100);
|
||||
expect(Math.round(box.width * 100)).toBe(200 * 100);
|
||||
expect(Math.round(box.height * 100)).toBe(20 * 100);
|
||||
await context.close();
|
||||
});
|
||||
|
||||
it('should work when inline box child is outside of viewport', async ({ page, server }) => {
|
||||
await page.setContent(`
|
||||
<style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user