Take a screenshots from multiple elemets from a list of elements inside a testcase.
(I also tryed to seperate each screenshot taken to a single testcase and disabled the 'Use hardware acceleration' of chrome, doesn't work anyway)
Just fyi:
In general I use TestCaf茅 in combination with looksSame(compare images) to provide screenshot/visual regression - tests with advanced user actions (provided by TestCaf茅)
Nearly half of the screenshots taken with the testcase below are empty/blank (see screenshots)
_It look's like the runner hides the viewport before taking the screenshot, you can reproduce this by running the testcase below in a real browser instead of headless._
All screenshots should display their corresponding element.
This page provides a matching example case:
www.lottohelden.de/gewinnwahrscheinlichkeiten/lotterien/
Test code:
const baseUrl = 'www.lottohelden.de'
fixture(`Run Screenshots for VR-Tests: ${baseUrl}`)
.page(`${baseUrl}`)
.beforeEach( async t => {
await t
.wait(2500)
.resizeWindow(1920, 1080)
})
test.page(`${baseUrl}/gewinnwahrscheinlichkeiten/lotterien/`)
('screenshot desktop tabels', async t => {
const oddsPanelList = Selector('.current-odds-chance');
const count = await oddsPanelList.count
for(let counter = 0; counter < count; counter++) {
await t
.wait(3000)
.takeElementScreenshot(oddsPanelList.nth(counter), `desktop-table${counter}.png`)
}
})
Generated screenshots from the testcase above:
how it should be:

where it all starts:

the issue:

@ParachuteCat,
Thank you for your detailed description. I've reproduced this issue. Our team will research it and find a suitable solution, if any.
I believe I'm seeing the same problem, running [email protected] latest release.. I don't think this fix has been included in a new release yet.. can you please explain how to run with this new version to see if it fixes my problem or if I need to raise a new bug? I currently install testcafe by having "testcafe": "^0.23.0", in my 'dependencies' section of package.json.
@neekfenwick, the fix is included in the 1.1.0 release. You can update the dependency in your package.json by running
npm i --save testcafe@latest
You can check that you have the latest TestCafe version by running the following command:
npm ls testcafe
If you have any problem with the latest TestCafe version, please create a new bug report.
Most helpful comment
@ParachuteCat,
Thank you for your detailed description. I've reproduced this issue. Our team will research it and find a suitable solution, if any.