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 { readdirSync, rmdirSync } from 'fs-extra';
|
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 { join } from 'path';
|
|
|
|
import { homedir } from 'os';
|
|
|
|
import { isLinux, isMacOS } from '../../../OS';
|
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 { MULTI_PREFIX, NODE_ENV } from './open';
|
|
|
|
// tslint:disable: no-console
|
|
|
|
|
|
|
|
const getDirectoriesOfSessionDataPath = (source: string) =>
|
|
|
|
readdirSync(source, { withFileTypes: true })
|
|
|
|
.filter(dirent => dirent.isDirectory())
|
|
|
|
.map(dirent => {
|
|
|
|
return dirent.name;
|
|
|
|
})
|
|
|
|
.filter(n => n.includes(`${NODE_ENV}-${MULTI_PREFIX}`));
|
|
|
|
|
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 alreadyCleaned = false;
|
|
|
|
let alreadyCleanedWaiting = false;
|
|
|
|
|
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
|
|
|
function cleanUpOtherTest() {
|
|
|
|
if (alreadyCleaned || alreadyCleanedWaiting) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
alreadyCleanedWaiting = true;
|
|
|
|
|
|
|
|
const parentFolderOfAllDataPath = isMacOS()
|
|
|
|
? join(homedir(), 'Library', 'Application Support')
|
|
|
|
: isLinux()
|
|
|
|
? join(homedir(), '.config')
|
|
|
|
: null;
|
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
|
|
|
if (!parentFolderOfAllDataPath) {
|
|
|
|
throw new Error('Only macOS is currrently supported ');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!parentFolderOfAllDataPath || parentFolderOfAllDataPath.length < 9) {
|
|
|
|
throw new Error(`parentFolderOfAllDataPath not found or invalid: ${parentFolderOfAllDataPath}`);
|
|
|
|
}
|
|
|
|
console.info('cleaning other tests leftovers...', parentFolderOfAllDataPath);
|
|
|
|
|
|
|
|
const allAppDataPath = getDirectoriesOfSessionDataPath(parentFolderOfAllDataPath);
|
|
|
|
console.info('allAppDataPath', allAppDataPath);
|
|
|
|
|
|
|
|
allAppDataPath.map(folder => {
|
|
|
|
const pathToRemove = join(parentFolderOfAllDataPath, folder);
|
|
|
|
rmdirSync(pathToRemove, { recursive: true });
|
|
|
|
});
|
|
|
|
console.info('...done');
|
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 beforeAllClean = cleanUpOtherTest;
|
|
|
|
|
|
|
|
export const forceCloseAllWindows = async (windows: Array<Page>) => {
|
|
|
|
return Promise.all(windows.map(w => w.close()));
|
|
|
|
};
|