From 62f4ed6b6a50db03d816a152f4f527b98d52a72c Mon Sep 17 00:00:00 2001 From: Davy Duperron Date: Tue, 28 Jan 2020 22:26:26 +0100 Subject: [PATCH] feat(unit): add click test on animated target (#655) --- test/click.spec.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/click.spec.js b/test/click.spec.js index 39325b4876..f58a241a71 100644 --- a/test/click.spec.js +++ b/test/click.spec.js @@ -374,5 +374,35 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI await page.click('button'); expect(await page.evaluate('window.clicked')).toBe(true); }); + it.skip(true)('should click on an animated button', async({page}) => { + const buttonSize = 50; + const containerWidth = 500; + const transition = 500; + await page.setContent(` + + +
+ +
+ + + + `); + await page.click('button'); + expect(await page.evaluate('window.clicked')).toBe(1); + expect(await page.evaluate('document.querySelector("#button").style.left')).toBe(`${containerWidth - buttonSize}px`); + await new Promise(resolve => setTimeout(resolve, 500)); + await page.click('button'); + expect(await page.evaluate('window.clicked')).toBe(2); + expect(await page.evaluate('document.querySelector("#button").style.left')).toBe('0px'); + }); }); };