Adds data-testid to loading-animation, microphone recording button, recording permissions button, stop recording button, consolidates tests into user actions test, adds media to fixtures folder, updates linked device tests with avatar change, username change and group tests. Adds tests for messaging, sending image, video, document, gif and link with preview. Also updates reply message functionality to wait for loading animation
2023-05-01 05:43:19 +02:00
|
|
|
import { sleepFor } from '../../session/utils/Promise';
|
|
|
|
import { newUser } from './setup/new_user';
|
2023-05-16 01:45:58 +02:00
|
|
|
import { sessionTestTwoWindows } from './setup/sessionTest';
|
2023-05-17 03:26:10 +02:00
|
|
|
import { createContact } from './utilities/create_contact';
|
Adds data-testid to loading-animation, microphone recording button, recording permissions button, stop recording button, consolidates tests into user actions test, adds media to fixtures folder, updates linked device tests with avatar change, username change and group tests. Adds tests for messaging, sending image, video, document, gif and link with preview. Also updates reply message functionality to wait for loading animation
2023-05-01 05:43:19 +02:00
|
|
|
import { sendMessage } from './utilities/message';
|
2022-05-17 05:22:13 +02:00
|
|
|
import {
|
|
|
|
clickOnTestIdWithText,
|
2023-05-31 08:23:30 +02:00
|
|
|
hasTextElementBeenDeleted,
|
2022-05-17 05:22:13 +02:00
|
|
|
waitForMatchingText,
|
|
|
|
waitForTestIdWithText,
|
2023-04-06 08:34:58 +02:00
|
|
|
} from './utilities/utils';
|
2022-05-17 05:22:13 +02:00
|
|
|
|
|
|
|
const testMessage = 'Test-Message- (A -> B) ';
|
|
|
|
const sentMessage = `${testMessage}${Date.now()}`;
|
|
|
|
|
2023-05-16 01:45:58 +02:00
|
|
|
sessionTestTwoWindows('Disappearing messages', async ([windowA, windowB]) => {
|
2022-05-17 05:22:13 +02:00
|
|
|
// Open App
|
|
|
|
// Create User
|
Adds data-testid to loading-animation, microphone recording button, recording permissions button, stop recording button, consolidates tests into user actions test, adds media to fixtures folder, updates linked device tests with avatar change, username change and group tests. Adds tests for messaging, sending image, video, document, gif and link with preview. Also updates reply message functionality to wait for loading animation
2023-05-01 05:43:19 +02:00
|
|
|
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowB, 'Bob')]);
|
2022-05-17 05:22:13 +02:00
|
|
|
// Create Contact
|
2023-05-31 08:23:30 +02:00
|
|
|
await createContact(windowA, windowB, userA, userB);
|
|
|
|
// Need to wait for contact approval
|
|
|
|
await sleepFor(5000);
|
2022-05-17 05:22:13 +02:00
|
|
|
// Click on user's avatar to open conversation options
|
|
|
|
await clickOnTestIdWithText(windowA, 'conversation-options-avatar');
|
2023-07-05 06:13:25 +02:00
|
|
|
await waitForMatchingText(windowA, 'Your message request has been accepted');
|
2022-05-17 05:22:13 +02:00
|
|
|
// Select disappearing messages drop down
|
2023-07-05 06:13:25 +02:00
|
|
|
await clickOnTestIdWithText(windowA, 'disappearing-messages-dropdown', 'Disappearing messages');
|
2022-05-17 05:22:13 +02:00
|
|
|
// Select 5 seconds
|
2023-07-05 06:13:25 +02:00
|
|
|
await sleepFor(200);
|
|
|
|
await clickOnTestIdWithText(windowA, 'dropdownitem-5-seconds', '5 seconds');
|
2022-05-17 05:22:13 +02:00
|
|
|
// Click chevron to close menu
|
|
|
|
await clickOnTestIdWithText(windowA, 'back-button-conversation-options');
|
|
|
|
// Check config message
|
|
|
|
await waitForTestIdWithText(
|
|
|
|
windowA,
|
Adds data-testid to loading-animation, microphone recording button, recording permissions button, stop recording button, consolidates tests into user actions test, adds media to fixtures folder, updates linked device tests with avatar change, username change and group tests. Adds tests for messaging, sending image, video, document, gif and link with preview. Also updates reply message functionality to wait for loading animation
2023-05-01 05:43:19 +02:00
|
|
|
'control-message',
|
2022-05-17 05:22:13 +02:00
|
|
|
'You set the disappearing message timer to 5 seconds'
|
|
|
|
);
|
2023-05-31 08:23:30 +02:00
|
|
|
await waitForTestIdWithText(
|
|
|
|
windowB,
|
|
|
|
'control-message',
|
|
|
|
`${userA.userName} set the disappearing message timer to 5 seconds`
|
|
|
|
);
|
|
|
|
await sleepFor(500);
|
2022-05-17 05:22:13 +02:00
|
|
|
// Check top right hand corner indicator
|
|
|
|
await waitForTestIdWithText(windowA, 'disappearing-messages-indicator', '5 seconds');
|
|
|
|
// Send message
|
Adds data-testid to loading-animation, microphone recording button, recording permissions button, stop recording button, consolidates tests into user actions test, adds media to fixtures folder, updates linked device tests with avatar change, username change and group tests. Adds tests for messaging, sending image, video, document, gif and link with preview. Also updates reply message functionality to wait for loading animation
2023-05-01 05:43:19 +02:00
|
|
|
await sendMessage(windowA, sentMessage);
|
2022-05-17 05:22:13 +02:00
|
|
|
// Check timer is functioning
|
2023-05-31 08:23:30 +02:00
|
|
|
await sleepFor(6000);
|
2022-05-17 05:22:13 +02:00
|
|
|
// Verify message is deleted
|
2023-05-31 08:23:30 +02:00
|
|
|
await hasTextElementBeenDeleted(windowA, sentMessage, 3000);
|
|
|
|
// focus window B
|
2023-06-05 05:32:07 +02:00
|
|
|
await windowA.close();
|
|
|
|
await windowB.bringToFront();
|
2023-08-07 08:13:01 +02:00
|
|
|
await clickOnTestIdWithText(
|
2022-05-17 05:22:13 +02:00
|
|
|
windowB,
|
2023-08-07 08:13:01 +02:00
|
|
|
'control-message',
|
2022-05-17 05:22:13 +02:00
|
|
|
`${userA.userName} set the disappearing message timer to 5 seconds`
|
|
|
|
);
|
2023-06-05 05:32:07 +02:00
|
|
|
await hasTextElementBeenDeleted(windowB, sentMessage, 5000);
|
2022-05-17 05:22:13 +02:00
|
|
|
});
|