init commit

This commit is contained in:
Darya Umrikhina 2024-08-15 18:10:53 +04:00
parent 9fd5ace6c2
commit 5ab4d92db2
5 changed files with 138 additions and 1 deletions

View File

@ -36,4 +36,8 @@ yarn-error.log*
next-env.d.ts
autoGeneratedTranslations.js
autoGeneratedTranslations.js
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

View File

@ -0,0 +1,18 @@
import { test, expect } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});
test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();
// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});

View File

@ -25,6 +25,7 @@
"styled-components": "^5.3.9"
},
"devDependencies": {
"@playwright/test": "^1.46.0",
"@svgr/webpack": "^8.1.0",
"@types/node": "^20",
"@types/react": "^18.2.53",

View File

@ -0,0 +1,78 @@
import { defineConfig, devices } from "@playwright/test";
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// dotenv.config({ path: path.resolve(__dirname, '.env') });
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./__tests__",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},
/* Configure projects for major browsers */
projects: [
/* {
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
{
name: "webkit",
use: { ...devices["Desktop Safari"] },
}, */
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },
/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
{
name: "Google Chrome",
use: { ...devices["Desktop Chrome"], channel: "chrome" },
},
],
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});

View File

@ -2756,6 +2756,7 @@ __metadata:
resolution: "@docspace/login@workspace:packages/login"
dependencies:
"@hcaptcha/react-hcaptcha": "npm:^1.10.1"
"@playwright/test": "npm:^1.46.0"
"@svgr/webpack": "npm:^8.1.0"
"@types/node": "npm:^20"
"@types/react": "npm:^18.2.53"
@ -4779,6 +4780,17 @@ __metadata:
languageName: node
linkType: hard
"@playwright/test@npm:^1.46.0":
version: 1.46.0
resolution: "@playwright/test@npm:1.46.0"
dependencies:
playwright: "npm:1.46.0"
bin:
playwright: cli.js
checksum: 10/710bf451555e67476bf6e911a07ec0e011474f769a10f8073b3b22fe9b81086a83b6821da354900a6d6d14d60e4320b2c9f7249cc5480e3923de56a8501b7ffe
languageName: node
linkType: hard
"@pmmmwh/react-refresh-webpack-plugin@npm:^0.5.11":
version: 0.5.11
resolution: "@pmmmwh/react-refresh-webpack-plugin@npm:0.5.11"
@ -22564,6 +22576,30 @@ __metadata:
languageName: node
linkType: hard
"playwright-core@npm:1.46.0":
version: 1.46.0
resolution: "playwright-core@npm:1.46.0"
bin:
playwright-core: cli.js
checksum: 10/1fd237d01380be0d650ae7df73fb796eae9c208e0746bb110db270139f1d2a96bf3b8856c394a48720b30e145614a10f275ab08627d0c95ba2160dc0402a90cb
languageName: node
linkType: hard
"playwright@npm:1.46.0":
version: 1.46.0
resolution: "playwright@npm:1.46.0"
dependencies:
fsevents: "npm:2.3.2"
playwright-core: "npm:1.46.0"
dependenciesMeta:
fsevents:
optional: true
bin:
playwright: cli.js
checksum: 10/e06f3b53faaf4edf4fcf636b43004dd0db1e45dbdcb2b59037a9810dfce3a59f0386d4826ba7de42f98fe525539fa20dd8f8c46acd1f8e5c57dcb5c1d8d536ce
languageName: node
linkType: hard
"playwright@npm:^1.17.1, playwright@npm:^1.32.0":
version: 1.42.1
resolution: "playwright@npm:1.42.1"