Adding tests set nickname, call checks, change profile picture on linked device and unsend message check. Adding into data-testids for aforementioned tests and cleaning up typings
parent
eeb6cfb435
commit
9e3a569fac
@ -0,0 +1,27 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { sleepFor } from '../../session/utils/Promise';
|
||||
import { newUser } from './setup/new_user';
|
||||
import { openApp } from './setup/open';
|
||||
import { createContact } from './utilities/create_contact';
|
||||
import { clickOnMatchingText, clickOnTestIdWithText } from './utilities/utils';
|
||||
|
||||
test('Voice calls', async () => {
|
||||
const [windowA, windowB] = await openApp(2);
|
||||
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowB, 'Bob')]);
|
||||
|
||||
await createContact(windowA, windowB, userA, userB);
|
||||
await clickOnTestIdWithText(windowA, 'call-button');
|
||||
await clickOnTestIdWithText(windowA, 'session-toast');
|
||||
await clickOnTestIdWithText(windowA, 'enable-calls');
|
||||
await clickOnTestIdWithText(windowA, 'session-confirm-ok-button');
|
||||
await clickOnTestIdWithText(windowA, 'message-section');
|
||||
await clickOnTestIdWithText(windowA, 'module-conversation__user__profile-name', userB.userName);
|
||||
await clickOnTestIdWithText(windowA, 'call-button');
|
||||
// Enable calls in window B
|
||||
await clickOnTestIdWithText(windowB, 'session-toast');
|
||||
await clickOnTestIdWithText(windowB, 'enable-calls');
|
||||
await clickOnTestIdWithText(windowB, 'session-confirm-ok-button');
|
||||
await clickOnMatchingText(windowB, 'Accept');
|
||||
await sleepFor(5000);
|
||||
await clickOnTestIdWithText(windowA, 'end-call');
|
||||
});
|
@ -0,0 +1,70 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { sleepFor } from '../../session/utils/Promise';
|
||||
import { beforeAllClean } from './setup/beforeEach';
|
||||
import { createGroup } from './setup/create_group';
|
||||
import { newUser } from './setup/new_user';
|
||||
import { openApp } from './setup/open';
|
||||
import { leaveGroup } from './utilities/leave_group';
|
||||
import { linkedDevice } from './utilities/linked_device';
|
||||
import {
|
||||
clickOnTestIdWithText,
|
||||
waitForControlMessageWithText,
|
||||
waitForTestIdWithText,
|
||||
} from './utilities/utils';
|
||||
|
||||
test.beforeEach(beforeAllClean);
|
||||
|
||||
test('Check group syncs', async () => {
|
||||
const [windowA, windowC, windowD] = await openApp(3);
|
||||
const [userA, userB, userC] = await Promise.all([
|
||||
newUser(windowA, 'Alice'),
|
||||
newUser(windowC, 'Bob'),
|
||||
newUser(windowD, 'Chloe'),
|
||||
]);
|
||||
const [windowB] = await linkedDevice(userA.recoveryPhrase);
|
||||
|
||||
const group = await createGroup(
|
||||
'Tiny Bubble Gang',
|
||||
userA,
|
||||
windowA,
|
||||
userB,
|
||||
windowC,
|
||||
userC,
|
||||
windowD
|
||||
);
|
||||
// Check group conversation is in conversation list
|
||||
await waitForTestIdWithText(windowB, 'module-conversation__user__profile-name', group.userName);
|
||||
});
|
||||
|
||||
test('Check leaving group syncs', async () => {
|
||||
const [windowA, windowC, windowD] = await openApp(3);
|
||||
const [userA, userB, userC] = await Promise.all([
|
||||
newUser(windowA, 'Alice'),
|
||||
newUser(windowC, 'Bob'),
|
||||
newUser(windowD, 'Chloe'),
|
||||
]);
|
||||
const [windowB] = await linkedDevice(userA.recoveryPhrase);
|
||||
|
||||
const group = await createGroup(
|
||||
'Tiny Bubble Gang',
|
||||
userA,
|
||||
windowA,
|
||||
userB,
|
||||
windowC,
|
||||
userC,
|
||||
windowD
|
||||
);
|
||||
// Check group conversation is in conversation list
|
||||
await waitForTestIdWithText(windowB, 'module-conversation__user__profile-name', group.userName);
|
||||
// User C to leave group
|
||||
await leaveGroup(windowD);
|
||||
// Check for user A
|
||||
await sleepFor(1000);
|
||||
await clickOnTestIdWithText(windowA, 'module-conversation__user__profile-name', group.userName);
|
||||
await waitForControlMessageWithText(windowA, `"${userC.userName}" has left the group.`);
|
||||
// Check for linked device (userA)
|
||||
await clickOnTestIdWithText(windowB, 'module-conversation__user__profile-name', group.userName);
|
||||
await waitForControlMessageWithText(windowB, `"${userC.userName}" has left the group.`);
|
||||
// Check for user B
|
||||
await waitForControlMessageWithText(windowC, `"${userC.userName}" has left the group.`);
|
||||
});
|
@ -0,0 +1,62 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { beforeAllClean } from './setup/beforeEach';
|
||||
// import { leaveGroup } from './utilities/leave_group';
|
||||
import { newUser } from './setup/new_user';
|
||||
import { openApp } from './setup/open';
|
||||
import { linkedDevice } from './utilities/linked_device';
|
||||
import { sendMessage } from './utilities/message';
|
||||
import { sendNewMessage } from './utilities/send_message';
|
||||
import {
|
||||
clickOnTestIdWithText,
|
||||
waitForMatchingText,
|
||||
waitForTestIdWithText,
|
||||
waitForTextMessage,
|
||||
} from './utilities/utils';
|
||||
|
||||
test.beforeEach(beforeAllClean);
|
||||
|
||||
test('Accept request syncs', async () => {
|
||||
const [windowA, windowB] = await openApp(2);
|
||||
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowB, 'Bob')]);
|
||||
const [windowC] = await linkedDevice(userB.recoveryPhrase);
|
||||
|
||||
const testMessage = `${userA.userName} sending message request to ${userB.userName}`;
|
||||
const testReply = `${userB.userName} accepting message request from ${userA.userName}`;
|
||||
await sendNewMessage(windowA, userB.sessionid, testMessage);
|
||||
// Accept request in windowB
|
||||
await clickOnTestIdWithText(windowB, 'message-request-banner');
|
||||
await clickOnTestIdWithText(windowC, 'message-request-banner');
|
||||
await clickOnTestIdWithText(windowB, 'module-conversation__user__profile-name', userA.userName);
|
||||
await clickOnTestIdWithText(windowB, 'accept-message-request');
|
||||
await waitForTestIdWithText(
|
||||
windowB,
|
||||
'control-message',
|
||||
`You have accepted ${userA.userName}'s message request`
|
||||
);
|
||||
await waitForMatchingText(windowB, 'No pending message requests');
|
||||
await waitForMatchingText(windowC, 'No pending message requests');
|
||||
await sendMessage(windowB, testReply);
|
||||
await waitForTextMessage(windowA, testReply);
|
||||
await clickOnTestIdWithText(windowC, 'new-conversation-button');
|
||||
await waitForTestIdWithText(windowC, 'module-conversation__user__profile-name', userA.userName);
|
||||
});
|
||||
|
||||
test('Decline request syncs', async () => {
|
||||
const [windowA, windowB] = await openApp(2);
|
||||
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowB, 'Bob')]);
|
||||
const [windowC] = await linkedDevice(userB.recoveryPhrase);
|
||||
|
||||
const testMessage = `${userA.userName} sending message request to ${userB.userName}`;
|
||||
await sendNewMessage(windowA, userB.sessionid, testMessage);
|
||||
// Accept request in windowB
|
||||
await clickOnTestIdWithText(windowB, 'message-request-banner');
|
||||
await clickOnTestIdWithText(windowB, 'module-conversation__user__profile-name', userA.userName);
|
||||
await clickOnTestIdWithText(windowC, 'message-request-banner');
|
||||
await waitForTestIdWithText(windowC, 'module-conversation__user__profile-name', userA.userName);
|
||||
await clickOnTestIdWithText(windowB, 'decline-message-request');
|
||||
await clickOnTestIdWithText(windowB, 'session-confirm-ok-button', 'Decline');
|
||||
await waitForTestIdWithText(windowB, 'session-toast', 'Blocked');
|
||||
|
||||
await waitForMatchingText(windowB, 'No pending message requests');
|
||||
await waitForMatchingText(windowC, 'No pending message requests');
|
||||
});
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -1,10 +1,20 @@
|
||||
import { _electron, Page } from '@playwright/test';
|
||||
import { clickOnTestIdWithText, typeIntoInput } from '../utilities/utils';
|
||||
import { Page } from '@playwright/test';
|
||||
import {
|
||||
clickOnTestIdWithText,
|
||||
hasElementPoppedUpThatShouldnt,
|
||||
typeIntoInput,
|
||||
waitForLoadingAnimationToFinish,
|
||||
} from '../utilities/utils';
|
||||
|
||||
export async function logIn(window: Page, recoveryPhrase: string) {
|
||||
await clickOnTestIdWithText(window, 'link-device');
|
||||
await typeIntoInput(window, 'recovery-phrase-input', recoveryPhrase);
|
||||
await clickOnTestIdWithText(window, 'continue-session-button');
|
||||
|
||||
return { window };
|
||||
await waitForLoadingAnimationToFinish(window, 'loading-spinner', 5000);
|
||||
await hasElementPoppedUpThatShouldnt(
|
||||
window,
|
||||
'data-testid',
|
||||
'session-toast',
|
||||
'Could not find your display name. Please Sign In by Restoring Your Account instead.'
|
||||
);
|
||||
}
|
||||
|
@ -1,38 +0,0 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { beforeAllClean } from './setup/beforeEach';
|
||||
import { newUser } from './setup/new_user';
|
||||
import { openApp } from './setup/open';
|
||||
import { sendNewMessage } from './utilities/send_message';
|
||||
import {
|
||||
clickOnMatchingText,
|
||||
clickOnTestIdWithText,
|
||||
waitForMatchingText,
|
||||
waitForTestIdWithText,
|
||||
} from './utilities/utils';
|
||||
|
||||
const testMessage = 'A -> B: ';
|
||||
const testReply = 'B -> A: ';
|
||||
|
||||
test.beforeEach(beforeAllClean);
|
||||
|
||||
// test.afterEach(() => forceCloseAllWindows(windows));
|
||||
|
||||
test('Unsend message', async () => {
|
||||
// Open App
|
||||
const [windowA, windowB] = await openApp(2);
|
||||
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowB, 'Bob')]);
|
||||
// Send message between two users
|
||||
await sendNewMessage(windowA, userB.sessionid, `${testMessage}${Date.now()}`);
|
||||
await sendNewMessage(windowB, userA.sessionid, `${testReply}${Date.now()}`);
|
||||
// Unsend message from User A to User B
|
||||
// Right click on message
|
||||
await windowA.click('.module-message.module-message--outgoing', { button: 'right' });
|
||||
// Select delete for everyone
|
||||
await clickOnMatchingText(windowA, 'Delete for everyone');
|
||||
// Select delete for everyone confirmation
|
||||
await clickOnTestIdWithText(windowA, 'session-confirm-ok-button', 'Delete for everyone');
|
||||
// Check that toast notification opens and says 'deleted'
|
||||
await waitForTestIdWithText(windowA, 'session-toast', 'Deleted');
|
||||
// Check that message is deleted in receivers window
|
||||
await waitForMatchingText(windowB, 'This message has been deleted');
|
||||
});
|
Loading…
Reference in New Issue