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_ID=289106423158521850
ZITADEL_SERVICE_USER_TOKEN=1S6w48thfWFI2klgfwkCnhXJLf9FQ457E-_3H74ePQxfO3Af0Tm4V5Xi-ji7urIl_xbn-Rk ZITADEL_SERVICE_USER_TOKEN=1S6w48thfWFI2klgfwkCnhXJLf9FQ457E-_3H74ePQxfO3Af0Tm4V5Xi-ji7urIl_xbn-Rk
``` ```
</details> </details>
Start the login application in dev mode: 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 }) => { test("username and password", async ({ page }) => {
await page.goto('/'); await page.goto("/");
const loginname = page.getByLabel('Loginname') const loginname = page.getByLabel("Loginname");
await loginname.pressSequentially("zitadel-admin@zitadel.localhost"); await loginname.pressSequentially("zitadel-admin@zitadel.localhost");
await loginname.press( 'Enter'); await loginname.press("Enter");
const password = page.getByLabel('Password') const password = page.getByLabel("Password");
await password.pressSequentially("Password1!"); await password.pressSequentially("Password1!");
await password.press( 'Enter'); await password.press("Enter");
await page.getByText('Skip').click(); 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 }) => { test("login is accessible", async ({ page }) => {
await page.goto('http://localhost:3000/'); await page.goto("http://localhost:3000/");
await page.getByRole('heading', { name: 'Welcome back!' }).isVisible(); await page.getByRole("heading", { name: "Welcome back!" }).isVisible();
}); });

View File

@@ -15,6 +15,7 @@
"lint": "turbo run lint", "lint": "turbo run lint",
"lint:fix": "turbo run lint:fix", "lint:fix": "turbo run lint:fix",
"clean": "turbo run clean && rm -rf node_modules", "clean": "turbo run clean && rm -rf node_modules",
"format:fix": "prettier --write \"**/*.{ts,tsx,md}\"",
"format": "prettier --check \"**/*.{ts,tsx,md}\"", "format": "prettier --check \"**/*.{ts,tsx,md}\"",
"changeset": "changeset", "changeset": "changeset",
"version-packages": "changeset version", "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. * Read environment variables from file.
@@ -12,7 +12,7 @@ import { defineConfig, devices } from '@playwright/test';
* See https://playwright.dev/docs/test-configuration. * See https://playwright.dev/docs/test-configuration.
*/ */
export default defineConfig({ export default defineConfig({
testDir: './acceptance/tests', testDir: "./acceptance/tests",
/* Run tests in files in parallel */ /* Run tests in files in parallel */
fullyParallel: true, fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */ /* 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. */ /* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined, workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ /* 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. */ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: { use: {
/* Base URL to use in actions like `await page.goto('/')`. */ /* 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 */ /* 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 */ /* Configure projects for major browsers */
projects: [ projects: [
{ {
name: 'chromium', name: "chromium",
use: { ...devices['Desktop Chrome'] }, use: { ...devices["Desktop Chrome"] },
}, },
{ {
name: 'firefox', name: "firefox",
use: { ...devices['Desktop Firefox'] }, use: { ...devices["Desktop Firefox"] },
}, },
/* TODO: webkit fails. Is this a bug? /* TODO: webkit fails. Is this a bug?
{ {
name: 'webkit', name: 'webkit',
use: { ...devices['Desktop Safari'] }, use: { ...devices['Desktop Safari'] },
@@ -72,10 +72,10 @@ export default defineConfig({
], ],
/* Run local dev server before starting the tests */ /* Run local dev server before starting the tests */
webServer: { webServer: {
command: 'pnpm start', command: "pnpm start",
url: 'http://127.0.0.1:3000', url: "http://127.0.0.1:3000",
reuseExistingServer: !process.env.CI, reuseExistingServer: !process.env.CI,
timeout: 5 * 60_000, timeout: 5 * 60_000,
}, },
}); });