Updates typing to User and Group, splits openApp function and create user function, updates saved test users for group upkeep function
parent
9310b43394
commit
d64dbc163f
@ -1,63 +1,71 @@
|
||||
import { _electron, Page, test } from '@playwright/test';
|
||||
import { beforeAllClean, forceCloseAllWindows } from './setup/beforeEach';
|
||||
import { openAppsNoNewUsers } from './setup/new_user';
|
||||
import { sendNewMessage } from './send_message';
|
||||
import { beforeAllClean } from './setup/beforeEach';
|
||||
import { openApp } from './setup/new_user';
|
||||
import { sendNewMessage } from './utilities/send_message';
|
||||
import { logIn } from './setup/log_in';
|
||||
import {
|
||||
testContactFour,
|
||||
testContactOne,
|
||||
testContactThree,
|
||||
testContactTwo,
|
||||
testUser,
|
||||
} from './setup/test_user';
|
||||
import { userA, userB, userC, userD, userE } from './setup/test_user';
|
||||
|
||||
let windows: Array<Page> = [];
|
||||
test.beforeEach(beforeAllClean);
|
||||
|
||||
test.afterEach(() => forceCloseAllWindows(windows));
|
||||
|
||||
test.skip('Group upkeep', async () => {
|
||||
const [windowA, windowB, windowC, windowD, windowE] = await openAppsNoNewUsers(5);
|
||||
const [windowA, windowB, windowC, windowD, windowE] = await openApp(5);
|
||||
windows = [windowA, windowB, windowC, windowD, windowE];
|
||||
await Promise.all([
|
||||
logIn(windowA, testUser.recoveryPhrase),
|
||||
logIn(windowB, testContactOne.recoveryPhrase),
|
||||
logIn(windowC, testContactTwo.recoveryPhrase),
|
||||
logIn(windowD, testContactThree.recoveryPhrase),
|
||||
logIn(windowE, testContactFour.recoveryPhrase),
|
||||
logIn(windowA, userA.recoveryPhrase),
|
||||
logIn(windowB, userB.recoveryPhrase),
|
||||
logIn(windowC, userC.recoveryPhrase),
|
||||
logIn(windowD, userD.recoveryPhrase),
|
||||
logIn(windowE, userE.recoveryPhrase),
|
||||
]);
|
||||
// Send message from test users to all of it's contacts to maintain contact status
|
||||
|
||||
// Send message from user A to Whale(TC1)
|
||||
await sendNewMessage(
|
||||
windowA,
|
||||
testContactOne.sessionid,
|
||||
`Test user -> Whale (TC1): ${Date.now()}`
|
||||
userB.sessionid,
|
||||
`${userA.userName} -> ${userB.userName}: ${Date.now()}`
|
||||
);
|
||||
// Send message from Whale to user A
|
||||
await sendNewMessage(windowB, testUser.sessionid, `Whale (TC1) -> Test user : ${Date.now()}`);
|
||||
await sendNewMessage(
|
||||
windowB,
|
||||
userA.sessionid,
|
||||
`${userB.userName} -> ${userA.userName} : ${Date.now()}`
|
||||
);
|
||||
// Send message from user A to Dragon(TC2)
|
||||
await sendNewMessage(
|
||||
windowA,
|
||||
testContactTwo.sessionid,
|
||||
`Test user -> Dragon (TC2): ${Date.now()}`
|
||||
userC.sessionid,
|
||||
`${userA.userName} -> ${userC.userName}: ${Date.now()}`
|
||||
);
|
||||
// Send message from Dragon to user A
|
||||
await sendNewMessage(windowC, testUser.sessionid, `Dragon (TC2) -> Test user : ${Date.now()}`);
|
||||
await sendNewMessage(
|
||||
windowC,
|
||||
userA.sessionid,
|
||||
`${userC.userName} -> ${userA.userName} : ${Date.now()}`
|
||||
);
|
||||
// Send message from user A to Fish(TC3)
|
||||
await sendNewMessage(
|
||||
windowA,
|
||||
testContactThree.sessionid,
|
||||
`Test user -> Fish (TC3): ${Date.now()}`
|
||||
userD.sessionid,
|
||||
`${userA.userName} -> ${userD.userName}: ${Date.now()}`
|
||||
);
|
||||
// Send message from Fish to user A
|
||||
await sendNewMessage(windowD, testUser.sessionid, `Fish (TC3) -> Test user : ${Date.now()}`);
|
||||
await sendNewMessage(
|
||||
windowD,
|
||||
userA.sessionid,
|
||||
`${userD.userName} -> ${userA.userName} : ${Date.now()}`
|
||||
);
|
||||
// Send message from user A to Gopher(TC4)
|
||||
await sendNewMessage(
|
||||
windowA,
|
||||
testContactFour.sessionid,
|
||||
`Test user -> Gopher (TC4): ${Date.now()}`
|
||||
userE.sessionid,
|
||||
`${userA.userName} -> ${userD.userName}: ${Date.now()}`
|
||||
);
|
||||
// Send message from Gopher to user A
|
||||
await sendNewMessage(windowE, testUser.sessionid, `Gopher (TC4) -> Test user : ${Date.now()}`);
|
||||
await sendNewMessage(
|
||||
windowE,
|
||||
userA.sessionid,
|
||||
`${userD.userName} -> ${userA.userName} : ${Date.now()}`
|
||||
);
|
||||
});
|
||||
|
@ -1,35 +0,0 @@
|
||||
import { _electron, Page, test } from '@playwright/test';
|
||||
import { beforeAllClean, forceCloseAllWindows } from './setup/beforeEach';
|
||||
|
||||
import { sendNewMessage } from './send_message';
|
||||
import { openAppsAndNewUsers } from './setup/new_user';
|
||||
import { clickOnTestIdWithText, waitForTestIdWithText } from './utils';
|
||||
|
||||
const testMessage = 'A -> B';
|
||||
const testReply = 'B -> A';
|
||||
|
||||
let windows: Array<Page> = [];
|
||||
test.beforeEach(beforeAllClean);
|
||||
|
||||
test.afterEach(() => forceCloseAllWindows(windows));
|
||||
|
||||
// Send message in one to one conversation with new contact
|
||||
test('Send message to new contact', async () => {
|
||||
const windowLoggedIn = await openAppsAndNewUsers(2);
|
||||
windows = windowLoggedIn.windows;
|
||||
const users = windowLoggedIn.users;
|
||||
const [windowA, windowB] = windows;
|
||||
const [userA, userB] = users;
|
||||
// User A sends message to User B
|
||||
await sendNewMessage(windowA, userB.sessionid, `${testMessage}${Date.now()}`);
|
||||
// User B sends message to User B to USER A
|
||||
await sendNewMessage(windowB, userA.sessionid, `${testReply}${Date.now()}`);
|
||||
// Navigate to contacts tab in User B's window
|
||||
|
||||
await clickOnTestIdWithText(windowA, 'new-conversation-button');
|
||||
await windowA.waitForTimeout(2000);
|
||||
await waitForTestIdWithText(windowB, 'module-conversation__user__profile-name', userA.userName);
|
||||
|
||||
// Navigate to contacts tab in User A's window
|
||||
await clickOnTestIdWithText(windowA, 'new-conversation-button');
|
||||
});
|
@ -1,36 +1,36 @@
|
||||
import { _electron } from '@playwright/test';
|
||||
|
||||
export const testUser = {
|
||||
userName: 'testUser',
|
||||
sessionid: '05560802be231abc2fbaa860f09da4c2f20dafa4e5f560f77d61c5f587ef2c741f',
|
||||
export const userA = {
|
||||
userName: 'Alice',
|
||||
sessionid: '059e36f9bb03ac4e1ff9ff7d4aedd791d1f412770c6cd2796b855af12a7c7ea000',
|
||||
recoveryPhrase:
|
||||
'pinched total ongoing sushi etched rest gone long oilfield incur code grunt code',
|
||||
'tuition remedy sieve ivory wiggle gemstone hawk optical issued damp selfish fewest damp',
|
||||
};
|
||||
|
||||
export const testContactOne = {
|
||||
userName: 'Whale',
|
||||
sessionid: '059c587e1e027368d4a0ebbf5982fe25e4129fdd79c2328616ceb394cbaf852c52',
|
||||
export const userB = {
|
||||
userName: 'Bob',
|
||||
sessionid: '05ead902602c1f7b59aaa3932b9cdefe8ee4075c03b09811d31bc9b122cb292d0c',
|
||||
recoveryPhrase:
|
||||
'jeers apart cuffs mailed sleepless mystery dads tobacco elite lopped fudge arena mystery',
|
||||
'misery testing template jeopardy yahoo asylum kettle wise unveil wept bygones dice dice',
|
||||
};
|
||||
|
||||
export const testContactTwo = {
|
||||
userName: 'Dragon',
|
||||
sessionid: '05c189b54cea50fa7a3e1fc3ddb6e9c5bcf34ffa7d17af5d8478a45d5a8f629e02',
|
||||
export const userC = {
|
||||
userName: 'Chloe',
|
||||
sessionid: '055f4bcc665b94a0f4c2aa9c2d543ae015db167014aac316bc21f5d7c6fdb11025',
|
||||
recoveryPhrase:
|
||||
'gossip megabyte rogue pheasants rural romance opus grunt amidst runway erected unveil opus',
|
||||
'bakery broken circle ginger pistons deity deity degrees today insult fidget ouch deity',
|
||||
};
|
||||
|
||||
export const testContactThree = {
|
||||
userName: 'Fish',
|
||||
sessionid: '058781e8f5845c22649c6c6e9fdb5c98e63e04832aec78fe6cacd62c3e71600464',
|
||||
export const userD = {
|
||||
userName: 'Doug',
|
||||
sessionid: '0555274f98d9f681d37446797bdebfa0e53d872213450663141bedb58a8ca67675',
|
||||
recoveryPhrase:
|
||||
'hookup reinvest deepest waxing lukewarm aztec invoke fugitive aces onward hire tomorrow hire',
|
||||
'biscuit bomb hire update suede money balding rest fuming alchemy ridges deity update',
|
||||
};
|
||||
|
||||
export const testContactFour = {
|
||||
userName: 'Gopher',
|
||||
sessionid: '0577ee81a6ac9c1a6f80daddcc22a85bd0dc9cfc3a513b5d2368e2da483886ca11',
|
||||
export const userE = {
|
||||
userName: 'Egbert',
|
||||
sessionid: '058b523d3f00773c745c965cf9482dd2fd6ea7a67ec4643c187309e4bbf96a936a',
|
||||
recoveryPhrase:
|
||||
'odds annoyed maps apply diplomat custom boat iceberg extra kitchens adventure luggage maps',
|
||||
'dusted coffee hoisting ringing titans dangerous technical bomb bubble pancakes wipeout goldfish technical',
|
||||
};
|
||||
|
@ -0,0 +1,12 @@
|
||||
export type User = {
|
||||
userName: string;
|
||||
sessionid: string;
|
||||
recoveryPhrase: string;
|
||||
};
|
||||
|
||||
export type Group = {
|
||||
userName: string;
|
||||
userOne: User;
|
||||
userTwo: User;
|
||||
userThree: User;
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
import { _electron } from 'playwright-core';
|
||||
import { openAppsAndNewUsers, openAppsNoNewUsers } from './new_user';
|
||||
import { openAppsAndNewUsers, openAppsNoNewUsers } from '../setup/new_user';
|
||||
import { logIn } from '../setup/log_in';
|
||||
|
||||
export async function linkedDevice() {
|
Loading…
Reference in New Issue