|
| 1 | +import { visitHtml } from '../../common/helper'; |
| 2 | + |
| 3 | +Cypress.env('allureSkipCommands', 'screenshot'); |
| 4 | +describe('screenshot', () => { |
| 5 | + describe('screenshot with name @screen', () => { |
| 6 | + beforeEach(() => { |
| 7 | + visitHtml(); |
| 8 | + }); |
| 9 | + |
| 10 | + it('test 1 - should have 1 step screenshot', () => { |
| 11 | + cy.allure().startStep('step 1'); |
| 12 | + cy.screenshot('my-step', { allureAttachToStep: true }); |
| 13 | + cy.allure().endStep(); |
| 14 | + }); |
| 15 | + |
| 16 | + it('test 1.1 - should have 1 step screenshot for element', () => { |
| 17 | + cy.allure().startStep('step 1'); |
| 18 | + cy.get('div').first().screenshot('my-element', { allureAttachToStep: true }); |
| 19 | + cy.allure().endStep(); |
| 20 | + }); |
| 21 | + |
| 22 | + it('test 2 - should have 1 step screenshot and one test screenshot', () => { |
| 23 | + cy.allure().startStep('step 1'); |
| 24 | + cy.screenshot('my-step', { allureAttachToStep: true }); |
| 25 | + cy.screenshot('my-test'); |
| 26 | + cy.allure().endStep(); |
| 27 | + }); |
| 28 | + |
| 29 | + it('test 2.1 - should have 1 step screenshot and one test screenshot for element', () => { |
| 30 | + cy.allure().startStep('step 1'); |
| 31 | + cy.get('div').first().screenshot('my-step', { allureAttachToStep: true }); |
| 32 | + cy.get('div').eq(1).screenshot('my-test'); |
| 33 | + cy.allure().endStep(); |
| 34 | + }); |
| 35 | + |
| 36 | + it('test 3 - should have 1 test screenshot', () => { |
| 37 | + cy.allure().startStep('step 1'); |
| 38 | + cy.screenshot('my-test'); |
| 39 | + cy.allure().endStep(); |
| 40 | + }); |
| 41 | + |
| 42 | + it('test 3.1 - should have 1 test screenshot for element', () => { |
| 43 | + cy.allure().startStep('step 1'); |
| 44 | + cy.get('div').first().screenshot('my-test'); |
| 45 | + cy.allure().endStep(); |
| 46 | + }); |
| 47 | + }); |
| 48 | +}); |
0 commit comments