Skip to content

Commit

Permalink
test(e2e): wait for theme-directives.html
Browse files Browse the repository at this point in the history
The `theme-directives.html` test currently sometimes takes a screenshot
before all of the Mermaid diagrams have completed rendering.
  • Loading branch information
aloisklink committed Sep 15, 2023
1 parent 4201e47 commit 15ab657
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cypress/integration/rendering/conf-and-directives.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ graph TD
it('diagrams should not taint later diagrams', () => {
const url = 'http://localhost:9000/theme-directives.html';
cy.visit(url);

const diagrams = 6;
cy.get('svg').should(($svg) => {
expect($svg).to.have.length(diagrams);
$svg.each((_index, svg) => {
expect(cy.$$(svg)).to.be.visible;
});
});
// confirm that we are actually expecting 6 diagrams
cy.get('h1').should('have.length', diagrams);
cy.matchImageSnapshot('conf-and-directives.spec-when-rendering-several-diagrams-diagram-1');
});
});
Expand Down

0 comments on commit 15ab657

Please sign in to comment.