From df216f7ae0d9c809eb5728fb2e05e5f477ff4bb9 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Sat, 16 Sep 2023 00:32:32 +0100 Subject: [PATCH] test(e2e): wait for marker_unique_id.html e2e test Sometimes, Cypress takes the screenshot for marker_unique_id.html early, before mermaid has finished rendering the diagrams. Fixes: 924c9e913b665f22f9a3401dbf31857579833ca4 --- .../rendering/marker_unique_id.spec.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cypress/integration/rendering/marker_unique_id.spec.js b/cypress/integration/rendering/marker_unique_id.spec.js index 617189db051..a4c085ce1b8 100644 --- a/cypress/integration/rendering/marker_unique_id.spec.js +++ b/cypress/integration/rendering/marker_unique_id.spec.js @@ -2,9 +2,16 @@ import { urlSnapshotTest } from '../../helpers/util.ts'; describe('Marker Unique IDs Per Diagram', () => { it('should render a blue arrow tip in second digram', () => { - urlSnapshotTest('http://localhost:9000/marker_unique_id.html', { - logLevel: 1, - flowchart: { htmlLabels: false }, - }); + urlSnapshotTest( + 'http://localhost:9000/marker_unique_id.html', + { + logLevel: 1, + flowchart: { htmlLabels: false }, + }, + undefined, + ($svg) => { + expect($svg).to.have.length(4); + } + ); }); });