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 { Page } from '@playwright/test';
|
|
|
|
import { User } from '../types/testing';
|
|
|
|
import { sendNewMessage } from './send_message';
|
|
|
|
import { clickOnTestIdWithText, waitForTestIdWithText } from './utils';
|
|
|
|
|
|
|
|
export const createContact = async (windowA: Page, windowB: Page, userA: User, userB: User) => {
|
|
|
|
const testMessage = `${userA.userName} to ${userB.userName}`;
|
|
|
|
const testReply = `${userB.userName} to ${userA.userName}`;
|
|
|
|
// User A sends message to User B
|
|
|
|
await sendNewMessage(windowA, userB.sessionid, testMessage);
|
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
|
|
|
// User B sends message to User B to USER A
|
|
|
|
await sendNewMessage(windowB, userA.sessionid, testReply);
|
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 clickOnTestIdWithText(windowA, 'new-conversation-button');
|
|
|
|
await windowA.waitForTimeout(2000);
|
|
|
|
await waitForTestIdWithText(windowB, 'module-conversation__user__profile-name', userA.userName);
|
|
|
|
|
|
|
|
// Navigate to contacts tab in User A's window
|
|
|
|
await clickOnTestIdWithText(windowA, 'new-conversation-button');
|
|
|
|
};
|