diff --git a/apps/cms/turbo.json b/apps/cms/turbo.json index b371940bd..16a534ed8 100644 --- a/apps/cms/turbo.json +++ b/apps/cms/turbo.json @@ -37,13 +37,6 @@ "!web/themes/custom/**", "!web/sites/default/files/**" ] - }, - "test:integration": { - "dependsOn": [ - "prep", - "@custom-tests/e2e#test:integration:drupal", - "@custom-tests/schema#test:integration" - ] } } } diff --git a/apps/decap/turbo.json b/apps/decap/turbo.json index b6cfb94b3..cc8c5a97f 100644 --- a/apps/decap/turbo.json +++ b/apps/decap/turbo.json @@ -14,9 +14,6 @@ }, "prep": { "dependsOn": ["prep:vite", "prep:scripts"] - }, - "test:integration": { - "dependsOn": ["@custom-tests/e2e#test:integration:decap"] } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6065f9639..2b0e6c248 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -823,9 +823,21 @@ importers: tests/e2e: devDependencies: + '@custom/cms': + specifier: workspace:* + version: link:../../apps/cms + '@custom/decap': + specifier: workspace:* + version: link:../../apps/decap '@custom/eslint-config': specifier: workspace:* version: link:../../packages/eslint-config + '@custom/preview': + specifier: workspace:* + version: link:../../apps/preview + '@custom/website': + specifier: workspace:* + version: link:../../apps/website '@playwright/test': specifier: ^1.44.1 version: 1.44.1 diff --git a/tests/e2e/package.json b/tests/e2e/package.json index 3571a6773..48807e667 100644 --- a/tests/e2e/package.json +++ b/tests/e2e/package.json @@ -1,22 +1,18 @@ { "name": "@custom-tests/e2e", - "version": "1.0.0", - "description": "", - "keywords": [], - "author": "", - "license": "ISC", "type": "module", "scripts": { "test:static": "tsc --noEmit && eslint . --quiet", - "test:integration:drupal": "playwright install chromium && playwright test --config playwright.config.drupal.ts", - "test:integration:decap": "playwright install chromium && playwright test --config playwright.config.decap.ts", - "test:headed:drupal": "playwright install chromium && playwright test --headed --config playwright.config.drupal.ts", - "test:headed:decap": "playwright install chromium && playwright test --headed --config playwright.config.decap.ts", - "dev:decap": "playwright install chromium && playwright test --ui --config playwright.config.decap.ts", - "dev:drupal": "playwright install chromium && playwright test --ui --config playwright.config.drupal.ts" + "test:integration": "playwright install chromium && playwright test", + "test:headed": "playwright install chromium && playwright test --headed", + "dev": "playwright install chromium && playwright test --ui" }, "devDependencies": { + "@custom/cms": "workspace:*", + "@custom/decap": "workspace:*", "@custom/eslint-config": "workspace:*", + "@custom/preview": "workspace:*", + "@custom/website": "workspace:*", "@playwright/test": "^1.44.1", "@types/node": "^18", "typescript": "^5.3.3" diff --git a/tests/e2e/playwright.config.decap.ts b/tests/e2e/playwright.config.decap.ts deleted file mode 100644 index 5b9564a8f..000000000 --- a/tests/e2e/playwright.config.decap.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { defineConfig, devices } from '@playwright/test'; - -import defaults from './playwright.config.default'; - -export default defineConfig({ - ...defaults, - testDir: './specs/decap', - webServer: [ - { - command: - 'pnpm run --filter "@custom/website" serve >> /tmp/website.log 2>&1', - port: 8000, - reuseExistingServer: !process.env.CI, - }, - ], - projects: [ - { - name: 'setup', - testMatch: /decap\/setup\.ts/, - }, - { - name: 'chromium', - testMatch: /\.*.spec\.ts/, - use: { ...devices['Desktop Chrome'] }, - dependencies: ['setup'], - }, - ], -}); diff --git a/tests/e2e/playwright.config.default.ts b/tests/e2e/playwright.config.default.ts deleted file mode 100644 index 11b79ecae..000000000 --- a/tests/e2e/playwright.config.default.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { defineConfig } from '@playwright/test'; - -export default defineConfig({ - fullyParallel: true, - retries: process.env.CI ? 2 : 0, - workers: 1, - reporter: 'html', - use: { - trace: process.env.CI ? 'retain-on-failure' : 'on', - actionTimeout: 10_000, - }, -}); diff --git a/tests/e2e/playwright.config.drupal.ts b/tests/e2e/playwright.config.ts similarity index 76% rename from tests/e2e/playwright.config.drupal.ts rename to tests/e2e/playwright.config.ts index 54027f2fb..ee6496aac 100644 --- a/tests/e2e/playwright.config.drupal.ts +++ b/tests/e2e/playwright.config.ts @@ -1,10 +1,15 @@ import { defineConfig, devices } from '@playwright/test'; -import defaults from './playwright.config.default'; - export default defineConfig({ - ...defaults, - testDir: './specs/drupal', + fullyParallel: true, + retries: process.env.CI ? 2 : 0, + workers: 1, + reporter: 'html', + use: { + trace: process.env.CI ? 'retain-on-failure' : 'on', + actionTimeout: 10_000, + }, + testDir: './specs', webServer: [ { command: 'pnpm run --filter "@custom/cms" start >> /tmp/cms.log 2>&1', @@ -27,7 +32,7 @@ export default defineConfig({ projects: [ { name: 'setup', - testMatch: /drupal\/setup\.ts/, + testMatch: /setup\.ts/, }, { name: 'chromium', diff --git a/tests/e2e/specs/decap/setup.ts b/tests/e2e/specs/decap/setup.ts deleted file mode 100644 index 006d1290f..000000000 --- a/tests/e2e/specs/decap/setup.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { test as setup } from '@playwright/test'; - -import { - netlifyBootTimeout, - waitForNetlifyBoot, -} from '../../helpers/wait-for-netlify-boot'; - -setup.setTimeout(netlifyBootTimeout + 10_000); - -setup('setup', async ({ page }) => { - await waitForNetlifyBoot(page); -}); diff --git a/tests/e2e/specs/drupal/setup.ts b/tests/e2e/specs/setup.ts similarity index 87% rename from tests/e2e/specs/drupal/setup.ts rename to tests/e2e/specs/setup.ts index 9e7eb4220..1480e8b67 100644 --- a/tests/e2e/specs/drupal/setup.ts +++ b/tests/e2e/specs/setup.ts @@ -1,10 +1,10 @@ import { expect, test as setup } from '@playwright/test'; -import { cmsUrl } from '../../helpers/url'; +import { cmsUrl } from '../helpers/url'; import { netlifyBootTimeout, waitForNetlifyBoot, -} from '../../helpers/wait-for-netlify-boot'; +} from '../helpers/wait-for-netlify-boot'; setup.setTimeout(netlifyBootTimeout + 30_000); diff --git a/tests/e2e/turbo.json b/tests/e2e/turbo.json index 62442758c..3850b2aa9 100644 --- a/tests/e2e/turbo.json +++ b/tests/e2e/turbo.json @@ -1,25 +1,10 @@ { "extends": ["//"], "tasks": { - "test:integration:decap": { - "dependsOn": ["@custom/website#build"], - "env": ["PLAYWRIGHT_WEBSITE_URL"], - "inputs": [ - "helpers/**", - "specs/decap/**", - "playwright.config.decap.ts", - "playwright.config.default.ts" - ] - }, - "test:integration:drupal": { + "test:integration": { "dependsOn": ["@custom/website#build"], "env": ["PLAYWRIGHT_WEBSITE_URL", "PLAYWRIGHT_CMS_URL"], - "inputs": [ - "helpers/**", - "specs/drupal/**", - "playwright.config.drupal.ts", - "playwright.config.default.ts" - ] + "inputs": ["helpers/**", "specs/**", "playwright.config.ts"] } } }