Expand e2e auth coverage, Vitest CI, and shared URL defaults
Wire viewer-frontend Vitest into Gitea Actions, centralize DEV base URLs in env-defaults.json, expand playkit API catalog specs, and land auth/mail flows plus verify-email public-host redirect and idle-logout e2e hooks.
This commit is contained in:
+11
-19
@@ -1,31 +1,23 @@
|
||||
import { test as base, expect } from '@playwright/test';
|
||||
import {
|
||||
createPlaykitRuntime,
|
||||
MailtrapClient,
|
||||
createMailInbox,
|
||||
type PlaykitFixtures,
|
||||
type MailInbox,
|
||||
} from '@levkin/playkit';
|
||||
import { playkitEnvFromProcess } from './env-defaults';
|
||||
import { LoginPage } from './pages/LoginPage';
|
||||
import { AccountMenu } from './pages/AccountMenu';
|
||||
import { RegisterPage } from './pages/RegisterPage';
|
||||
|
||||
const runtime = createPlaykitRuntime({
|
||||
...process.env,
|
||||
PLAYKIT_PROJECT: process.env.PLAYKIT_PROJECT || 'punimtag',
|
||||
PLAYKIT_ENV: process.env.PLAYKIT_ENV || 'dev',
|
||||
PLAYKIT_API_BASE_URL:
|
||||
process.env.PLAYKIT_API_BASE_URL ||
|
||||
process.env.API_BASE_URL ||
|
||||
'http://10.0.10.121:8000',
|
||||
PLAYKIT_BASE_URL:
|
||||
process.env.PLAYKIT_BASE_URL ||
|
||||
process.env.BASE_URL ||
|
||||
'https://punimtagdev.levkin.ca',
|
||||
});
|
||||
const runtime = createPlaykitRuntime(playkitEnvFromProcess());
|
||||
|
||||
type PunimtagFixtures = PlaykitFixtures & {
|
||||
loginPage: LoginPage;
|
||||
accountMenu: AccountMenu;
|
||||
registerPage: RegisterPage;
|
||||
e2eCredentials: { email: string; password: string } | null;
|
||||
mailtrap: MailtrapClient | null;
|
||||
mail: MailInbox | null;
|
||||
};
|
||||
|
||||
export const test = base.extend<PunimtagFixtures>({
|
||||
@@ -38,6 +30,8 @@ export const test = base.extend<PunimtagFixtures>({
|
||||
use(new LoginPage(page, playkitConfig.baseUrl)),
|
||||
accountMenu: async ({ page, playkitConfig }, use) =>
|
||||
use(new AccountMenu(page, playkitConfig.baseUrl)),
|
||||
registerPage: async ({ page, playkitConfig }, use) =>
|
||||
use(new RegisterPage(page, playkitConfig.baseUrl)),
|
||||
|
||||
e2eCredentials: async ({}, use) => {
|
||||
const email = process.env.E2E_ADMIN_EMAIL || process.env.E2E_EMAIL || '';
|
||||
@@ -45,10 +39,8 @@ export const test = base.extend<PunimtagFixtures>({
|
||||
await use(email && password ? { email, password } : null);
|
||||
},
|
||||
|
||||
mailtrap: async ({ playkitLog }, use) => {
|
||||
await use(
|
||||
MailtrapClient.fromEnv(process.env, playkitLog.child({ component: 'mailtrap' })),
|
||||
);
|
||||
mail: async ({ playkitLog }, use) => {
|
||||
await use(createMailInbox(process.env, playkitLog.child({ component: 'mail' })));
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user