diff --git a/.eslintignore b/.eslintignore index b48a74c4a..b780ba0d4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -9,3 +9,4 @@ hot /test/func/**/reports /test/func/packages/*/plugin.js /hermione-report +tmp diff --git a/.gitignore b/.gitignore index 5125047de..e53027bb1 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ hermione-report test/func/**/report test/func/**/reports test/func/packages/*/plugin.js +test/func/fixtures/playwright/test-results diff --git a/test/func/fixtures/hermione/package.json b/test/func/fixtures/hermione/package.json index eb3e3a913..6942db35f 100644 --- a/test/func/fixtures/hermione/package.json +++ b/test/func/fixtures/hermione/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "clean": "rm -rf report", - "hermione": "npx hermione", + "generate": "npx hermione", "gui": "npx hermione gui --port 8001" } } diff --git a/test/func/fixtures/playwright/playwright.config.ts b/test/func/fixtures/playwright/playwright.config.ts deleted file mode 100644 index 9f1a735d8..000000000 --- a/test/func/fixtures/playwright/playwright.config.ts +++ /dev/null @@ -1,46 +0,0 @@ -import path from 'path'; -import {defineConfig, devices} from '@playwright/test'; - -const serverHost = process.env.SERVER_HOST ?? 'localhost'; -const serverPort = process.env.SERVER_PORT ?? 8085; - -export default defineConfig({ - testDir: './tests', - timeout: 30 * 1000, - expect: { - timeout: 5000 - }, - fullyParallel: true, - forbidOnly: !!process.env.CI, - retries: 2, - workers: process.env.CI ? 1 : undefined, - reporter: [ - ['html-reporter-tester/playwright', { - enabled: true, - path: path.resolve(__dirname, 'report'), - saveFormat: 'sqlite', - defaultView: 'failed', - saveErrorDetails: true - }] - ], - use: { - actionTimeout: 0, - baseURL: `http://${serverHost}:${serverPort}/fixtures/hermione/index.html`, - trace: 'off' - }, - - projects: [ - { - name: 'chromium', - use: {...devices['Desktop Chrome']} - } - ], - - webServer: { - command: `npx http-server ${path.resolve(__dirname, '../..')} -c-1 -p ${serverPort}`, - port: Number(serverPort), - stdout: 'pipe' - }, - - snapshotPathTemplate: '{testDir}/screens/{testName}/{projectName}/{arg}{ext}' -}); diff --git a/test/func/fixtures/playwright/tests/failed-describe.spec.ts b/test/func/fixtures/playwright/tests/failed-describe.spec.ts deleted file mode 100644 index 6791495d4..000000000 --- a/test/func/fixtures/playwright/tests/failed-describe.spec.ts +++ /dev/null @@ -1,42 +0,0 @@ -import fs from 'fs'; -import fsPromises from 'fs/promises'; -import path from 'path'; -import {test, expect} from '@playwright/test'; - -test.describe('failed describe', () => { - test('successfully passed test', async ({page, baseURL}) => { - await page.goto(baseURL as string); - - expect(true).toBe(true); - }); - - test('test without screenshot', async ({page, baseURL}) => { - await page.goto(baseURL as string); - - const screenshotPath = path.resolve(__dirname, 'screens/failed-describe-test-without-screenshot/chromium/header.png'); - if (fs.existsSync(screenshotPath)) { - await fsPromises.rm(screenshotPath); - } - await expect(page.locator('header')).toHaveScreenshot('header.png'); - }); - - test('test with diff', async ({page, baseURL}) => { - await page.goto(baseURL as string); - - await expect(page.locator('header')).toHaveScreenshot('header.png'); - }); - - test('test with long error message', async () => { - throw new Error(`long_error_message ${'0123456789'.repeat(20)}\n message content`); - }); - - test('test skipped at the end', async ({page, baseURL}) => { - await page.goto(baseURL as string); - - test.skip(true, 'foo-bar'); - }); - - test.skip('test skipped', async ({page, baseURL}) => { - await page.goto(baseURL as string); - }); -}); diff --git a/test/func/fixtures/playwright/tests/screens/failed-describe-test-with-diff/chromium/header.png b/test/func/fixtures/playwright/tests/screens/failed-describe-test-with-diff/chromium/header.png deleted file mode 100644 index 5bc4221ca..000000000 Binary files a/test/func/fixtures/playwright/tests/screens/failed-describe-test-with-diff/chromium/header.png and /dev/null differ diff --git a/test/func/fixtures/playwright/tests/screens/failed-describe-test-without-screenshot/chromium/header.png b/test/func/fixtures/playwright/tests/screens/failed-describe-test-without-screenshot/chromium/header.png deleted file mode 100644 index 2baf53cb5..000000000 Binary files a/test/func/fixtures/playwright/tests/screens/failed-describe-test-without-screenshot/chromium/header.png and /dev/null differ diff --git a/test/func/fixtures/playwright/tests/screens/success-describe-test-with-screenshot/chromium/header.png b/test/func/fixtures/playwright/tests/screens/success-describe-test-with-screenshot/chromium/header.png deleted file mode 100644 index 2baf53cb5..000000000 Binary files a/test/func/fixtures/playwright/tests/screens/success-describe-test-with-screenshot/chromium/header.png and /dev/null differ diff --git a/test/func/fixtures/playwright/tests/success-describe.spec.ts b/test/func/fixtures/playwright/tests/success-describe.spec.ts deleted file mode 100644 index 7ff0fd13b..000000000 --- a/test/func/fixtures/playwright/tests/success-describe.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import {test, expect} from '@playwright/test'; - -test.describe('success describe', () => { - test('successfully passed test', async ({page, baseURL}) => { - await page.goto(baseURL as string); - - expect(true).toBe(true); - }); - - test('test with screenshot', async ({page, baseURL}) => { - await page.goto(baseURL as string); - - await expect(page.locator('header')).toHaveScreenshot('header.png'); - }); -}); diff --git a/test/func/fixtures/plugins/package.json b/test/func/fixtures/plugins/package.json index ae9d36206..e68ca4877 100644 --- a/test/func/fixtures/plugins/package.json +++ b/test/func/fixtures/plugins/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "clean": "rm -rf report", - "hermione": "npx hermione", + "generate": "npx hermione", "gui": "npx hermione gui --port 8002" } }