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 };
|
|
|
|
};
|
|
|
|
|
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 openAppAndNewUser = async (multi: string): Promise<User & { window: Page }> => {
|
|
|
|
// const window = await openAppAndWait(multi);
|
|
|
|
|
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 userName = `${multi}-user`;
|
|
|
|
// const loggedIn = await newUser(window, userName);
|
|
|
|
// return { window, ...loggedIn };
|
|
|
|
// };
|
|
|
|
|
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 async function openAppsAndNewUsers(windowToCreate: number) {
|
|
|
|
// if (windowToCreate >= multisAvailable.length) {
|
|
|
|
// throw new Error(`Do you really need ${multisAvailable.length} windows?!`);
|
|
|
|
// }
|
|
|
|
// // if windowToCreate = 3, this array will be ABC. If windowToCreate = 5, this array will be ABCDE
|
|
|
|
// const multisToUse = multisAvailable.slice(0, windowToCreate);
|
|
|
|
// const loggedInDetails = await Promise.all(
|
|
|
|
// [...multisToUse].map(async m => {
|
|
|
|
// return openAppAndNewUser(m);
|
|
|
|
// })
|
|
|
|
// );
|
|
|
|
|
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 windows = loggedInDetails.map(w => w.window);
|
|
|
|
// const users = loggedInDetails.map(w => {
|
|
|
|
// return _.pick(w, ['sessionid', 'recoveryPhrase', 'userName']);
|
|
|
|
// });
|
|
|
|
// return { windows, users };
|
|
|
|
// }
|