From 0acf43ad65978e24cd14b3ec281722b7b36604eb Mon Sep 17 00:00:00 2001 From: Lizaveta Korshuk Date: Thu, 2 Jul 2026 14:39:30 +0200 Subject: [PATCH] e2e-tests folder organisation --- e2e-tests/actions/connectWithUser.ts | 6 +-- e2e-tests/actions/createApp.ts | 9 +--- e2e-tests/actions/createGroup.ts | 6 +-- e2e-tests/actions/createTeam.ts | 14 +----- e2e-tests/actions/createUser.ts | 14 +----- e2e-tests/actions/index.ts | 28 +++++++++++ e2e-tests/actions/loginUser.ts | 7 +-- e2e-tests/actions/mockNotifications.ts | 2 +- e2e-tests/actions/sendConnectionRequest.ts | 6 +-- e2e-tests/actions/watchActiveAccount.ts | 2 +- e2e-tests/backend/PublicApiClient.ts | 6 +-- e2e-tests/backend/index.ts | 22 ++++++++ e2e-tests/fixtures.ts | 9 ++-- e2e-tests/poms/app/accountsSidebar.page.ts | 3 +- e2e-tests/poms/app/appIcon.page.ts | 2 +- e2e-tests/poms/app/index.ts | 21 ++++++++ e2e-tests/poms/webapp/conversation.page.ts | 2 +- e2e-tests/poms/webapp/index.ts | 32 ++++++++++++ e2e-tests/specs/criticalFlow/1on1Call.spec.ts | 7 +-- .../specs/criticalFlow/groupCall.spec.ts | 7 +-- e2e-tests/specs/criticalFlow/login.spec.ts | 6 +-- .../criticalFlow/multipleAccounts.spec.ts | 7 ++- e2e-tests/specs/criticalFlow/register.spec.ts | 21 ++++---- .../criticalFlow/sendingMessages.spec.ts | 7 +-- .../regression/multipleAccountsSuite.spec.ts | 20 ++++---- .../specs/regression/notifications.spec.ts | 12 ++--- e2e-tests/types/index.ts | 50 +++++++++++++++++++ 27 files changed, 213 insertions(+), 115 deletions(-) create mode 100644 e2e-tests/actions/index.ts create mode 100644 e2e-tests/backend/index.ts create mode 100644 e2e-tests/poms/app/index.ts create mode 100644 e2e-tests/poms/webapp/index.ts create mode 100644 e2e-tests/types/index.ts diff --git a/e2e-tests/actions/connectWithUser.ts b/e2e-tests/actions/connectWithUser.ts index e3e351e3ce8..2f7405357cb 100644 --- a/e2e-tests/actions/connectWithUser.ts +++ b/e2e-tests/actions/connectWithUser.ts @@ -19,10 +19,8 @@ import {Page} from '@playwright/test'; -import {User} from './createUser'; - -import {conversationsSidebar} from '../poms/webapp/conversationsSidebar.page'; -import {startUI} from '../poms/webapp/startUI.page'; +import {conversationsSidebar, startUI} from '../poms/webapp'; +import {User} from '../types'; export async function connectWithUser(page: Page, receiver: User) { await conversationsSidebar(page).connectButton.click(); diff --git a/e2e-tests/actions/createApp.ts b/e2e-tests/actions/createApp.ts index 9d900859514..8fe9142fd66 100644 --- a/e2e-tests/actions/createApp.ts +++ b/e2e-tests/actions/createApp.ts @@ -17,14 +17,9 @@ * */ -import {_electron as electron, ElectronApplication, Page} from '@playwright/test'; +import {_electron as electron} from '@playwright/test'; -export type App = ElectronApplication & { - /* The playwright page for the main electron window wrapping the webapp */ - wrapper: Page; - /* The playwright page for the currently shown webapp */ - page: Page; -}; +import {App} from '../types'; export const createApp = async (options: {env?: string; lang?: string; dataDir: string}): Promise => { if (!options.env) { diff --git a/e2e-tests/actions/createGroup.ts b/e2e-tests/actions/createGroup.ts index c7f56114a23..f2c44de3d98 100644 --- a/e2e-tests/actions/createGroup.ts +++ b/e2e-tests/actions/createGroup.ts @@ -17,11 +17,9 @@ * */ -import {User} from './createUser'; - import {Page} from '../fixtures'; -import {conversationsList} from '../poms/webapp/conversationList.page'; -import {groupCreationModal} from '../poms/webapp/groupCreation.modal'; +import {conversationsList, groupCreationModal} from '../poms/webapp'; +import {User} from '../types'; export const createGroup = async (page: Page, conversationName: string, users: User[]) => { await conversationsList(page).createGroupButton.click(); diff --git a/e2e-tests/actions/createTeam.ts b/e2e-tests/actions/createTeam.ts index 0b03005dd80..d4947b39564 100644 --- a/e2e-tests/actions/createTeam.ts +++ b/e2e-tests/actions/createTeam.ts @@ -19,18 +19,8 @@ import {createUser, registerUser} from './createUser'; -import {BrigApiClient} from '../backend/BrigApiClient'; -import {GalleyApiClient} from '../backend/GalleyApiClient'; -import {PublicApiClient, RegisteredUser, TeamOwner} from '../backend/PublicApiClient'; - -export type TeamRole = 'admin' | 'partner' | 'owner' | 'member'; - -export type Team = { - teamId: string; - owner: TeamOwner; - /** Add a new member to the team after its initial creation */ - addTeamMember: (member: RegisteredUser, options?: {role?: TeamRole}) => Promise; -}; +import {BrigApiClient, GalleyApiClient, PublicApiClient} from '../backend'; +import {RegisteredUser, TeamOwner, Team, TeamRole} from '../types'; export const createTeam = async ( api: {publicApi: PublicApiClient; brigApi: BrigApiClient; galleyApi: GalleyApiClient}, diff --git a/e2e-tests/actions/createUser.ts b/e2e-tests/actions/createUser.ts index a9929c8e96f..dab97a37b95 100644 --- a/e2e-tests/actions/createUser.ts +++ b/e2e-tests/actions/createUser.ts @@ -19,18 +19,8 @@ import {faker} from '@faker-js/faker'; -import {BrigApiClient} from '../backend/BrigApiClient'; -import {PublicApiClient, RegisteredUser} from '../backend/PublicApiClient'; - -export type User = { - firstName: string; - lastName: string; - username: string; - initials: string; - fullName: string; - email: string; - password: string; -}; +import {BrigApiClient, PublicApiClient} from '../backend'; +import {User, RegisteredUser} from '../types'; export const createUser = (): User => { const firstName = faker.person.firstName(); diff --git a/e2e-tests/actions/index.ts b/e2e-tests/actions/index.ts new file mode 100644 index 00000000000..c34d42f5c5b --- /dev/null +++ b/e2e-tests/actions/index.ts @@ -0,0 +1,28 @@ +/* + * Wire + * Copyright (C) 2026 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './connectWithUser'; +export * from './createApp'; +export * from './createGroup'; +export * from './createTeam'; +export * from './createUser'; +export * from './loginUser'; +export * from './mockNotifications'; +export * from './sendConnectionRequest'; +export * from './watchActiveAccount'; diff --git a/e2e-tests/actions/loginUser.ts b/e2e-tests/actions/loginUser.ts index 27d9914baf4..c5dc7991c49 100644 --- a/e2e-tests/actions/loginUser.ts +++ b/e2e-tests/actions/loginUser.ts @@ -19,11 +19,8 @@ import {Page} from '@playwright/test'; -import {User} from './createUser'; - -import {conversationsSidebar} from '../poms/webapp/conversationsSidebar.page'; -import {LOGIN_TIMEOUT, loginPage} from '../poms/webapp/login.page'; -import {ssoPage} from '../poms/webapp/sso.page'; +import {conversationsSidebar, LOGIN_TIMEOUT, loginPage, ssoPage} from '../poms/webapp'; +import {User} from '../types'; /* Visit the sso page and execute the login for the user */ export const loginUser = async (page: Page, user: User) => { diff --git a/e2e-tests/actions/mockNotifications.ts b/e2e-tests/actions/mockNotifications.ts index 2c7608df680..513adcfdc59 100644 --- a/e2e-tests/actions/mockNotifications.ts +++ b/e2e-tests/actions/mockNotifications.ts @@ -19,7 +19,7 @@ import {Page} from '@playwright/test'; -import {App} from './createApp'; +import {App} from '../types'; declare global { interface Window { diff --git a/e2e-tests/actions/sendConnectionRequest.ts b/e2e-tests/actions/sendConnectionRequest.ts index fc57118c2fd..90a418e0fcb 100644 --- a/e2e-tests/actions/sendConnectionRequest.ts +++ b/e2e-tests/actions/sendConnectionRequest.ts @@ -19,10 +19,8 @@ import {Page} from '@playwright/test'; -import {User} from './createUser'; - -import {conversationsSidebar} from '../poms/webapp/conversationsSidebar.page'; -import {startUI} from '../poms/webapp/startUI.page'; +import {conversationsSidebar, startUI} from '../poms/webapp'; +import {User} from '../types'; export async function sendConnectionRequest(page: Page, receiver: User) { await conversationsSidebar(page).connectButton.click(); diff --git a/e2e-tests/actions/watchActiveAccount.ts b/e2e-tests/actions/watchActiveAccount.ts index c572c6120a6..0cf076ec107 100644 --- a/e2e-tests/actions/watchActiveAccount.ts +++ b/e2e-tests/actions/watchActiveAccount.ts @@ -19,7 +19,7 @@ import {Page} from '@playwright/test'; -import {App} from './createApp'; +import {App} from '../types'; // eslint-disable-next-line valid-jsdoc /** diff --git a/e2e-tests/backend/PublicApiClient.ts b/e2e-tests/backend/PublicApiClient.ts index dc5b6b7dbbe..33907ef5be7 100644 --- a/e2e-tests/backend/PublicApiClient.ts +++ b/e2e-tests/backend/PublicApiClient.ts @@ -21,11 +21,7 @@ import {ok, type RequestOpts} from '@oazapfts/runtime'; import * as publicApiClient from './generated/publicApi'; -import {User} from '../actions/createUser'; - -export type RegisteredUser = User & {id: string; token: string}; - -export type TeamOwner = RegisteredUser & {teamId: string}; +import {User, RegisteredUser, TeamOwner} from '../types'; export type PublicApiClientConfig = { baseUrl: string; diff --git a/e2e-tests/backend/index.ts b/e2e-tests/backend/index.ts new file mode 100644 index 00000000000..61820590deb --- /dev/null +++ b/e2e-tests/backend/index.ts @@ -0,0 +1,22 @@ +/* + * Wire + * Copyright (C) 2026 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './BrigApiClient'; +export * from './GalleyApiClient'; +export * from './PublicApiClient'; diff --git a/e2e-tests/fixtures.ts b/e2e-tests/fixtures.ts index f0a105c8bdc..93d5cf292d5 100644 --- a/e2e-tests/fixtures.ts +++ b/e2e-tests/fixtures.ts @@ -23,12 +23,9 @@ import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; -import {createApp, type App} from './actions/createApp'; -import {createTeam, Team} from './actions/createTeam'; -import {createUser, registerUser} from './actions/createUser'; -import {BrigApiClient} from './backend/BrigApiClient'; -import {GalleyApiClient} from './backend/GalleyApiClient'; -import {PublicApiClient, RegisteredUser, TeamOwner} from './backend/PublicApiClient'; +import {createApp, createTeam, createUser, registerUser} from './actions'; +import {BrigApiClient, GalleyApiClient, PublicApiClient} from './backend'; +import {App, Team, TeamOwner, RegisteredUser} from './types'; type FixtureOptions = {appOptions: {env?: string; lang?: string}}; diff --git a/e2e-tests/poms/app/accountsSidebar.page.ts b/e2e-tests/poms/app/accountsSidebar.page.ts index 2831b14bbef..6fddc77ed0f 100644 --- a/e2e-tests/poms/app/accountsSidebar.page.ts +++ b/e2e-tests/poms/app/accountsSidebar.page.ts @@ -17,8 +17,7 @@ * */ -import {App} from '../../actions/createApp'; -import {RegisteredUser} from '../../backend/PublicApiClient'; +import {App, RegisteredUser} from '../../types'; export const accountsSidebar = (app: App) => { const sidebar = app.wrapper.getByRole('navigation', {name: 'Accounts Sidebar'}); diff --git a/e2e-tests/poms/app/appIcon.page.ts b/e2e-tests/poms/app/appIcon.page.ts index 39fbe09d216..4a1404cd612 100644 --- a/e2e-tests/poms/app/appIcon.page.ts +++ b/e2e-tests/poms/app/appIcon.page.ts @@ -17,7 +17,7 @@ * */ -import {App} from '../../actions/createApp'; +import {App} from '../../types'; export const appIcon = (app: App) => { return { diff --git a/e2e-tests/poms/app/index.ts b/e2e-tests/poms/app/index.ts new file mode 100644 index 00000000000..b13191cb604 --- /dev/null +++ b/e2e-tests/poms/app/index.ts @@ -0,0 +1,21 @@ +/* + * Wire + * Copyright (C) 2026 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './accountsSidebar.page'; +export * from './appIcon.page'; diff --git a/e2e-tests/poms/webapp/conversation.page.ts b/e2e-tests/poms/webapp/conversation.page.ts index b59dc1c375a..81ffed9375c 100644 --- a/e2e-tests/poms/webapp/conversation.page.ts +++ b/e2e-tests/poms/webapp/conversation.page.ts @@ -19,7 +19,7 @@ import {Page} from '@playwright/test'; -import {User} from '../../actions/createUser'; +import {User} from '../../types'; export const conversation = (page: Page) => { const conversationTitle = page.getByTestId('status-conversation-title-bar-label'); diff --git a/e2e-tests/poms/webapp/index.ts b/e2e-tests/poms/webapp/index.ts new file mode 100644 index 00000000000..c8852ffda39 --- /dev/null +++ b/e2e-tests/poms/webapp/index.ts @@ -0,0 +1,32 @@ +/* + * Wire + * Copyright (C) 2026 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './callCell.page'; +export * from './connectionRequest.page'; +export * from './conversation.page'; +export * from './conversationList.page'; +export * from './conversationsSidebar.page'; +export * from './emailVerification.page'; +export * from './groupCreation.modal'; +export * from './login.page'; +export * from './registration.page'; +export * from './setAccountType.page'; +export * from './setHandle.page'; +export * from './sso.page'; +export * from './startUI.page'; diff --git a/e2e-tests/specs/criticalFlow/1on1Call.spec.ts b/e2e-tests/specs/criticalFlow/1on1Call.spec.ts index afec6f92af9..bb44f122674 100644 --- a/e2e-tests/specs/criticalFlow/1on1Call.spec.ts +++ b/e2e-tests/specs/criticalFlow/1on1Call.spec.ts @@ -17,12 +17,9 @@ * */ -import {connectWithUser} from '../../actions/connectWithUser'; -import {loginUser} from '../../actions/loginUser'; +import {connectWithUser, loginUser} from '../../actions'; import {expect, test} from '../../fixtures'; -import {callCell} from '../../poms/webapp/callCell.page'; -import {conversation} from '../../poms/webapp/conversation.page'; -import {conversationsList} from '../../poms/webapp/conversationList.page'; +import {callCell, conversation, conversationsList} from '../../poms/webapp'; test( 'I want to call someone directly', diff --git a/e2e-tests/specs/criticalFlow/groupCall.spec.ts b/e2e-tests/specs/criticalFlow/groupCall.spec.ts index 23b25e1c1a9..b08b843734a 100644 --- a/e2e-tests/specs/criticalFlow/groupCall.spec.ts +++ b/e2e-tests/specs/criticalFlow/groupCall.spec.ts @@ -17,13 +17,10 @@ * */ -import {loginUser} from './../../actions/loginUser'; -import {callCell} from './../../poms/webapp/callCell.page'; -import {conversation} from './../../poms/webapp/conversation.page'; +import {loginUser, createGroup} from './../../actions'; +import {conversation, conversationsList, callCell} from './../../poms/webapp'; -import {createGroup} from '../../actions/createGroup'; import {test, expect} from '../../fixtures'; -import {conversationsList} from '../../poms/webapp/conversationList.page'; test( 'I want to have a group call', diff --git a/e2e-tests/specs/criticalFlow/login.spec.ts b/e2e-tests/specs/criticalFlow/login.spec.ts index 218ca96f9ef..cd28cc63717 100644 --- a/e2e-tests/specs/criticalFlow/login.spec.ts +++ b/e2e-tests/specs/criticalFlow/login.spec.ts @@ -17,10 +17,10 @@ * */ -import {loginUser} from '../../actions/loginUser'; +import {loginUser} from '../../actions'; import {expect, test} from '../../fixtures'; -import {accountsSidebar} from '../../poms/app/accountsSidebar.page'; -import {conversationsSidebar} from '../../poms/webapp/conversationsSidebar.page'; +import {accountsSidebar} from '../../poms/app'; +import {conversationsSidebar} from '../../poms/webapp'; test( 'I want to log in with my existing Wire account', diff --git a/e2e-tests/specs/criticalFlow/multipleAccounts.spec.ts b/e2e-tests/specs/criticalFlow/multipleAccounts.spec.ts index a9a7d18b8c8..11224409c32 100644 --- a/e2e-tests/specs/criticalFlow/multipleAccounts.spec.ts +++ b/e2e-tests/specs/criticalFlow/multipleAccounts.spec.ts @@ -17,11 +17,10 @@ * */ -import {loginUser} from '../../actions/loginUser'; +import {loginUser} from '../../actions'; import {expect, test} from '../../fixtures'; -import {accountsSidebar} from '../../poms/app/accountsSidebar.page'; -import {conversationsSidebar} from '../../poms/webapp/conversationsSidebar.page'; -import {ssoPage} from '../../poms/webapp/sso.page'; +import {accountsSidebar} from '../../poms/app'; +import {conversationsSidebar, ssoPage} from '../../poms/webapp'; test( 'I want to add multiple accounts to the app and switch between them', diff --git a/e2e-tests/specs/criticalFlow/register.spec.ts b/e2e-tests/specs/criticalFlow/register.spec.ts index 8ccbe2cc519..eca8e7eff79 100644 --- a/e2e-tests/specs/criticalFlow/register.spec.ts +++ b/e2e-tests/specs/criticalFlow/register.spec.ts @@ -17,16 +17,19 @@ * */ -import {createUser} from '../../actions/createUser'; +import {createUser} from '../../actions'; import {expect, test} from '../../fixtures'; -import {accountsSidebar} from '../../poms/app/accountsSidebar.page'; -import {conversationsSidebar} from '../../poms/webapp/conversationsSidebar.page'; -import {emailVerificationPage} from '../../poms/webapp/emailVerification.page'; -import {LOGIN_TIMEOUT, loginPage} from '../../poms/webapp/login.page'; -import {registrationPage} from '../../poms/webapp/registration.page'; -import {setAccountTypePage} from '../../poms/webapp/setAccountType.page'; -import {setHandlePage} from '../../poms/webapp/setHandle.page'; -import {ssoPage} from '../../poms/webapp/sso.page'; +import {accountsSidebar} from '../../poms/app'; +import { + conversationsSidebar, + emailVerificationPage, + LOGIN_TIMEOUT, + loginPage, + registrationPage, + setAccountTypePage, + setHandlePage, + ssoPage, +} from '../../poms/webapp'; test('I want to register a new Wire account', {tag: ['@TC-10924', '@crit-flow-desktop']}, async ({app, brigApi}) => { const user = createUser(); diff --git a/e2e-tests/specs/criticalFlow/sendingMessages.spec.ts b/e2e-tests/specs/criticalFlow/sendingMessages.spec.ts index c43b7fd5179..fd44d212203 100644 --- a/e2e-tests/specs/criticalFlow/sendingMessages.spec.ts +++ b/e2e-tests/specs/criticalFlow/sendingMessages.spec.ts @@ -17,12 +17,9 @@ * */ -import {connectWithUser} from '../../actions/connectWithUser'; -import {createGroup} from '../../actions/createGroup'; -import {loginUser} from '../../actions/loginUser'; +import {connectWithUser, createGroup, loginUser} from '../../actions'; import {test, expect} from '../../fixtures'; -import {conversation} from '../../poms/webapp/conversation.page'; -import {conversationsList} from '../../poms/webapp/conversationList.page'; +import {conversation, conversationsList} from '../../poms/webapp'; test( 'I want to exchange text messages with other users', diff --git a/e2e-tests/specs/regression/multipleAccountsSuite.spec.ts b/e2e-tests/specs/regression/multipleAccountsSuite.spec.ts index 82ec44b33b1..6b8259f6be3 100644 --- a/e2e-tests/specs/regression/multipleAccountsSuite.spec.ts +++ b/e2e-tests/specs/regression/multipleAccountsSuite.spec.ts @@ -17,17 +17,17 @@ * */ -import {createGroup} from '../../actions/createGroup'; -import {loginUser} from '../../actions/loginUser'; -import {sendConnectionRequest} from '../../actions/sendConnectionRequest'; +import {createGroup, loginUser, sendConnectionRequest} from '../../actions'; import {expect, test} from '../../fixtures'; -import {accountsSidebar} from '../../poms/app/accountsSidebar.page'; -import {connectionRequestPage} from '../../poms/webapp/connectionRequest.page'; -import {conversation} from '../../poms/webapp/conversation.page'; -import {conversationsList} from '../../poms/webapp/conversationList.page'; -import {conversationsSidebar} from '../../poms/webapp/conversationsSidebar.page'; -import {LOGIN_TIMEOUT} from '../../poms/webapp/login.page'; -import {ssoPage} from '../../poms/webapp/sso.page'; +import {accountsSidebar} from '../../poms/app'; +import { + connectionRequestPage, + conversation, + conversationsList, + conversationsSidebar, + LOGIN_TIMEOUT, + ssoPage, +} from '../../poms/webapp'; test.describe('Multiple Accounts', async () => { test('I want to remove the only account I have', {tag: ['@TC-11070', '@regression']}, async ({app, createUser}) => { diff --git a/e2e-tests/specs/regression/notifications.spec.ts b/e2e-tests/specs/regression/notifications.spec.ts index 75922a59730..35b883be213 100644 --- a/e2e-tests/specs/regression/notifications.spec.ts +++ b/e2e-tests/specs/regression/notifications.spec.ts @@ -17,16 +17,10 @@ * */ -import {connectWithUser} from '../../actions/connectWithUser'; -import {createGroup} from '../../actions/createGroup'; -import {loginUser} from '../../actions/loginUser'; -import {interceptNotifications} from '../../actions/mockNotifications'; -import {watchActiveAccount} from '../../actions/watchActiveAccount'; +import {connectWithUser, createGroup, loginUser, interceptNotifications, watchActiveAccount} from '../../actions'; import {test, expect} from '../../fixtures'; -import {accountsSidebar} from '../../poms/app/accountsSidebar.page'; -import {appIcon} from '../../poms/app/appIcon.page'; -import {conversation} from '../../poms/webapp/conversation.page'; -import {conversationsList} from '../../poms/webapp/conversationList.page'; +import {accountsSidebar, appIcon} from '../../poms/app'; +import {conversation, conversationsList} from '../../poms/webapp'; test.describe('Notifications', () => { test( diff --git a/e2e-tests/types/index.ts b/e2e-tests/types/index.ts new file mode 100644 index 00000000000..bd0130f6d06 --- /dev/null +++ b/e2e-tests/types/index.ts @@ -0,0 +1,50 @@ +/* + * Wire + * Copyright (C) 2026 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +import {ElectronApplication, Page} from '@playwright/test'; + +export type App = ElectronApplication & { + /* The playwright page for the main electron window wrapping the webapp */ + wrapper: Page; + /* The playwright page for the currently shown webapp */ + page: Page; +}; + +export type TeamRole = 'admin' | 'partner' | 'owner' | 'member'; + +export type RegisteredUser = User & {id: string; token: string}; + +export type TeamOwner = RegisteredUser & {teamId: string}; + +export type Team = { + teamId: string; + owner: TeamOwner; + /** Add a new member to the team after its initial creation */ + addTeamMember: (member: RegisteredUser, options?: {role?: TeamRole}) => Promise; +}; + +export type User = { + firstName: string; + lastName: string; + username: string; + initials: string; + fullName: string; + email: string; + password: string; +};