diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 000000000..e513286aa --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,34 @@ +name: E2E + +on: + pull_request: + branches: ['**'] + paths-ignore: + - '**/*.md' + - 'static/**/*' + +env: + VITE_STRIPE_PUBLIC_KEY: ${{ vars.VITE_STRIPE_PUBLIC_KEY }} + VITE_APPWRITE_ENDPOINT: http://appwrite.test/v1 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + - name: Install dependencies + run: npm ci + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: E2E Tests + run: npm run e2e + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 7 diff --git a/package-lock.json b/package-lock.json index 3635edfbe..4ba09abc4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "devDependencies": { "@melt-ui/pp": "^0.1.4", "@melt-ui/svelte": "^0.61.2", - "@playwright/test": "^1.37.1", + "@playwright/test": "^1.44.0", "@sveltejs/adapter-static": "^3.0.1", "@sveltejs/kit": "^2.3.4", "@sveltejs/vite-plugin-svelte": "^3.0.1", @@ -1895,12 +1895,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.43.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.1.tgz", - "integrity": "sha512-HgtQzFgNEEo4TE22K/X7sYTYNqEMMTZmFS8kTq6m8hXj+m1D8TgwgIbumHddJa9h4yl4GkKb8/bgAl2+g7eDgA==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.44.0.tgz", + "integrity": "sha512-rNX5lbNidamSUorBhB4XZ9SQTjAqfe5M+p37Z8ic0jPFBMo5iCtQz1kRWkEMg+rYOKSlVycpQmpqjSFq7LXOfg==", "dev": true, "dependencies": { - "playwright": "1.43.1" + "playwright": "1.44.0" }, "bin": { "playwright": "cli.js" @@ -7678,12 +7678,12 @@ } }, "node_modules/playwright": { - "version": "1.43.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.1.tgz", - "integrity": "sha512-V7SoH0ai2kNt1Md9E3Gwas5B9m8KR2GVvwZnAI6Pg0m3sh7UvgiYhRrhsziCmqMJNouPckiOhk8T+9bSAK0VIA==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.44.0.tgz", + "integrity": "sha512-F9b3GUCLQ3Nffrfb6dunPOkE5Mh68tR7zN32L4jCk4FjQamgesGay7/dAAe1WaMEGV04DkdJfcJzjoCKygUaRQ==", "dev": true, "dependencies": { - "playwright-core": "1.43.1" + "playwright-core": "1.44.0" }, "bin": { "playwright": "cli.js" @@ -7696,9 +7696,9 @@ } }, "node_modules/playwright-core": { - "version": "1.43.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.1.tgz", - "integrity": "sha512-EI36Mto2Vrx6VF7rm708qSnesVQKbxEWvPrfA1IPY6HgczBplDx7ENtx+K2n4kJ41sLLkuGfmb0ZLSSXlDhqPg==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.0.tgz", + "integrity": "sha512-ZTbkNpFfYcGWohvTTl+xewITm7EOuqIqex0c7dNZ+aXsbrLj0qI8XlGKfPpipjm0Wny/4Lt4CJsWJk1stVS5qQ==", "dev": true, "bin": { "playwright-core": "cli.js" diff --git a/package.json b/package.json index 7b8298bd9..d3cd60e05 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "devDependencies": { "@melt-ui/pp": "^0.1.4", "@melt-ui/svelte": "^0.61.2", - "@playwright/test": "^1.37.1", + "@playwright/test": "^1.44.0", "@sveltejs/adapter-static": "^3.0.1", "@sveltejs/kit": "^2.3.4", "@sveltejs/vite-plugin-svelte": "^3.0.1", diff --git a/playwright.config.ts b/playwright.config.ts index 92ef2dd64..e84ebf4ae 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,21 +1,9 @@ -import { type PlaywrightTestConfig, devices } from '@playwright/test'; +import { type PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { timeout: 120000, - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] } - } - // { - // name: 'webkit', - // use: { ...devices['Desktop Safari'] } - // } - ], reportSlowTests: null, webServer: { - stderr: 'ignore', - stdout: 'ignore', env: { VITE_APPWRITE_ENDPOINT: 'http://console-tests.appwrite.org/v1', VITE_CONSOLE_MODE: 'cloud' diff --git a/tests/e2e/journeys/upgrade-free-tier.spec.ts b/tests/e2e/journeys/upgrade-free-tier.spec.ts index 5cd25d4a8..5c60a3872 100644 --- a/tests/e2e/journeys/upgrade-free-tier.spec.ts +++ b/tests/e2e/journeys/upgrade-free-tier.spec.ts @@ -14,7 +14,7 @@ test('upgrade - free tier', async ({ page }) => { await enterAddress(page); // skip members await page.getByRole('button', { name: 'next' }).click(); - await page.getByRole('button', { name: 'start trial' }).click(); + await page.getByRole('button', { name: 'create' }).click(); await page.waitForURL('/console/organization-**'); }); }); diff --git a/tests/e2e/steps/pro-project.ts b/tests/e2e/steps/pro-project.ts index 08502f28a..571e85ca0 100644 --- a/tests/e2e/steps/pro-project.ts +++ b/tests/e2e/steps/pro-project.ts @@ -36,7 +36,7 @@ export async function createProProject(page: Page): Promise { // skip members await page.getByRole('button', { name: 'next' }).click(); // start pro trial - await page.getByRole('button', { name: 'start trial' }).click(); + await page.getByRole('button', { name: 'create' }).click(); await page.waitForURL('/console/organization-**'); return getOrganizationIdFromUrl(page.url());