You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: Cannot create a screenshot of a hover state in e2e test #3188
This issue is related to #3145
When I add captureBeyondViewport: false to the createPuppeteerScreenshopOptions in node_modules/@stencil/core/testing/index.js the screenshot does not change the hover state of the component (it is still red).
👋 Thanks for the reproduction case, they greatly help looking at issues! I took a look, and there seems to be a timing issue of sorts here. I can reproduce the issue, but only some of the time (with a machine that has very similar specs to your's). I'm going to label this issue to get it ingested into our internal backlog for the team to take a further look.
For what it's worth, I had a harder time reproducing this when I made the following change to my-component.e2e.ts:
Activity
rwaskiewicz commentedon Dec 16, 2021
👋 Thanks for the reproduction case, they greatly help looking at issues! I took a look, and there seems to be a timing issue of sorts here. I can reproduce the issue, but only some of the time (with a machine that has very similar specs to your's). I'm going to label this issue to get it ingested into our internal backlog for the team to take a further look.
For what it's worth, I had a harder time reproducing this when I made the following change to
my-component.e2e.ts:it('has a hover state', async () => { const page = await newE2EPage(); await page.setContent('<my-component></my-component>'); await page.hover('my-component') - await page.waitForTimeout(1000) const results = await page.compareScreenshot() await page.waitForTimeout(3000) expect(results).toMatchScreenshot() });But I understand this is just your reproduction case and is probably simpler than the one you're working in (and that 'fix' may not apply)
johnjenkins commentedon Dec 16, 2021
I managed to monkey patch the screenshot method
When I setup my tests. That fixes it for me
borisdiakur commentedon Jan 3, 2022
Thank you @johnjenkins 🙏
I can confirm that the monkey patch helps fixing the issue.
ryuran commentedon Jan 7, 2022
Thanks @johnjenkins it unlocks my team.
Typescript version we use:
tanner-reits commentedon Jun 26, 2024
This was included in today's v4.19.0 release!
chore(deps): update dependency @stencil/core to v4.19.0 (#29666)