From 3b872fa26c0681be8906996e4aba9c5e84784e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Mestres?= Date: Fri, 20 Oct 2023 16:25:25 +0200 Subject: [PATCH] Try fix snapshot taken when export button is in loading stat --- app/templates/app/generator.hbs | 1 + tests/acceptance/visual-test.ts | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/templates/app/generator.hbs b/app/templates/app/generator.hbs index 0c8d91f..8159c14 100644 --- a/app/templates/app/generator.hbs +++ b/app/templates/app/generator.hbs @@ -57,6 +57,7 @@ loading={{this.meshGenerating}} icon-start="download" {{on 'click' this.exportSTL}} + data-test-export-stl > {{t 'export_stl'}} diff --git a/tests/acceptance/visual-test.ts b/tests/acceptance/visual-test.ts index c364144..6bdc713 100644 --- a/tests/acceptance/visual-test.ts +++ b/tests/acceptance/visual-test.ts @@ -1,6 +1,6 @@ /* eslint-disable no-await-in-loop */ import { module, test } from 'qunit'; -import { visit } from '@ember/test-helpers'; +import { visit, waitFor } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import testsSettings from './_tests-settings'; import percySnapshot from '@percy/ember'; @@ -22,10 +22,7 @@ module('Acceptance | visual', function (hooks) { // Load test settings through QP await visit(`/en-us/generator?modelSettings=${settingsQP}`); await waitCalciteReady(); - - await new Promise(function (resolve) { - setTimeout(resolve, 250); - }); + await waitFor('[data-test-export-stl]:not([loading])'); await percySnapshot(`visual test #${testIdx + 1}`); assert.true(true); });