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
2 years ago
|
|
|
import { test } from '@playwright/test';
|
|
|
|
import { beforeAllClean } from './setup/beforeEach';
|
|
|
|
import { newUser } from './setup/new_user';
|
|
|
|
import { sessionTestTwoWindows } from './setup/sessionTest';
|
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
2 years ago
|
|
|
import { sendMessage } from './utilities/message';
|
|
|
|
import { sendNewMessage } from './utilities/send_message';
|
|
|
|
import {
|
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
2 years ago
|
|
|
clickOnMatchingText,
|
|
|
|
clickOnTestIdWithText,
|
|
|
|
waitForMatchingText,
|
|
|
|
waitForMessageRequestWithText,
|
|
|
|
} from './utilities/utils';
|
|
|
|
|
|
|
|
test.beforeEach(beforeAllClean);
|
|
|
|
|
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
2 years ago
|
|
|
// test.afterEach(() => forceCloseAllWindows(windows));
|
|
|
|
// Open two windows and log into 2 separate accounts
|
|
|
|
test.describe('Message requests', () => {
|
|
|
|
sessionTestTwoWindows('Message requests accept', async ([windowA, windowB]) => {
|
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
2 years ago
|
|
|
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowB, 'Bob')]);
|
|
|
|
const testMessage = `Sender: ${userA.userName} Receiver: ${userB.userName}`;
|
|
|
|
// send a message to User B from User A
|
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
2 years ago
|
|
|
await sendNewMessage(windowA, userB.sessionid, `${testMessage}`);
|
|
|
|
// Check the message request banner appears and click on it
|
|
|
|
await clickOnTestIdWithText(windowB, 'message-request-banner');
|
|
|
|
// Select message request from User A
|
|
|
|
await clickOnTestIdWithText(windowB, 'module-conversation__user__profile-name', userA.userName);
|
|
|
|
// Check that using the accept button has intended use
|
|
|
|
await clickOnTestIdWithText(windowB, 'accept-message-request');
|
|
|
|
// Check config message of message request acceptance
|
|
|
|
await waitForMessageRequestWithText(
|
|
|
|
windowB,
|
|
|
|
`You have accepted ${userA.userName}'s message request`
|
|
|
|
);
|
|
|
|
await waitForMatchingText(windowB, 'No pending message requests');
|
|
|
|
});
|
|
|
|
sessionTestTwoWindows('Message requests text reply', async ([windowA, windowB]) => {
|
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
2 years ago
|
|
|
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowB, 'Bob')]);
|
|
|
|
const testMessage = `Sender: ${userA.userName}, Receiver: ${userB.userName}`;
|
|
|
|
const testReply = `Sender: ${userB.userName}, Receiver: ${userA.userName}`;
|
|
|
|
// send a message to User B from User A
|
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
2 years ago
|
|
|
await sendNewMessage(windowA, userB.sessionid, `${testMessage}`);
|
|
|
|
// Check the message request banner appears and click on it
|
|
|
|
await clickOnTestIdWithText(windowB, 'message-request-banner');
|
|
|
|
// Select message request from User A
|
|
|
|
await clickOnTestIdWithText(windowB, 'module-conversation__user__profile-name', userA.userName);
|
|
|
|
// Check that using the accept button has intended use
|
|
|
|
await sendMessage(windowB, testReply);
|
|
|
|
// Check config message of message request acceptance
|
|
|
|
await waitForMessageRequestWithText(
|
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
2 years ago
|
|
|
windowB,
|
|
|
|
`You have accepted ${userA.userName}'s message request`
|
|
|
|
);
|
|
|
|
await waitForMatchingText(windowB, 'No pending message requests');
|
|
|
|
});
|
|
|
|
sessionTestTwoWindows('Message requests decline', async ([windowA, windowB]) => {
|
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
2 years ago
|
|
|
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowB, 'Bob')]);
|
|
|
|
const testMessage = `Sender: ${userA.userName}, Receiver: ${userB.userName}`;
|
|
|
|
// send a message to User B from User A
|
|
|
|
await sendNewMessage(windowA, userB.sessionid, `${testMessage}`);
|
|
|
|
// Check the message request banner appears and click on it
|
|
|
|
await clickOnTestIdWithText(windowB, 'message-request-banner');
|
|
|
|
// Select message request from User A
|
|
|
|
await clickOnTestIdWithText(windowB, 'module-conversation__user__profile-name', userA.userName);
|
|
|
|
// Check that using the accept button has intended use
|
|
|
|
await clickOnTestIdWithText(windowB, 'decline-message-request');
|
|
|
|
// Confirm decline
|
|
|
|
await clickOnTestIdWithText(windowB, 'session-confirm-ok-button', 'Decline');
|
|
|
|
// Check config message of message request acceptance
|
|
|
|
await waitForMatchingText(windowB, 'No pending message requests');
|
|
|
|
});
|
|
|
|
sessionTestTwoWindows('Message requests clear all', async ([windowA, windowB]) => {
|
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
2 years ago
|
|
|
const [userA, userB] = await Promise.all([newUser(windowA, 'Alice'), newUser(windowB, 'Bob')]);
|
|
|
|
const testMessage = `Sender: ${userA.userName}, Receiver: ${userB.userName}`;
|
|
|
|
// send a message to User B from User A
|
|
|
|
await sendNewMessage(windowA, userB.sessionid, `${testMessage}`);
|
|
|
|
// Check the message request banner appears and click on it
|
|
|
|
await clickOnTestIdWithText(windowB, 'message-request-banner');
|
|
|
|
// Select 'Clear All' button
|
|
|
|
await clickOnMatchingText(windowB, 'Clear All');
|
|
|
|
// Confirm decline
|
|
|
|
await clickOnTestIdWithText(windowB, 'session-confirm-ok-button', 'OK');
|
|
|
|
// Navigate back to message request folder to check
|
|
|
|
await clickOnTestIdWithText(windowB, 'settings-section');
|
|
|
|
|
|
|
|
await clickOnTestIdWithText(windowB, 'message-requests-settings-menu-item', 'Message Requests');
|
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
2 years ago
|
|
|
// Check config message of message request acceptance
|
|
|
|
await waitForMatchingText(windowB, 'No pending message requests');
|
|
|
|
});
|
|
|
|
});
|
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
2 years ago
|
|
|
|
|
|
|
// Clear all requests
|
|
|
|
|
|
|
|
// Delete request (not a feature yet)
|
|
|
|
// Block request (not a feature yet)
|