`cy.screenshot()` failed because it requires a DOM element
Closed this issue · 2 comments
pradumangoyal commented
I am getting an error while running the basic test using the cypress. The issue seems very small, as I can see most of the developers are using it successfully but have spent 2-3 hours already to get it started.
The test file is:
describe('Snapshot Testing', () => {
context('720p resolution', () => {
beforeEach(() => {
cy.viewport(1280, 720);
});
it('Create a reference image',{tags: '1'} ,() => {
cy.visit("a14cf4f0-4365-4b47-a1d9-c2ebb1c0e26c.html");
cy.get('body').matchImageSnapshot("a14cf4f0-4365-4b47-a1d9-c2ebb1c0e26c");
});
});
});
simonsmith commented
Does your test have an actual body
element?
kamiloski88 commented
Show your html, maybe you do not have body