From 3cfc3e83391b1b42040c170bb01a5553d79eefb8 Mon Sep 17 00:00:00 2001 From: Arianrhod Sandlot Date: Wed, 27 Sep 2023 14:11:42 +0800 Subject: [PATCH] test: fix test in ci --- .github/workflows/test.yaml | 2 ++ tests/e2e/homepage/homepage.spec.ts | 13 ++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8751aa3..f331bf6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,6 +3,8 @@ on: [push] jobs: test: runs-on: ubuntu-latest + environment: + name: test steps: - uses: actions/checkout@v4 diff --git a/tests/e2e/homepage/homepage.spec.ts b/tests/e2e/homepage/homepage.spec.ts index 9d1badd..ffa0f56 100644 --- a/tests/e2e/homepage/homepage.spec.ts +++ b/tests/e2e/homepage/homepage.spec.ts @@ -15,31 +15,22 @@ test.beforeEach(async ({ page }) => { const dialog = page.getByRole('dialog') + const button = page.getByTestId('select-onedrive-directory') if (isUpdatingHar) { await page.routeFromHAR(harPath, { url: harUrlPattern, update: true, updateMode: 'minimal' }) - const button = page.getByTestId('select-onedrive-directory') await button.click() await dialog.getByRole('link').click() } else { - console.log(1) await page.evaluate(setMockLocalStorage) - console.log(2) await page.routeFromHAR(harPath, { url: harUrlPattern }) - console.log(3) - const button = page.getByTestId('select-onedrive-directory') - console.log(4) await button.click() - console.log(5) } + const node = dialog.getByTestId('directory-tree-node') - console.log(6) await node.filter({ hasText: 'games' }).click() - console.log(7) await node.filter({ hasText: 'retro-game-roms-test' }).getByRole('button').click() - console.log(8) await expect(dialog).not.toBeVisible() - console.log(9) }) test('navigate systems', async ({ page }) => {