From c7b315284896ac324b2a3087efb37140f73903fd Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 15 Jul 2024 13:09:18 +0200 Subject: [PATCH 1/2] ci: harden e2e --- .github/workflows/e2e.yml | 5 +---- playwright.config.ts | 4 +++- tests/e2e/steps/pro-project.ts | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index dfb96405a..8c9ad8e4b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,15 +1,12 @@ name: E2E on: - pull_request_target: + pull_request: branches: ['**'] paths-ignore: - '**/*.md' - 'static/**/*' -env: - VITE_STRIPE_PUBLIC_KEY: ${{ vars.VITE_STRIPE_PUBLIC_KEY }} - jobs: e2e: runs-on: ubuntu-latest diff --git a/playwright.config.ts b/playwright.config.ts index d330159b0..00bf89667 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -8,7 +8,9 @@ const config: PlaywrightTestConfig = { timeout: 120000, env: { VITE_APPWRITE_ENDPOINT: 'http://console-tests.appwrite.org/v1', - VITE_CONSOLE_MODE: 'cloud' + VITE_CONSOLE_MODE: 'cloud', + VITE_STRIPE_PUBLIC_KEY: + 'pk_test_51LT5nsGYD1ySxNCyd7b304wPD8Y1XKKWR6hqo6cu3GIRwgvcVNzoZv4vKt5DfYXL1gRGw4JOqE19afwkJYJq1g3K004eVfpdWn' }, command: 'npm run build && npm run preview', port: 4173 diff --git a/tests/e2e/steps/pro-project.ts b/tests/e2e/steps/pro-project.ts index 2297dbedb..c01d3c39a 100644 --- a/tests/e2e/steps/pro-project.ts +++ b/tests/e2e/steps/pro-project.ts @@ -24,7 +24,8 @@ export async function createProProject(page: Page): Promise { await page.locator('id=plan').selectOption('tier-1'); await page.getByRole('button', { name: 'get started' }).click(); await page.waitForURL('/console/create-organization**'); - await page.getByRole('button', { name: 'Add' }).first().click(); + await new Promise((r) => setTimeout(r, 1000)); + await page.getByRole('button', { name: 'add' }).first().click(); await enterCreditCard(page); // skip members await page.getByRole('button', { name: 'create organization' }).click(); From 97b10879bbb7103e99e4411b07235e0e9c075caf Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 15 Jul 2024 13:10:53 +0200 Subject: [PATCH 2/2] ci: fix github actions --- .github/workflows/e2e.yml | 2 -- .github/workflows/tests.yml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8c9ad8e4b..36d658605 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -12,8 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - name: Use Node.js uses: actions/setup-node@v3 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a93dc1709..a06ab052c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js uses: actions/setup-node@v3 with: