|
| 1 | +/* |
| 2 | + * Wire |
| 3 | + * Copyright (C) 2025 Wire Swiss GmbH |
| 4 | + * |
| 5 | + * This program is free software: you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation, either version 3 of the License, or |
| 8 | + * (at your option) any later version. |
| 9 | + * |
| 10 | + * This program is distributed in the hope that it will be useful, |
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + * GNU General Public License for more details. |
| 14 | + * |
| 15 | + * You should have received a copy of the GNU General Public License |
| 16 | + * along with this program. If not, see http://www.gnu.org/licenses/. |
| 17 | + * |
| 18 | + */ |
| 19 | + |
| 20 | +import {User} from 'test/e2e_tests/data/user'; |
| 21 | +import {PageManager} from 'test/e2e_tests/pageManager'; |
| 22 | +import {test, expect, withLogin} from 'test/e2e_tests/test.fixtures'; |
| 23 | +import {connectWithUser} from 'test/e2e_tests/utils/userActions'; |
| 24 | + |
| 25 | +test.describe('Cross Platform', () => { |
| 26 | + let userA: User; |
| 27 | + let userB: User; |
| 28 | + |
| 29 | + test.beforeEach(async ({createTeam, createUser}) => { |
| 30 | + userB = await createUser(); |
| 31 | + const team = await createTeam('Test Team', {users: [userB]}); |
| 32 | + userA = team.owner; |
| 33 | + }); |
| 34 | + |
| 35 | + test( |
| 36 | + 'Verify you can see location sent from mobile and delete it from conversation view', |
| 37 | + {tag: ['@TC-1280', '@regression']}, |
| 38 | + async ({createPage, api}) => { |
| 39 | + const userAPage = await createPage(withLogin(userA)); |
| 40 | + const userBPage = await createPage(withLogin(userB)); |
| 41 | + await connectWithUser(userAPage, userB); |
| 42 | + |
| 43 | + const userAPages = PageManager.from(userAPage).webapp.pages; |
| 44 | + const userBPages = PageManager.from(userBPage).webapp.pages; |
| 45 | + |
| 46 | + await test.step('User A sends location to User B via second device', async () => { |
| 47 | + const {instanceId} = await api.testService.createInstance( |
| 48 | + userA.password, |
| 49 | + userA.email, |
| 50 | + 'Test Service Device', |
| 51 | + false, |
| 52 | + ); |
| 53 | + const conversationId = await api.conversation.getConversationWithUser(userA.token, userB.id!); |
| 54 | + if (conversationId === undefined) throw new Error("Couldn't find conversation of userA with userB"); |
| 55 | + await api.testService.sendLocation(instanceId, conversationId, { |
| 56 | + locationName: 'Test Location', |
| 57 | + latitude: 52.5170365, |
| 58 | + longitude: 13.404954, |
| 59 | + zoom: 42, |
| 60 | + }); |
| 61 | + }); |
| 62 | + |
| 63 | + await userAPages.conversationList().getConversation(userB.fullName, {protocol: 'mls'}).open(); |
| 64 | + await userBPages.conversationList().getConversation(userA.fullName, {protocol: 'mls'}).open(); |
| 65 | + |
| 66 | + const messageWithLocationShare = userAPages.conversation().getMessage({sender: userA}); |
| 67 | + await expect(messageWithLocationShare).toBeVisible(); |
| 68 | + |
| 69 | + const messageFromUserA = userBPages.conversation().getMessage({sender: userA}); |
| 70 | + await expect(messageFromUserA).toBeVisible(); |
| 71 | + |
| 72 | + await userAPages.conversation().deleteMessage(messageWithLocationShare, 'Everyone'); |
| 73 | + |
| 74 | + await expect(messageWithLocationShare).not.toBeVisible(); |
| 75 | + await expect(messageFromUserA).not.toBeVisible(); |
| 76 | + }, |
| 77 | + ); |
| 78 | +}); |
0 commit comments