From 7abbfe738a38580e4df1c0d9362d2506b52a7e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Mog=C3=A8re?= Date: Mon, 1 Jul 2024 00:34:50 +0200 Subject: [PATCH] fix(test): fixed e2e tests --- app/components/UploadDownload.vue | 1 + package.json | 1 + tests/index.spec.ts | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/components/UploadDownload.vue b/app/components/UploadDownload.vue index b09e63b..dd87fce 100644 --- a/app/components/UploadDownload.vue +++ b/app/components/UploadDownload.vue @@ -47,6 +47,7 @@ const resetConfiguration = () => { size="sm" class="w-full py-1" :disabled="!store.configLoaded" + aria-label="Reset configuration" @click="resetConfiguration" > Reset diff --git a/package.json b/package.json index 0113223..24ce4db 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "dev": "nuxi dev", "build": "nuxi build", "start": "nuxi start", + "test": "playwright test", "postinstall": "nuxt prepare", "lint": "eslint ." }, diff --git a/tests/index.spec.ts b/tests/index.spec.ts index d5b5867..e9c6e47 100644 --- a/tests/index.spec.ts +++ b/tests/index.spec.ts @@ -48,7 +48,7 @@ test.describe('TreePulse Page Tests', () => { // Add assertions to verify the configuration is loaded await expect(page.locator('html')).toHaveText(/▼ Catalog/, { timeout: 10000 }) - const resetButton = page.locator('button[aria-label="reset"]') + const resetButton = page.locator('button[aria-label="Reset configuration"]') await resetButton.click() }) @@ -71,8 +71,8 @@ test.describe('TreePulse Page Tests', () => { // Add assertions to verify the file is uploaded and configuration is loaded await expect(page.locator('text=File Config')).toBeVisible({ timeout: 10000 }); - const resetButton = page.locator('button[aria-label="reset"]'); - await resetButton.click(); + const resetButton = page.locator('button[aria-label="Reset configuration"]') + await resetButton.click() */ }) @@ -86,7 +86,7 @@ test.describe('TreePulse Page Tests', () => { // This could include checking for specific text or elements that indicate the configuration has been loaded await expect(page.locator('text=Project 1')).toBeVisible() - const resetButton = page.locator('button[aria-label="reset"]') + const resetButton = page.locator('button[aria-label="Reset configuration"]') await resetButton.click() }) })