test(e2e): wait for theme-directives.html

The `theme-directives.html` test currently sometimes takes a screenshot
before all of the Mermaid diagrams have completed rendering.

We can use the `urlSnapshopTest()` helper function, which waits until
a `.rendered` property exists on the page.

Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
This commit is contained in:
Alois Klink
2023-09-16 00:26:24 +01:00
parent 518e277cb2
commit 17f5052a6f
2 changed files with 9 additions and 3 deletions

View File

@@ -121,7 +121,14 @@
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
securityLevel: 'strict',
startOnLoad: false,
});
await mermaid.run();
if (window.Cypress) {
window.rendered = true;
}
</script>
</body>
</html>