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
3 years ago
|
|
|
import { Page } from '@playwright/test';
|
|
|
|
import { User } from '../types/testing';
|
|
|
|
import { clickOnMatchingText, clickOnTestIdWithText, typeIntoInput } from '../utilities/utils';
|
|
|
|
|
|
|
|
export const newUser = async (window: Page, userName: string): Promise<User> => {
|
|
|
|
// Create User
|
|
|
|
await clickOnMatchingText(window, 'Create Session ID');
|
|
|
|
await clickOnMatchingText(window, 'Continue');
|
|
|
|
// Input username = testuser
|
|
|
|
await typeIntoInput(window, 'display-name-input', userName);
|
|
|
|
await clickOnMatchingText(window, 'Get started');
|
|
|
|
// save recovery phrase
|
|
|
|
await clickOnMatchingText(window, 'Reveal Recovery Phrase');
|
|
|
|
const recoveryPhrase = await window.innerText('[data-testid=recovery-phrase-seed-modal]');
|
|
|
|
await window.click('.session-icon-button.small');
|
|
|
|
|
|
|
|
await clickOnTestIdWithText(window, 'leftpane-primary-avatar');
|
|
|
|
|
|
|
|
// Save session ID to a variable
|
|
|
|
let sessionid = await window.innerText('[data-testid=your-session-id]');
|
|
|
|
sessionid = sessionid.replace(/(\r\n|\n|\r)/gm, ''); // remove the new line in the SessionID as it is rendered with one forced
|
|
|
|
|
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
3 years ago
|
|
|
console.info(`${userName}: Session ID: ${sessionid} and Recovery phrase: ${recoveryPhrase}`);
|
|
|
|
await window.click('.session-icon-button.small');
|
|
|
|
return { userName, sessionid, recoveryPhrase };
|
|
|
|
};
|