Remove look for text in blocked user test and updated disappearing message test

pull/2756/head
Emily 3 years ago
parent 37639077a1
commit eeb94b937e

@ -29,7 +29,7 @@ sessionTestTwoWindows('Disappearing messages', async ([windowA, windowB]) => {
// await waitForMatchingText(windowA, `You have accepted ${userA.userName}'s message request`); // await waitForMatchingText(windowA, `You have accepted ${userA.userName}'s message request`);
// await waitForMatchingText(windowB, 'Your message request has been accepted'); // await waitForMatchingText(windowB, 'Your message request has been accepted');
// Click on user's avatar to open conversation options // Click on user's avatar to open conversation options
await clickOnTestIdWithText(windowA, 'conversation-options-avatar'); await clickOnTestIdWithText(windowA, 'conversation-options-avatar')
// Select disappearing messages drop down // Select disappearing messages drop down
await clickOnMatchingText(windowA, 'Disappearing messages'); await clickOnMatchingText(windowA, 'Disappearing messages');
// Select 5 seconds // Select 5 seconds

@ -12,10 +12,9 @@ import {
clickOnTestIdWithText, clickOnTestIdWithText,
hasTextElementBeenDeleted, hasTextElementBeenDeleted,
typeIntoInput, typeIntoInput,
waitForLoadingAnimationToFinish,
waitForMatchingText, waitForMatchingText,
waitForTestIdWithText, waitForTestIdWithText,
waitForTextMessage, waitForTextMessage
} from './utilities/utils'; } from './utilities/utils';
const windows: Array<Page> = []; const windows: Array<Page> = [];
@ -96,12 +95,10 @@ test('Check profile picture syncs', async () => {
expect(screenshot).toMatchSnapshot({ name: 'avatar-updated-blue.jpeg' }); expect(screenshot).toMatchSnapshot({ name: 'avatar-updated-blue.jpeg' });
}); });
test('Check contacts sync', async () => { test('Check contacts syncs', async () => {
const [windowA, windowC] = await openApp(2); // not using sessionTest here as we need to close and reopen one of the window const [windowA, windowC] = await openApp(2); // not using sessionTest here as we need to close and reopen one of the window
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowC, 'Bob')]); const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowC, 'Bob')]);
const [windowB] = await linkedDevice(userA.recoveryPhrase); // not using sessionTest here as we need to close and reopen one of the window const [windowB] = await linkedDevice(userA.recoveryPhrase); // not using sessionTest here as we need to close and reopen one of the window
// Waiting for linked device to finish loading
await waitForLoadingAnimationToFinish(windowB, 'loading-spinner');
await createContact(windowA, windowC, userA, userB); await createContact(windowA, windowC, userA, userB);
// Check linked device (windowB) // Check linked device (windowB)
await waitForTestIdWithText(windowB, 'module-conversation__user__profile-name', userB.userName); await waitForTestIdWithText(windowB, 'module-conversation__user__profile-name', userB.userName);
@ -113,7 +110,6 @@ test('Check deleted message syncs', async () => {
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowC, 'Bob')]); const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowC, 'Bob')]);
const [windowB] = await linkedDevice(userA.recoveryPhrase); const [windowB] = await linkedDevice(userA.recoveryPhrase);
const deletedMessage = 'Testing deletion functionality for linked device'; const deletedMessage = 'Testing deletion functionality for linked device';
await waitForLoadingAnimationToFinish(windowB, 'loading-spinner');
await createContact(windowA, windowC, userA, userB); await createContact(windowA, windowC, userA, userB);
await sendMessage(windowA, deletedMessage); await sendMessage(windowA, deletedMessage);
// Navigate to conversation on linked device and check for message from user A to user B // Navigate to conversation on linked device and check for message from user A to user B
@ -138,7 +134,6 @@ test('Check unsent message syncs', async () => {
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowC, 'Bob')]); const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowC, 'Bob')]);
const [windowB] = await linkedDevice(userA.recoveryPhrase); const [windowB] = await linkedDevice(userA.recoveryPhrase);
const unsentMessage = 'Testing unsending functionality for linked device'; const unsentMessage = 'Testing unsending functionality for linked device';
await waitForLoadingAnimationToFinish(windowB, 'loading-spinner');
await createContact(windowA, windowC, userA, userB); await createContact(windowA, windowC, userA, userB);
await sendMessage(windowA, unsentMessage); await sendMessage(windowA, unsentMessage);
// Navigate to conversation on linked device and check for message from user A to user B // Navigate to conversation on linked device and check for message from user A to user B
@ -155,24 +150,23 @@ test('Check unsent message syncs', async () => {
await hasTextElementBeenDeleted(windowB, unsentMessage, 1000); await hasTextElementBeenDeleted(windowB, unsentMessage, 1000);
}); });
// test('Check blocked user syncs', async () => { test('Check blocked user syncs', async () => {
// const [windowA, windowC] = await openApp(2); const [windowA, windowC] = await openApp(2);
// const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowC, 'Bob')]); const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowC, 'Bob')]);
// const [windowB] = await linkedDevice(userA.recoveryPhrase); const [windowB] = await linkedDevice(userA.recoveryPhrase);
// const testMessage = 'Testing blocking functionality for linked device'; const testMessage = 'Testing blocking functionality for linked device';
// await waitForLoadingAnimationToFinish(windowB, 'loading-spinner'); await createContact(windowA, windowC, userA, userB);
// await createContact(windowA, windowC, userA, userB); await sendMessage(windowA, testMessage);
// await sendMessage(windowA, testMessage); // Navigate to conversation on linked device and check for message from user A to user B
// // Navigate to conversation on linked device and check for message from user A to user B await clickOnTestIdWithText(windowB, 'module-conversation__user__profile-name', userB.userName);
// await clickOnTestIdWithText(windowB, 'module-conversation__user__profile-name', userB.userName); await clickOnElement(windowA, 'data-testid', 'three-dots-conversation-options');
// await clickOnElement(windowA, 'data-testid', 'three-dots-conversation-options'); await clickOnMatchingText(windowA, 'Block');
// await clickOnMatchingText(windowA, 'Block'); await waitForTestIdWithText(windowA, 'session-toast', 'Blocked');
// await waitForTestIdWithText(windowA, 'session-toast', 'Blocked'); // await waitForMatchingText(windowA, 'Unblock this contact to send a message.');
// await waitForMatchingText(windowA, 'Unblock this contact to send a message.'); // Check linked device for blocked contact in settings screen
// // Check linked device for blocked contact in settings screen await clickOnTestIdWithText(windowB, 'settings-section');
// await clickOnTestIdWithText(windowB, 'settings-section'); await clickOnTestIdWithText(windowB, 'conversations-settings-menu-item');
// await clickOnTestIdWithText(windowB, 'conversations-settings-menu-item'); await clickOnTestIdWithText(windowB, 'reveal-blocked-user-settings');
// await clickOnTestIdWithText(windowB, 'reveal-blocked-user-settings'); // Check if user B is in blocked contact list
// // Check if user B is in blocked contact list await waitForMatchingText(windowB, userB.userName);
// await waitForMatchingText(windowB, userB.userName); });
// });

Loading…
Cancel
Save