1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-25 21:24:50 +02:00
Files
misskey/packages/frontend/test/e2e/utils.ts
syuilo 3c1f01af10 feat(dev): frontend browser metrics report (#17630)
* wip

* Update measure-frontend-browser-comparison.mts

* Update frontend-browser-report.mts

* Update frontend-browser-report.mts

* Update frontend-browser-report.mts

* Update frontend-browser-report.mts

* Update frontend-browser-report.mts

* Update frontend-browser-report.mts

* Update frontend-browser-report.mts

* refactor

* fix

* Update chrome.mts

* refactor

* wip

* fix

* Update frontend-browser-metrics-report.yml

* Update frontend-browser-report.mts

* refactor

* wip

* Update frontend-browser-report.mts

* wip

* wip

* wip

* Revert "wip"

This reverts commit ce7657081b.

* Update frontend-browser-metrics-report.yml

* Update frontend-browser-report.mts

* Update frontend-browser-report.mts

* Update frontend-browser-report.mts

* playwright

* Update chrome.mts

* refactor

* wip

* Update measure-frontend-browser-comparison.mts

* clean up

* Update measure-frontend-browser-comparison.mts

* fix

* Update chrome.mts

* refactor

* Update frontend-browser-metrics-report.yml
2026-07-16 10:21:30 +09:00

53 lines
1.3 KiB
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { Page } from 'playwright';
import {
registerUser as registerUserWithBaseUrl,
resetState as resetStateWithBaseUrl,
signIn as signInWithBaseUrl,
visitHome as visitHomeWithBaseUrl,
} from './shared.js';
export type { RegisteredUser } from './shared.js';
export {
ADMIN_SETUP_PASSWORD,
DEFAULT_INVITATION_CODE,
acceptSignupRules,
assertOk,
closeUserSetupDialog,
closeUserSetupDialogIfVisible,
locateMkInput,
locateMkSwitch,
locateMkTextarea,
postNote,
waitApiResponse,
} from './shared.js';
export const BASE_URL = 'http://localhost:61812';
//#region Misc
export async function resetState(): Promise<void> {
await resetStateWithBaseUrl(BASE_URL);
}
export async function registerUser(
username: string,
password: string,
isAdmin = false,
): ReturnType<typeof registerUserWithBaseUrl> {
return registerUserWithBaseUrl(BASE_URL, username, password, isAdmin);
}
//#endregion
//#region Page Helpers
export async function visitHome(page: Page): Promise<void> {
await visitHomeWithBaseUrl(page, BASE_URL);
}
export async function signIn(page: Page, username: string, password: string): Promise<void> {
await signInWithBaseUrl(page, BASE_URL, username, password);
}
//#endregion