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 { clickOnMatchingText, typeIntoInput } from '../utilities/utils';
|
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
|
|
|
// tslint:disable: no-console
|
|
|
|
export const newUser = async (window: Page, userName: string): Promise<User> => {
|
|
|
|
// Create User
|
|
|
|
await clickOnMatchingText(window, 'Create Session ID');
|
|
|
|
// Wait for animation for finish creating ID
|
|
|
|
await window.waitForTimeout(1500);
|
|
|
|
//Save session ID to a variable
|
|
|
|
const sessionid = await window.inputValue('[data-testid=session-id-signup]');
|
|
|
|
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]');
|
|
|
|
|
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
|
|
|
console.info(`${userName}: Session ID: ${sessionid} and Recovery phrase: ${recoveryPhrase}`);
|
|
|
|
await window.click('.session-icon-button.small');
|
|
|
|
return { userName, sessionid, recoveryPhrase };
|
|
|
|
};
|