From d2a907892eb5b6f5d26009119b9745f9d028efb3 Mon Sep 17 00:00:00 2001 From: Liam Cho Date: Thu, 14 Nov 2024 11:25:27 +0900 Subject: [PATCH] testing --- .circleci/config.yml | 2 +- __visual_tests__/workflow-tests.spec.ts | 4 ++-- playwright.config.ts | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b43387a94..0668ebf35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,7 +129,7 @@ jobs: command: npx playwright install --with-deps - run: name: Run Playwright snapshot tests # refer to https://circleci.com/docs/collect-test-data/#playwright - command: PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml yarn playwright test --reporter=junit + command: PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml yarn playwright test --config=playwright.config.ts - store_test_results: path: results.xml - store_artifacts: diff --git a/__visual_tests__/workflow-tests.spec.ts b/__visual_tests__/workflow-tests.spec.ts index ecbcfabda..997530815 100644 --- a/__visual_tests__/workflow-tests.spec.ts +++ b/__visual_tests__/workflow-tests.spec.ts @@ -74,7 +74,7 @@ test('101', async ({ page, browserName }) => { test('102', async ({ page, browserName }) => { await loadWidget(page); // 1 - await sendTextMessage(page, 'Give me a travel agency poster', 5000); + await sendTextMessage(page, 'Give me a travel agency poster', 100); await assertScreenshot(page, '102-1', browserName); }); @@ -110,7 +110,7 @@ test('103', async ({ page, browserName }) => { // 4 options = page.locator(WidgetComponentIds.SUGGESTED_REPLIES_OPTIONS); await options.nth(1).click(); - await page.waitForTimeout(4000); // Time takes long for file message to be rendered and then scrolled to bottom in CI browsers. + await page.waitForTimeout(100); // Time takes long for file message to be rendered and then scrolled to bottom in CI browsers. await assertScreenshot(page, '103-4', browserName); // 5 diff --git a/playwright.config.ts b/playwright.config.ts index 9d883d29d..d6b5dc346 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -23,7 +23,10 @@ export default defineConfig({ /* Opt out of parallel tests on CI. */ workers: undefined, // process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: [['junit', { outputFile: 'results.xml' }]], + reporter: [ + ['junit', { outputFile: 'results.xml' }], + ['html', { open: 'never', outputFolder: 'test-results' }] + ], /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */