This commit is contained in:
Elio Bischof
2024-10-19 00:27:39 +02:00
parent 3fc6118609
commit 7cde73f879
5 changed files with 30 additions and 28 deletions

View File

@@ -210,6 +210,7 @@ ZITADEL_API_URL=https://zitadel-tlx3du.us1.zitadel.cloud
ZITADEL_SERVICE_USER_ID=289106423158521850
ZITADEL_SERVICE_USER_TOKEN=1S6w48thfWFI2klgfwkCnhXJLf9FQ457E-_3H74ePQxfO3Af0Tm4V5Xi-ji7urIl_xbn-Rk
```
</details>
Start the login application in dev mode:

View File

@@ -1,12 +1,12 @@
import { test, expect } from '@playwright/test';
import { test } from "@playwright/test";
test('username and password', async ({ page }) => {
await page.goto('/');
const loginname = page.getByLabel('Loginname')
test("username and password", async ({ page }) => {
await page.goto("/");
const loginname = page.getByLabel("Loginname");
await loginname.pressSequentially("zitadel-admin@zitadel.localhost");
await loginname.press( 'Enter');
const password = page.getByLabel('Password')
await loginname.press("Enter");
const password = page.getByLabel("Password");
await password.pressSequentially("Password1!");
await password.press( 'Enter');
await page.getByText('Skip').click();
await password.press("Enter");
await page.getByText("Skip").click();
});

View File

@@ -1,6 +1,6 @@
import { test } from '@playwright/test';
import { test } from "@playwright/test";
test('login is accessible', async ({ page }) => {
await page.goto('http://localhost:3000/');
await page.getByRole('heading', { name: 'Welcome back!' }).isVisible();
test("login is accessible", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.getByRole("heading", { name: "Welcome back!" }).isVisible();
});

View File

@@ -15,6 +15,7 @@
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix",
"clean": "turbo run clean && rm -rf node_modules",
"format:fix": "prettier --write \"**/*.{ts,tsx,md}\"",
"format": "prettier --check \"**/*.{ts,tsx,md}\"",
"changeset": "changeset",
"version-packages": "changeset version",

View File

@@ -1,4 +1,4 @@
import { defineConfig, devices } from '@playwright/test';
import { defineConfig, devices } from "@playwright/test";
/**
* Read environment variables from file.
@@ -12,7 +12,7 @@ import { defineConfig, devices } from '@playwright/test';
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './acceptance/tests',
testDir: "./acceptance/tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
@@ -22,28 +22,28 @@ export default defineConfig({
/* 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',
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',
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',
trace: "on-first-retry",
},
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
/* TODO: webkit fails. Is this a bug?
/* TODO: webkit fails. Is this a bug?
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
@@ -73,8 +73,8 @@ export default defineConfig({
/* Run local dev server before starting the tests */
webServer: {
command: 'pnpm start',
url: 'http://127.0.0.1:3000',
command: "pnpm start",
url: "http://127.0.0.1:3000",
reuseExistingServer: !process.env.CI,
timeout: 5 * 60_000,
},