|
|
|
import { _electron, Page } from '@playwright/test';
|
|
|
|
import { clickOnTestIdWithText, typeIntoInput } from './utils';
|
|
|
|
// tslint:disable: no-console
|
|
|
|
|
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
|
|
|
export const sendMessage = async (window: Page, message: string) => {
|
|
|
|
// type into message input box
|
|
|
|
await typeIntoInput(window, 'message-input-text-area', message);
|
|
|
|
// click up arrow (send)
|
|
|
|
await clickOnTestIdWithText(window, 'send-message-button');
|
|
|
|
// wait for confirmation tick to send reply 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
2 years ago
|
|
|
const selc = `css=[data-testid=control-message]:has-text("${message}"):has([data-testid=msg-status-outgoing][data-testtype=sent])`;
|
|
|
|
console.error('waiting for sent tick of message: ', message);
|
|
|
|
|
|
|
|
const tickMessageSent = await window.waitForSelector(selc, { timeout: 30000 });
|
|
|
|
console.error('found the tick of message sent: ', message, Boolean(tickMessageSent));
|
|
|
|
};
|