diff options
| -rw-r--r-- | gui/test/e2e/utils.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gui/test/e2e/utils.ts b/gui/test/e2e/utils.ts index 9618136962..0c68d47d49 100644 --- a/gui/test/e2e/utils.ts +++ b/gui/test/e2e/utils.ts @@ -1,8 +1,11 @@ import { Locator, Page, _electron as electron, ElectronApplication } from 'playwright'; +export type GetByTestId = (id: string) => Locator; + export interface StartAppResponse { app: ElectronApplication; page: Page; + getByTestId: GetByTestId; } export const startApp = async (mainPath: string): Promise<StartAppResponse> => { @@ -22,7 +25,9 @@ export const startApp = async (mainPath: string): Promise<StartAppResponse> => { console.log(msg.text()); }); - return { app, page }; + const getByTestId = (id: string) => page.locator(`data-test-id=${id}`); + + return { app, page, getByTestId }; }; const getStyleProperty = (locator: Locator, property: string) => { |
