Skip to content

Commit

Permalink
Support for nested suites.
Browse files Browse the repository at this point in the history
Works for any level of deepness.
  • Loading branch information
rkrisztian committed Oct 13, 2020
1 parent 74b1a81 commit e702843
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 12 additions & 0 deletions cypress/integration/todo-app-v2.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,16 @@ describe('TodoApp', () => {
'do lunch and learn about Cypress'
);
});

describe('Nesting', () => {
it('should work', () => {
cy.get('.todo-list li').should('have.length', 3);

cy.getFirstTodoItem().should(
'be.equal',
'do lunch and learn about Cypress'
);
});
});

});
5 changes: 2 additions & 3 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import addContext from 'mochawesome/addContext';

Cypress.on('test:after:run', (test, runnable) => {
if (test.state === 'failed') {
const screenshot = `${Cypress.config('screenshotsFolder')}/${
Cypress.spec.name
}/${runnable.parent.title} -- ${test.title} (failed).png`;
const screenshotDir = `${Cypress.config('screenshotsFolder')}/${Cypress.spec.name}`
const screenshot = `${screenshotDir}/${runnable.titlePath().join(' -- ')} (failed).png`;
addContext({ test }, screenshot);
}
});

0 comments on commit e702843

Please sign in to comment.