diff --git a/package.json b/package.json index 27e42dd..3aa73d7 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "license": "MIT", "devDependencies": { "@playwright/test": "^1.51", + "@session-foundation/qa-seeder": "^0.1.23", "@types/fs-extra": "^11.0.1", "@types/lodash": "^4.14.196", "@types/uuid": "^9.0.8", diff --git a/tests/automation/call_checks.spec.ts b/tests/automation/call_checks.spec.ts index 7e712f6..358a970 100644 --- a/tests/automation/call_checks.spec.ts +++ b/tests/automation/call_checks.spec.ts @@ -1,6 +1,6 @@ import { englishStrippedStr } from '../localization/englishStrippedStr'; import { Global, HomeScreen } from './locators'; -import { test_Alice_1W_Bob_1W } from './setup/sessionTest'; +import { test_Alice1_Bob1 } from './setup/sessionTest'; import { createContact } from './utilities/create_contact'; import { clickOn, @@ -9,7 +9,7 @@ import { } from './utilities/utils'; import { makeVoiceCall } from './utilities/voice_call'; -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Voice calls', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { await createContact(aliceWindow1, bobWindow1, alice, bob); diff --git a/tests/automation/community_tests.spec.ts b/tests/automation/community_tests.spec.ts index 5c46344..0725154 100644 --- a/tests/automation/community_tests.spec.ts +++ b/tests/automation/community_tests.spec.ts @@ -1,13 +1,13 @@ import { testCommunityName } from './constants/community'; import { Conversation, HomeScreen } from './locators'; -import { test_Alice_1W_Bob_1W, test_Alice_2W } from './setup/sessionTest'; +import { test_Alice1_Bob1, test_Alice2 } from './setup/sessionTest'; import { joinCommunity } from './utilities/join_community'; import { sendMessage } from './utilities/message'; import { replyTo } from './utilities/reply_message'; import { sendMedia } from './utilities/send_media'; import { clickOn, clickOnWithText } from './utilities/utils'; -test_Alice_2W( +test_Alice2( 'Join community and sync', async ({ aliceWindow1, aliceWindow2 }) => { await joinCommunity(aliceWindow1); @@ -22,7 +22,7 @@ test_Alice_2W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Send image to community', async ({ alice, bob, aliceWindow1, bobWindow1 }) => { const mediaPath = 'sample_files/test-image.png'; diff --git a/tests/automation/cta_donations.spec.ts b/tests/automation/cta_donations.spec.ts index 23f31d4..780b6ec 100644 --- a/tests/automation/cta_donations.spec.ts +++ b/tests/automation/cta_donations.spec.ts @@ -2,7 +2,7 @@ import { Page } from '@playwright/test'; import { englishStrippedStr } from '../localization/englishStrippedStr'; import { CTA, Global } from './locators'; -import { test_Alice_1W } from './setup/sessionTest'; +import { test_Alice1 } from './setup/sessionTest'; import { mockDBCreationTime } from './utilities/time_travel'; import { checkCTAStrings, @@ -24,7 +24,7 @@ async function verifyDonateCTAShows(window: Page) { ); } -test_Alice_1W( +test_Alice1( 'Donate CTA, DB age >= 7 days, max 4 times', async ({ aliceWindow1 }) => { const MAX_DONATE_CTA_SHOWS = 4; @@ -52,7 +52,7 @@ const urlModalButtons = [ ]; urlModalButtons.forEach(({ button, name }) => { - test_Alice_1W( + test_Alice1( `Donate CTA, never shows after clicking ${name} in URL modal`, async ({ aliceWindow1 }) => { const url = 'https://getsession.org/donate'; @@ -85,7 +85,7 @@ urlModalButtons.forEach(({ button, name }) => { ); }); -test_Alice_1W( +test_Alice1( 'Donate CTA, DB age < 7 days', async ({ aliceWindow1 }) => { await verifyNoCTAShows(aliceWindow1); diff --git a/tests/automation/disappearing_message_checks.spec.ts b/tests/automation/disappearing_message_checks.spec.ts index b1c46f1..30a5ce4 100644 --- a/tests/automation/disappearing_message_checks.spec.ts +++ b/tests/automation/disappearing_message_checks.spec.ts @@ -13,7 +13,7 @@ import { Global, HomeScreen, } from './locators'; -import { test_Alice_1W_Bob_1W } from './setup/sessionTest'; +import { test_Alice1_Bob1 } from './setup/sessionTest'; import { createContact } from './utilities/create_contact'; import { joinCommunity } from './utilities/join_community'; import { waitForSentTick } from './utilities/message'; @@ -44,7 +44,7 @@ const { timeOption, disappearingMessagesType, disappearAction } = mediaArray.forEach( ({ mediaType, path, attachmentType, shouldCheckMediaPreview }) => { - test_Alice_1W_Bob_1W( + test_Alice1_Bob1( `Send disappearing ${mediaType} 1:1`, async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const testMessage = `${alice.userName} sending disappearing ${mediaType} to ${bob.userName}`; @@ -113,7 +113,7 @@ mediaArray.forEach( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( `Send disappearing long text 1:1`, async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const formattedTime = formatTimeOption(timeOption); @@ -158,7 +158,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( `Send disappearing link preview 1:1`, async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const formattedTime = formatTimeOption(timeOption); @@ -212,7 +212,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( `Send disappearing community invite 1:1`, async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const formattedTime = formatTimeOption(timeOption); @@ -306,7 +306,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( `Send disappearing call message 1:1`, async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const formattedTime = formatTimeOption(timeOption); diff --git a/tests/automation/disappearing_messages.spec.ts b/tests/automation/disappearing_messages.spec.ts index a173ac2..838ab77 100644 --- a/tests/automation/disappearing_messages.spec.ts +++ b/tests/automation/disappearing_messages.spec.ts @@ -3,9 +3,9 @@ import { sleepFor } from '../promise_utils'; import { defaultDisappearingOptions } from './constants/variables'; import { Conversation, HomeScreen } from './locators'; import { - test_Alice_2W, - test_Alice_2W_Bob_1W, - test_group_Alice_2W_Bob_1W_Charlie_1W, + test_Alice2, + test_Alice2_Bob1, + test_group_Alice2_Bob1_Charlie1, } from './setup/sessionTest'; import { createContact } from './utilities/create_contact'; import { sendMessage } from './utilities/message'; @@ -25,7 +25,7 @@ import { waitForTextMessage, } from './utilities/utils'; -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Disappear after read 1:1', async ({ alice, bob, aliceWindow1, aliceWindow2, bobWindow1 }) => { const { timeOption, disappearingMessagesType, disappearAction } = @@ -84,7 +84,7 @@ test_Alice_2W_Bob_1W( }, ); -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Disappear after send 1:1', async ({ alice, bob, aliceWindow1, aliceWindow2, bobWindow1 }) => { const { timeOption, disappearingMessagesType, disappearAction } = @@ -136,7 +136,7 @@ test_Alice_2W_Bob_1W( }, ); -test_group_Alice_2W_Bob_1W_Charlie_1W( +test_group_Alice2_Bob1_Charlie1( 'Disappear after send groups', async ({ aliceWindow1, @@ -192,7 +192,7 @@ test_group_Alice_2W_Bob_1W_Charlie_1W( }, ); -test_Alice_2W( +test_Alice2( 'Disappear after send note to self', async ({ alice, aliceWindow1, aliceWindow2 }) => { const { timeOption, disappearingMessagesType, disappearAction } = @@ -239,7 +239,7 @@ test_Alice_2W( }, ); -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Disappear after send off 1:1', async ({ alice, bob, aliceWindow1, aliceWindow2, bobWindow1 }) => { const { disappearAction, disappearingMessagesType, timeOption } = diff --git a/tests/automation/group_disappearing_messages.spec.ts b/tests/automation/group_disappearing_messages.spec.ts index 483e617..23ad7bb 100644 --- a/tests/automation/group_disappearing_messages.spec.ts +++ b/tests/automation/group_disappearing_messages.spec.ts @@ -5,7 +5,7 @@ import { mediaArray, testLink, } from './constants/variables'; -import { test_group_Alice_1W_Bob_1W_Charlie_1W } from './setup/sessionTest'; +import { test_group_Alice1_Bob1_Charlie1 } from './setup/sessionTest'; import { sendMessage } from './utilities/message'; import { sendLinkPreview, @@ -27,7 +27,7 @@ const { timeOption, disappearingMessagesType, disappearAction } = defaultDisappearingOptions.group; mediaArray.forEach(({ mediaType, path, shouldCheckMediaPreview }) => { - test_group_Alice_1W_Bob_1W_Charlie_1W( + test_group_Alice1_Bob1_Charlie1( `Send disappearing ${mediaType} groups`, async ({ alice, @@ -84,7 +84,7 @@ mediaArray.forEach(({ mediaType, path, shouldCheckMediaPreview }) => { ); }); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Send disappearing long text to groups', async ({ aliceWindow1, bobWindow1, charlieWindow1 }) => { await setDisappearingMessages(aliceWindow1, [ @@ -106,7 +106,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W( }, ); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Send disappearing link to groups', async ({ aliceWindow1, bobWindow1, charlieWindow1 }) => { await setDisappearingMessages(aliceWindow1, [ diff --git a/tests/automation/group_testing.spec.ts b/tests/automation/group_testing.spec.ts index 0557271..d6613ac 100644 --- a/tests/automation/group_testing.spec.ts +++ b/tests/automation/group_testing.spec.ts @@ -10,8 +10,8 @@ import { createGroup } from './setup/create_group'; import { newUser } from './setup/new_user'; import { sessionTestThreeWindows, - test_group_Alice_1W_Bob_1W_Charlie_1W, - test_group_Alice_1W_Bob_1W_Charlie_1W_Dracula_1W, + test_group_Alice1_Bob1_Charlie1, + test_group_Alice1_Bob1_Charlie1_Dracula1, } from './setup/sessionTest'; import { createContact } from './utilities/create_contact'; import { leaveGroup } from './utilities/leave_group'; @@ -51,7 +51,7 @@ sessionTestThreeWindows('Create group', async ([windowA, windowB, windowC]) => { // await waitForTestIdWithText(windowA, 'control-message'); }); -test_group_Alice_1W_Bob_1W_Charlie_1W_Dracula_1W( +test_group_Alice1_Bob1_Charlie1_Dracula1( 'Add contact to group', async ({ alice, @@ -108,7 +108,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W_Dracula_1W( }, ); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Change group name', async ({ aliceWindow1, bobWindow1, charlieWindow1, groupCreated }) => { const newGroupName = 'New group name'; @@ -157,7 +157,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W( }, ); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Test mentions', async ({ alice, @@ -224,7 +224,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W( }, ); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Leave group', async ({ aliceWindow1, diff --git a/tests/automation/landing_page.spec.ts b/tests/automation/landing_page.spec.ts index 9338ec4..c999168 100644 --- a/tests/automation/landing_page.spec.ts +++ b/tests/automation/landing_page.spec.ts @@ -1,11 +1,11 @@ import { englishStrippedStr } from '../localization/englishStrippedStr'; -import { test_Alice_2W } from './setup/sessionTest'; +import { test_Alice2 } from './setup/sessionTest'; import { hasElementPoppedUpThatShouldnt, waitForElement, } from './utilities/utils'; -test_Alice_2W( +test_Alice2( `Landing page states`, async ({ aliceWindow1, aliceWindow2 }, _testInfo) => { await Promise.all([ diff --git a/tests/automation/linked_device_group.spec.ts b/tests/automation/linked_device_group.spec.ts index 1d14063..ef84a93 100644 --- a/tests/automation/linked_device_group.spec.ts +++ b/tests/automation/linked_device_group.spec.ts @@ -12,8 +12,8 @@ import { import { openApp } from './setup/open'; import { recoverFromSeed } from './setup/recovery_using_seed'; import { - test_group_Alice_1W_Bob_1W_Charlie_1W, - test_group_Alice_2W_Bob_1W_Charlie_1W, + test_group_Alice1_Bob1_Charlie1, + test_group_Alice2_Bob1_Charlie1, } from './setup/sessionTest'; import { leaveGroup } from './utilities/leave_group'; import { @@ -25,7 +25,7 @@ import { waitForTestIdWithText, } from './utilities/utils'; -test_group_Alice_2W_Bob_1W_Charlie_1W( +test_group_Alice2_Bob1_Charlie1( 'Leaving group syncs', async ({ aliceWindow1, @@ -88,7 +88,7 @@ test_group_Alice_2W_Bob_1W_Charlie_1W( }, ); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Restore group', async ({ alice, bob, charlie, groupCreated }) => { const [aliceWindow2] = await openApp(1); @@ -173,7 +173,7 @@ async function clearDataOnWindow(window: Page) { } // Delete device data > Restore account -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Delete and restore group', async ({ alice, bob, charlie, groupCreated }) => { const [aliceWindow2] = await openApp(1); @@ -313,7 +313,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W( }, ); -test_group_Alice_2W_Bob_1W_Charlie_1W( +test_group_Alice2_Bob1_Charlie1( 'Delete group linked device', async ({ aliceWindow1, diff --git a/tests/automation/linked_device_requests.spec.ts b/tests/automation/linked_device_requests.spec.ts index 6284459..de07870 100644 --- a/tests/automation/linked_device_requests.spec.ts +++ b/tests/automation/linked_device_requests.spec.ts @@ -7,7 +7,7 @@ import { LeftPane, Settings, } from './locators'; -import { test_Alice_2W_Bob_1W } from './setup/sessionTest'; +import { test_Alice2_Bob1 } from './setup/sessionTest'; import { sendMessage } from './utilities/message'; import { sendNewMessage } from './utilities/send_message'; import { @@ -19,7 +19,7 @@ import { waitForTextMessage, } from './utilities/utils'; -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Accept request syncs', async ({ alice, bob, aliceWindow1, aliceWindow2, bobWindow1 }) => { const testMessage = `${bob.userName} sending message request to ${alice.userName}`; @@ -63,7 +63,7 @@ test_Alice_2W_Bob_1W( }, ); -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Decline request syncs', async ({ alice, aliceWindow1, aliceWindow2, bob, bobWindow1 }) => { const testMessage = `${bob.userName} sending message request to ${alice.userName}`; @@ -103,7 +103,7 @@ test_Alice_2W_Bob_1W( }, ); -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Message requests block', async ({ alice, bob, aliceWindow1, aliceWindow2, bobWindow1 }) => { const testMessage = `Sender: ${bob.userName}, Receiver: ${alice.userName}`; diff --git a/tests/automation/linked_device_user.spec.ts b/tests/automation/linked_device_user.spec.ts index 7801d2f..eeb93f3 100644 --- a/tests/automation/linked_device_user.spec.ts +++ b/tests/automation/linked_device_user.spec.ts @@ -14,8 +14,8 @@ import { forceCloseAllWindows } from './setup/closeWindows'; import { newUser } from './setup/new_user'; import { sessionTestOneWindow, - test_Alice_2W, - test_Alice_2W_Bob_1W, + test_Alice2, + test_Alice2_Bob1, } from './setup/sessionTest'; import { createContact } from './utilities/create_contact'; import { linkedDevice } from './utilities/linked_device'; @@ -84,7 +84,7 @@ sessionTestOneWindow('Link a device', async ([aliceWindow1]) => { } }); -test_Alice_2W( +test_Alice2( 'Changed username syncs', async ({ aliceWindow1, aliceWindow2 }) => { const newUsername = 'Tiny bubble'; @@ -136,7 +136,7 @@ test_Alice_2W( }, ); -test_Alice_2W( +test_Alice2( 'Avatar syncs', async ({ aliceWindow1, aliceWindow2 }, testInfo) => { await clickOn(aliceWindow1, LeftPane.profileButton); @@ -170,7 +170,7 @@ test_Alice_2W( }, ); -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Contacts syncs', async ({ alice, aliceWindow1, aliceWindow2, bob, bobWindow1 }) => { await createContact(aliceWindow1, bobWindow1, alice, bob); @@ -184,7 +184,7 @@ test_Alice_2W_Bob_1W( }, ); -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Deleted message syncs', async ({ alice, aliceWindow1, aliceWindow2, bob, bobWindow1 }) => { const messageToDelete = 'Testing deletion functionality for linked device'; @@ -227,7 +227,7 @@ test_Alice_2W_Bob_1W( }, ); -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Unsent message syncs', async ({ alice, aliceWindow1, aliceWindow2, bob, bobWindow1 }) => { const unsentMessage = 'Testing unsending functionality for linked device'; @@ -274,7 +274,7 @@ test_Alice_2W_Bob_1W( }, ); -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Blocked user syncs', async ({ alice, aliceWindow1, aliceWindow2, bob, bobWindow1 }) => { const testMessage = 'Testing blocking functionality for linked device'; @@ -330,7 +330,7 @@ test_Alice_2W_Bob_1W( }, ); -test_Alice_2W_Bob_1W( +test_Alice2_Bob1( 'Deleted conversation syncs', async ({ alice, aliceWindow1, aliceWindow2, bob, bobWindow1 }) => { // Create contact and send new message @@ -407,7 +407,7 @@ test_Alice_2W_Bob_1W( }, ); -test_Alice_2W( +test_Alice2( 'Hide note to self syncs', async ({ alice, aliceWindow1, aliceWindow2 }) => { await clickOn(aliceWindow1, HomeScreen.plusButton); diff --git a/tests/automation/message_checks.spec.ts b/tests/automation/message_checks.spec.ts index 3977e14..230223c 100644 --- a/tests/automation/message_checks.spec.ts +++ b/tests/automation/message_checks.spec.ts @@ -12,8 +12,8 @@ import { import { newUser } from './setup/new_user'; import { sessionTestTwoWindows, - test_Alice_1W, - test_Alice_1W_Bob_1W, + test_Alice1, + test_Alice1_Bob1, } from './setup/sessionTest'; import { createContact } from './utilities/create_contact'; import { joinCommunity } from './utilities/join_community'; @@ -46,7 +46,7 @@ import { mediaArray.forEach( ({ mediaType, path, attachmentType, shouldCheckMediaPreview }) => { - test_Alice_1W_Bob_1W( + test_Alice1_Bob1( `Send ${mediaType} 1:1`, async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const testMessage = `${alice.userName} sending ${mediaType} to ${bob.userName}`; @@ -90,7 +90,7 @@ mediaArray.forEach( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Send long text 1:1', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const testReply = `${bob.userName} replying to long text message from ${alice.userName}`; @@ -113,7 +113,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Send link 1:1', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const testReply = `${bob.userName} replying to link from ${alice.userName}`; @@ -136,7 +136,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Send community invite', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { await createContact(aliceWindow1, bobWindow1, alice, bob); @@ -181,7 +181,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Unsend message 1:1', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const unsendMessage = 'Testing unsend functionality'; @@ -218,7 +218,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Delete message 1:1', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const deletedMessage = 'Testing deletion functionality'; @@ -297,7 +297,7 @@ const messageLengthTestCases = [ ]; messageLengthTestCases.forEach((testCase) => { - test_Alice_1W_Bob_1W( + test_Alice1_Bob1( `Message length limit (${testCase.length} chars)`, async ({ alice, aliceWindow1, bob, bobWindow1 }) => { await createContact(aliceWindow1, bobWindow1, alice, bob); @@ -397,7 +397,7 @@ messageLengthTestCases.forEach((testCase) => { ); }); -test_Alice_1W( +test_Alice1( 'Emoji container does not show for links', async ({ aliceWindow1, alice }) => { await clickOn(aliceWindow1, HomeScreen.plusButton); @@ -442,7 +442,7 @@ test_Alice_1W( }, ); -test_Alice_1W( +test_Alice1( 'Emoji container closes when clicking away', async ({ aliceWindow1, alice }) => { await clickOn(aliceWindow1, HomeScreen.plusButton); diff --git a/tests/automation/message_checks_groups.spec.ts b/tests/automation/message_checks_groups.spec.ts index 6738751..e7218fd 100644 --- a/tests/automation/message_checks_groups.spec.ts +++ b/tests/automation/message_checks_groups.spec.ts @@ -1,7 +1,7 @@ import { englishStrippedStr } from '../localization/englishStrippedStr'; import { sleepFor } from '../promise_utils'; import { longText, mediaArray, testLink } from './constants/variables'; -import { test_group_Alice_1W_Bob_1W_Charlie_1W } from './setup/sessionTest'; +import { test_group_Alice1_Bob1_Charlie1 } from './setup/sessionTest'; import { sendMessage } from './utilities/message'; import { replyTo, replyToMedia } from './utilities/reply_message'; import { @@ -23,7 +23,7 @@ import { } from './utilities/utils'; mediaArray.forEach(({ mediaType, path, shouldCheckMediaPreview }) => { - test_group_Alice_1W_Bob_1W_Charlie_1W( + test_group_Alice1_Bob1_Charlie1( `Send ${mediaType} to group`, async ({ alice, @@ -89,7 +89,7 @@ mediaArray.forEach(({ mediaType, path, shouldCheckMediaPreview }) => { ); }); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Send long text to group', async ({ alice, @@ -118,7 +118,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W( }, ); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Send link to group', async ({ alice, @@ -155,7 +155,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W( }, ); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Unsend message to group', async ({ aliceWindow1, bobWindow1, charlieWindow1, groupCreated }) => { const unsendMessage = `Testing unsend functionality in ${groupCreated.userName}`; @@ -203,7 +203,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W( }, ); -test_group_Alice_1W_Bob_1W_Charlie_1W( +test_group_Alice1_Bob1_Charlie1( 'Delete message to group', async ({ aliceWindow1, bobWindow1, charlieWindow1, groupCreated }) => { const deletedMessage = `Testing delete message functionality in ${groupCreated.userName}`; diff --git a/tests/automation/message_requests.spec.ts b/tests/automation/message_requests.spec.ts index 16bb2b4..272a0b5 100644 --- a/tests/automation/message_requests.spec.ts +++ b/tests/automation/message_requests.spec.ts @@ -8,7 +8,7 @@ import { LeftPane, Settings, } from './locators'; -import { test_Alice_1W_Bob_1W } from './setup/sessionTest'; +import { test_Alice1_Bob1 } from './setup/sessionTest'; import { joinCommunity } from './utilities/join_community'; import { sendMessage } from './utilities/message'; import { sendNewMessage } from './utilities/send_message'; @@ -23,7 +23,7 @@ import { } from './utilities/utils'; // Open two windows and log into 2 separate accounts -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Message requests accept', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const testMessage = `Sender: ${alice.userName} Receiver: ${bob.userName}`; @@ -56,7 +56,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Message requests text reply', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const testMessage = `Sender: ${alice.userName}, Receiver: ${bob.userName}`; @@ -90,7 +90,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Message requests decline', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const testMessage = `Sender: ${alice.userName}, Receiver: ${bob.userName}`; @@ -129,7 +129,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Message requests clear all', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { const testMessage = `Sender: ${alice.userName}, Receiver: ${bob.userName}`; @@ -169,7 +169,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Community message requests on', async ({ alice, aliceWindow1, bob, bobWindow1 }) => { await clickOn(bobWindow1, LeftPane.settingsButton); @@ -221,7 +221,7 @@ test_Alice_1W_Bob_1W( ); }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Community message requests off', async ({ aliceWindow1, bobWindow1 }) => { await Promise.all([joinCommunity(aliceWindow1), joinCommunity(bobWindow1)]); diff --git a/tests/automation/network_page.spec.ts b/tests/automation/network_page.spec.ts index 7080632..5b7ac2b 100644 --- a/tests/automation/network_page.spec.ts +++ b/tests/automation/network_page.spec.ts @@ -1,7 +1,7 @@ import { englishStrippedStr } from '../localization/englishStrippedStr'; import { sleepFor } from '../promise_utils'; import { Global, LeftPane, Settings } from './locators'; -import { test_Alice_1W } from './setup/sessionTest'; +import { test_Alice1 } from './setup/sessionTest'; import { validateNetworkData } from './utilities/network_api'; import { compareElementScreenshot } from './utilities/screenshot'; import { @@ -12,7 +12,7 @@ import { waitForTestIdWithText, } from './utilities/utils'; -test_Alice_1W('Network page values', async ({ aliceWindow1 }) => { +test_Alice1('Network page values', async ({ aliceWindow1 }) => { await clickOn(aliceWindow1, LeftPane.settingsButton); await clickOn(aliceWindow1, Settings.networkPageMenuItem); @@ -53,7 +53,7 @@ test_Alice_1W('Network page values', async ({ aliceWindow1 }) => { ); }); -test_Alice_1W('Network page network link', async ({ aliceWindow1 }) => { +test_Alice1('Network page network link', async ({ aliceWindow1 }) => { const url = 'https://docs.getsession.org/session-network'; await clickOn(aliceWindow1, LeftPane.settingsButton); await clickOn(aliceWindow1, Settings.networkPageMenuItem); @@ -67,7 +67,7 @@ test_Alice_1W('Network page network link', async ({ aliceWindow1 }) => { await assertUrlIsReachable(url); }); -test_Alice_1W('Network page staking link', async ({ aliceWindow1 }) => { +test_Alice1('Network page staking link', async ({ aliceWindow1 }) => { const url = 'https://docs.getsession.org/session-network/staking'; await clickOn(aliceWindow1, LeftPane.settingsButton); await clickOn(aliceWindow1, Settings.networkPageMenuItem); @@ -81,7 +81,7 @@ test_Alice_1W('Network page staking link', async ({ aliceWindow1 }) => { await assertUrlIsReachable(url); }); -test_Alice_1W('Network page refresh', async ({ aliceWindow1 }) => { +test_Alice1('Network page refresh', async ({ aliceWindow1 }) => { const zeroMinAgoText = englishStrippedStr('updated') .withArgs({ relative_time: '0m' }) .toString(); @@ -114,7 +114,7 @@ test_Alice_1W('Network page refresh', async ({ aliceWindow1 }) => { // Cycle through all valid node counts and check count + graph for (let nodeCount = 1; nodeCount <= 10; nodeCount++) { - test_Alice_1W( + test_Alice1( `Network page node count: ${nodeCount} - dark theme`, async ({ aliceWindow1 }, testInfo) => { await clickOn(aliceWindow1, LeftPane.settingsButton); @@ -150,7 +150,7 @@ for (let nodeCount = 1; nodeCount <= 10; nodeCount++) { // 7 has been chosen as it's the most common swarm size // Single check to verify light mode svg also renders correctly const LIGHT_THEME_TEST_NODE_COUNT = 7; -test_Alice_1W( +test_Alice1( `Network page node count: ${LIGHT_THEME_TEST_NODE_COUNT} - light theme`, async ({ aliceWindow1 }, testInfo) => { await clickOn(aliceWindow1, LeftPane.settingsButton); diff --git a/tests/automation/password.spec.ts b/tests/automation/password.spec.ts index 125326b..0e1567b 100644 --- a/tests/automation/password.spec.ts +++ b/tests/automation/password.spec.ts @@ -3,7 +3,7 @@ import { Page } from '@playwright/test'; import { englishStrippedStr } from '../localization/englishStrippedStr'; import { sleepFor } from '../promise_utils'; import { Global, LeftPane, Settings } from './locators'; -import { test_Alice_1W_no_network } from './setup/sessionTest'; +import { test_Alice1_no_network } from './setup/sessionTest'; import { clickOn, clickOnMatchingText, @@ -27,7 +27,7 @@ async function expectRecoveryPhraseToBeVisible( ); } -test_Alice_1W_no_network('Set Password', async ({ alice, aliceWindow1 }) => { +test_Alice1_no_network('Set Password', async ({ alice, aliceWindow1 }) => { // Click on settings tab await clickOn(aliceWindow1, LeftPane.settingsButton); // Click on privacy @@ -108,7 +108,7 @@ test_Alice_1W_no_network('Set Password', async ({ alice, aliceWindow1 }) => { ); }); -test_Alice_1W_no_network( +test_Alice1_no_network( 'Wrong Password', async ({ alice: { recoveryPassword }, aliceWindow1 }) => { // Check if incorrect password works diff --git a/tests/automation/recovery_phrase_banner.spec.ts b/tests/automation/recovery_phrase_banner.spec.ts index 2bb1ad8..b0e9671 100644 --- a/tests/automation/recovery_phrase_banner.spec.ts +++ b/tests/automation/recovery_phrase_banner.spec.ts @@ -2,7 +2,7 @@ import type { Page } from '@playwright/test'; import { sleepFor } from '../promise_utils'; import { Global, HomeScreen, Settings } from './locators'; -import { test_Alice_1W } from './setup/sessionTest'; +import { test_Alice1 } from './setup/sessionTest'; import { joinDefaultCommunity, leaveCommunity, @@ -33,7 +33,7 @@ async function bannerShouldAppear(window: Page) { console.log('On home screen, banner is visible'); } -test_Alice_1W( +test_Alice1( 'Recovery password banner appears after >2 conversations', async ({ aliceWindow1 }) => { await bannerShouldNotAppear(aliceWindow1); @@ -46,7 +46,7 @@ test_Alice_1W( }, ); -test_Alice_1W( +test_Alice1( 'Recovery password banner 2 windows', async ({ aliceWindow1, alice }) => { await joinDefaultCommunity(aliceWindow1, 'Lokinet Updates'); @@ -58,7 +58,7 @@ test_Alice_1W( }, ); -test_Alice_1W( +test_Alice1( 'Recovery password banner persists when conversation count drops below 3', async ({ aliceWindow1 }) => { await joinDefaultCommunity(aliceWindow1, 'Lokinet Updates'); @@ -71,7 +71,7 @@ test_Alice_1W( }, ); -test_Alice_1W( +test_Alice1( 'Recovery password banner disappears after being opened', async ({ aliceWindow1 }) => { await joinDefaultCommunity(aliceWindow1, 'Lokinet Updates'); diff --git a/tests/automation/setup/sessionTest.ts b/tests/automation/setup/sessionTest.ts index 5212120..991cf81 100644 --- a/tests/automation/setup/sessionTest.ts +++ b/tests/automation/setup/sessionTest.ts @@ -3,14 +3,19 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/naming-convention */ import { Page, test, TestInfo } from '@playwright/test'; +import { + buildStateForTest, + PrebuiltStateKey, + StateUser, +} from '@session-foundation/qa-seeder'; import chalk from 'chalk'; import { Group, User } from '../types/testing'; import { linkedDevice } from '../utilities/linked_device'; +import { checkPathLight } from '../utilities/utils'; import { forceCloseAllWindows } from './closeWindows'; -import { createGroup } from './create_group'; -import { newUser } from './new_user'; import { openApp, resetTrackedElectronPids, TestContext } from './open'; +import { recoverFromSeed } from './recovery_using_seed'; // This is not ideal, most of our test needs to open a specific number of windows and close them once the test is done or failed. // This file contains a bunch of utility function to use to open those windows and clean them afterwards. @@ -113,6 +118,50 @@ type NumericRange = | Exclude, LessThan> | Exclude>; +/** + * Get the network target for qa-seeder based on environment + */ +function getNetworkTarget(): 'mainnet' | 'testnet' | `http${string}` { + const devnetUrl = process.env.LOCAL_DEVNET_SEED_URL; + if (devnetUrl) { + return devnetUrl as `http${string}`; + } + return 'testnet'; +} + +/** + * Convert StateUser from qa-seeder to User type used in tests + */ +function stateUserToUser(stateUser: StateUser): User { + return { + userName: stateUser.userName, + accountid: stateUser.sessionId, + recoveryPassword: stateUser.seedPhrase, + }; +} + +/** + * Determine the appropriate prebuilt state key based on test parameters + */ +function getPrebuiltStateKey< + UserCount extends 1 | 2 | 3 | 4, + Grouped extends Array> | undefined, +>(userCount: UserCount, grouped: Grouped): PrebuiltStateKey { + const hasGroup = grouped && grouped.length > 0; + + if (userCount === 1) { + return '1user'; + } + if (userCount === 2) { + return hasGroup ? '2friendsInGroup' : '2friends'; + } + if (userCount === 3) { + return hasGroup ? '3friendsInGroup' : '3friends'; + } + // userCount === 4, we don't have a 4-user prebuilt state yet, so use 3friends + return hasGroup ? '3friendsInGroup' : '3friends'; +} + function sessionTestGeneric< UserCount extends 1 | 2 | 3 | 4, Links extends Array>, @@ -144,19 +193,64 @@ function sessionTestGeneric< const userNames: Tuple = ['Alice', 'Bob', 'Charlie', 'Dracula']; return test(testName, async ({}, testinfo) => { - const mainWindows = await openApp(userCount, context); + const mainWindows: Array = []; const linkedWindows: Array = []; try { + // Build state on the swarm using qa-seeder + const stateKey = getPrebuiltStateKey(userCount, grouped); + const groupName = grouped && grouped.length > 0 ? testName : undefined; + + console.info( + chalk.yellow(`Building prebuilt state "${stateKey}" on the swarm...`), + ); + + const [windows, prebuiltState] = await Promise.all([ + openApp(userCount, context), + buildStateForTest(stateKey, groupName, getNetworkTarget()), + ]); + + console.log('app opened '); + console.log('getNetworkTarget() ', getNetworkTarget()); + console.log('stateKey ', stateKey); + console.log('groupName ', groupName); + + mainWindows.push(...windows); + if (mainWindows.length !== userCount) { throw new Error( `openApp should have opened ${userCount} windows but did not.`, ); } - const users = (await Promise.all( - mainWindows.map((m, i) => newUser(m, userNames[i], waitForNetwork)), - )) as Tuple; + console.info( + chalk.green( + `Prebuilt state ready. Restoring accounts from seed phrases...`, + ), + ); + + // Restore accounts from the prebuilt seed phrases + const users: Array = []; + for (let i = 0; i < userCount; i++) { + const stateUser = prebuiltState.users[i]; + const window = mainWindows[i]; + + console.info( + `Restoring ${chalk.blue( + stateUser.userName, + )} with seed phrase "${chalk.green(stateUser.seedPhrase)}"`, + ); + + await recoverFromSeed(window, stateUser.seedPhrase); + + if (waitForNetwork) { + await checkPathLight(window); + } + + users.push(stateUserToUser(stateUser)); + } + + // Handle linked devices if needed if (links?.length) { for (let index = 0; index < links.length; index++) { const link = links[index]; @@ -170,16 +264,20 @@ function sessionTestGeneric< } } + // Build Group object if group was created in prebuilt state let groupCreated: Group | undefined; - if (grouped?.length) { - groupCreated = await createGroup( - testName, - users[grouped[0] - 1], - mainWindows[grouped[0] - 1], - users[grouped[1] - 1], - mainWindows[grouped[1] - 1], - users[grouped[2] - 1], - mainWindows[grouped[2] - 1], + if (grouped && grouped.length > 0 && 'group' in prebuiltState) { + // Group already exists on the swarm, just create the Group object for the test + groupCreated = { + userName: prebuiltState.group.groupName, + userOne: users[grouped[0] - 1], + userTwo: users[grouped[1] - 1], + userThree: users[grouped[2] - 1], + }; + console.info( + chalk.green( + `Group "${groupCreated.userName}" already exists on the swarm`, + ), ); } @@ -188,7 +286,7 @@ function sessionTestGeneric< { mainWindows: mainWindows as Tuple, linkedWindows: linkedWindows as Tuple, - users, + users: users as Tuple, groupCreated: groupCreated as Grouped extends Array ? Group : undefined, @@ -211,7 +309,7 @@ function sessionTestGeneric< * Setup the test with 1 user and a single window, but don't wait for the network to be ready. * Used for tests which don't need network (i.e. setting/checking passwords etc) */ -export function test_Alice_1W_no_network( +export function test_Alice1_no_network( testname: string, testCallback: ( details: WithAlice & WithAliceWindow1, @@ -235,7 +333,7 @@ export function test_Alice_1W_no_network( ); } -export function test_Alice_1W( +export function test_Alice1( testname: string, testCallback: ( details: WithAlice & WithAliceWindow1, @@ -263,7 +361,7 @@ export function test_Alice_1W( * Setup the test with 1 user and 2 windows total: * - Alice with 2 windows. */ -export function test_Alice_2W( +export function test_Alice2( testname: string, testCallback: ( details: WithAlice & WithAliceWindow1 & WithAliceWindow2, @@ -293,7 +391,7 @@ export function test_Alice_2W( * - Alice with 1 window, * - Bob with 1 window. */ -export function test_Alice_1W_Bob_1W( +export function test_Alice1_Bob1( testname: string, testCallback: ( details: WithAlice & WithAliceWindow1 & WithBob & WithBobWindow1, @@ -324,7 +422,7 @@ export function test_Alice_1W_Bob_1W( * - Alice with 2 windows, * - Bob with 1 window. */ -export function test_Alice_2W_Bob_1W( +export function test_Alice2_Bob1( testname: string, testCallback: ( details: WithAlice & @@ -361,7 +459,7 @@ export function test_Alice_2W_Bob_1W( * - Bob with 1 window, * - Charlie with 1 window. */ -export function test_group_Alice_1W_Bob_1W_Charlie_1W( +export function test_group_Alice1_Bob1_Charlie1( testname: string, testCallback: ( details: WithAlice & @@ -402,7 +500,7 @@ export function test_group_Alice_1W_Bob_1W_Charlie_1W( * - Bob with 1 window, * - Charlie with 1 window. */ -export function test_group_Alice_2W_Bob_1W_Charlie_1W( +export function test_group_Alice2_Bob1_Charlie1( testname: string, testCallback: ( details: WithAlice & @@ -446,7 +544,7 @@ export function test_group_Alice_2W_Bob_1W_Charlie_1W( * - Charlie with 1 window, * - Dracula with 1 window, */ -export function test_group_Alice_1W_Bob_1W_Charlie_1W_Dracula_1W( +export function test_group_Alice1_Bob1_Charlie1_Dracula1( testname: string, testCallback: ( details: WithAlice & diff --git a/tests/automation/switching_theme.spec.ts b/tests/automation/switching_theme.spec.ts index 67e0701..98b36f6 100644 --- a/tests/automation/switching_theme.spec.ts +++ b/tests/automation/switching_theme.spec.ts @@ -1,10 +1,10 @@ import { expect } from '@playwright/test'; import { LeftPane } from './locators'; -import { test_Alice_1W_no_network } from './setup/sessionTest'; +import { test_Alice1_no_network } from './setup/sessionTest'; import { clickOn } from './utilities/utils'; -test_Alice_1W_no_network('Switch themes', async ({ aliceWindow1 }) => { +test_Alice1_no_network('Switch themes', async ({ aliceWindow1 }) => { // Create // Check light theme colour is correct const darkThemeColor = aliceWindow1.locator('.inbox.index'); diff --git a/tests/automation/user_actions.spec.ts b/tests/automation/user_actions.spec.ts index 3983c72..a66f4da 100644 --- a/tests/automation/user_actions.spec.ts +++ b/tests/automation/user_actions.spec.ts @@ -12,9 +12,9 @@ import { import { newUser } from './setup/new_user'; import { sessionTestTwoWindows, - test_Alice_1W_Bob_1W, - test_Alice_1W_no_network, - test_Alice_2W, + test_Alice1_Bob1, + test_Alice1_no_network, + test_Alice2, } from './setup/sessionTest'; import { createContact } from './utilities/create_contact'; import { sendMessage, waitForReadTick } from './utilities/message'; @@ -70,7 +70,7 @@ sessionTestTwoWindows('Create contact', async ([windowA, windowB]) => { ]); }); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Block user in conversation list', async ({ aliceWindow1, bobWindow1, alice, bob }) => { // Create contact and send new message @@ -144,7 +144,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_no_network('Change username', async ({ aliceWindow1 }) => { +test_Alice1_no_network('Change username', async ({ aliceWindow1 }) => { const newUsername = 'Tiny bubble'; // Open Profile await clickOn(aliceWindow1, LeftPane.profileButton); @@ -171,43 +171,40 @@ test_Alice_1W_no_network('Change username', async ({ aliceWindow1 }) => { await clickOn(aliceWindow1, Global.modalCloseButton); }); -test_Alice_1W_no_network( - 'Change avatar', - async ({ aliceWindow1 }, testInfo) => { - // Open profile - await clickOn(aliceWindow1, LeftPane.profileButton); - // Click on current avatar - await clickOn(aliceWindow1, Settings.displayName); +test_Alice1_no_network('Change avatar', async ({ aliceWindow1 }, testInfo) => { + // Open profile + await clickOn(aliceWindow1, LeftPane.profileButton); + // Click on current avatar + await clickOn(aliceWindow1, Settings.displayName); - await clickOn(aliceWindow1, Settings.imageUploadSection); - await clickOn(aliceWindow1, Settings.imageUploadClick); - // allow for the image to be resized before we try to save it - await sleepFor(500); - await clickOn(aliceWindow1, Settings.saveProfileUpdateButton); - await waitForLoadingAnimationToFinish( - aliceWindow1, - Global.loadingSpinner.selector, - ); - await clickOnMatchingText( - aliceWindow1, - englishStrippedStr('save').toString(), - ); - await clickOn(aliceWindow1, Global.modalCloseButton); - await sleepFor(500); - const leftpaneAvatarContainer = await waitForTestIdWithText( - aliceWindow1, - LeftPane.profileButton.selector, - ); + await clickOn(aliceWindow1, Settings.imageUploadSection); + await clickOn(aliceWindow1, Settings.imageUploadClick); + // allow for the image to be resized before we try to save it + await sleepFor(500); + await clickOn(aliceWindow1, Settings.saveProfileUpdateButton); + await waitForLoadingAnimationToFinish( + aliceWindow1, + Global.loadingSpinner.selector, + ); + await clickOnMatchingText( + aliceWindow1, + englishStrippedStr('save').toString(), + ); + await clickOn(aliceWindow1, Global.modalCloseButton); + await sleepFor(500); + const leftpaneAvatarContainer = await waitForTestIdWithText( + aliceWindow1, + LeftPane.profileButton.selector, + ); - await compareElementScreenshot({ - element: leftpaneAvatarContainer, - snapshotName: 'avatar-updated-blue.jpeg', - testInfo, - }); - }, -); + await compareElementScreenshot({ + element: leftpaneAvatarContainer, + snapshotName: 'avatar-updated-blue.jpeg', + testInfo, + }); +}); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Set nickname', async ({ aliceWindow1, bobWindow1, alice, bob }) => { const nickname = 'new nickname for Bob'; @@ -253,7 +250,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Read status', async ({ aliceWindow1, bobWindow1, alice, bob }) => { await createContact(aliceWindow1, bobWindow1, alice, bob); @@ -298,7 +295,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_1W_Bob_1W( +test_Alice1_Bob1( 'Delete conversation', async ({ aliceWindow1, bobWindow1, alice, bob }) => { // Create contact and send new message @@ -363,7 +360,7 @@ test_Alice_1W_Bob_1W( }, ); -test_Alice_2W( +test_Alice2( 'Hide recovery password', async ({ aliceWindow1, aliceWindow2 }) => { await clickOn(aliceWindow1, LeftPane.settingsButton); @@ -411,7 +408,7 @@ test_Alice_2W( }, ); -test_Alice_1W_no_network('Invite a friend', async ({ aliceWindow1, alice }) => { +test_Alice1_no_network('Invite a friend', async ({ aliceWindow1, alice }) => { await clickOn(aliceWindow1, HomeScreen.plusButton); await clickOn(aliceWindow1, HomeScreen.inviteAFriendOption); await waitForTestIdWithText(aliceWindow1, 'your-account-id', alice.accountid); @@ -448,54 +445,51 @@ test_Alice_1W_no_network('Invite a friend', async ({ aliceWindow1, alice }) => { ); }); -test_Alice_1W_no_network( - 'Hide note to self', - async ({ aliceWindow1, alice }) => { - await clickOn(aliceWindow1, HomeScreen.plusButton); - await clickOn(aliceWindow1, HomeScreen.newMessageOption); - await typeIntoInput( - aliceWindow1, - 'new-session-conversation', - alice.accountid, - ); - await clickOn(aliceWindow1, HomeScreen.newMessageNextButton); - await waitForTestIdWithText( - aliceWindow1, - Conversation.conversationHeader.selector, - englishStrippedStr('noteToSelf').toString(), - ); - await clickOnWithText( - aliceWindow1, - HomeScreen.conversationItemName, - englishStrippedStr('noteToSelf').toString(), - { rightButton: true }, - ); - await clickOnWithText( - aliceWindow1, - Global.contextMenuItem, - englishStrippedStr('noteToSelfHide').toString(), - ); - await checkModalStrings( - aliceWindow1, - englishStrippedStr('noteToSelfHide').toString(), - englishStrippedStr('noteToSelfHideDescription').toString(), - ); - await clickOnWithText( - aliceWindow1, - Global.confirmButton, - englishStrippedStr('hide').toString(), - ); - await hasElementBeenDeleted( - aliceWindow1, - 'data-testid', - 'module-conversation__user__profile-name', - 5000, - englishStrippedStr('noteToSelf').toString(), - ); - }, -); +test_Alice1_no_network('Hide note to self', async ({ aliceWindow1, alice }) => { + await clickOn(aliceWindow1, HomeScreen.plusButton); + await clickOn(aliceWindow1, HomeScreen.newMessageOption); + await typeIntoInput( + aliceWindow1, + 'new-session-conversation', + alice.accountid, + ); + await clickOn(aliceWindow1, HomeScreen.newMessageNextButton); + await waitForTestIdWithText( + aliceWindow1, + Conversation.conversationHeader.selector, + englishStrippedStr('noteToSelf').toString(), + ); + await clickOnWithText( + aliceWindow1, + HomeScreen.conversationItemName, + englishStrippedStr('noteToSelf').toString(), + { rightButton: true }, + ); + await clickOnWithText( + aliceWindow1, + Global.contextMenuItem, + englishStrippedStr('noteToSelfHide').toString(), + ); + await checkModalStrings( + aliceWindow1, + englishStrippedStr('noteToSelfHide').toString(), + englishStrippedStr('noteToSelfHideDescription').toString(), + ); + await clickOnWithText( + aliceWindow1, + Global.confirmButton, + englishStrippedStr('hide').toString(), + ); + await hasElementBeenDeleted( + aliceWindow1, + 'data-testid', + 'module-conversation__user__profile-name', + 5000, + englishStrippedStr('noteToSelf').toString(), + ); +}); -test_Alice_1W_no_network('Toggle password', async ({ aliceWindow1 }) => { +test_Alice1_no_network('Toggle password', async ({ aliceWindow1 }) => { await clickOn(aliceWindow1, LeftPane.settingsButton); await clickOn(aliceWindow1, Settings.recoveryPasswordMenuItem); await waitForTestIdWithText( @@ -522,7 +516,7 @@ test_Alice_1W_no_network('Toggle password', async ({ aliceWindow1 }) => { ); }); -test_Alice_2W( +test_Alice2( 'Consistent avatar colours', async ({ aliceWindow1, aliceWindow2 }) => { const avatarColors = await Promise.all( diff --git a/yarn.lock b/yarn.lock index 692d8cd..0ff54fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -108,6 +108,45 @@ dependencies: playwright "1.51.1" +"@session-foundation/basic-types@0.0.6", "@session-foundation/basic-types@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@session-foundation/basic-types/-/basic-types-0.0.6.tgz#c141fb0b82af0ef6aafd8e9f4f68becc29bbfd75" + integrity sha512-7+ztoNhirWfCeiPbUFTWplI9Crk65UAiye0dGoKf9TWBTobyUis5PB57ySxUTA0putWlHss366wCtHsX51uzHg== + dependencies: + buffer-crc32 "^1.0.0" + +"@session-foundation/libsession-wasm@^0.0.7": + version "0.0.7" + resolved "https://registry.yarnpkg.com/@session-foundation/libsession-wasm/-/libsession-wasm-0.0.7.tgz#0294c62746fc21b11211b37188ac3868d474f0ab" + integrity sha512-j8tJgsDZhWFtUkm8pEPzfhFUFBNDtCNA46WShWgPSn1fU2h0C/96pC7DmSVEdVGW3nXTJ4XoOSaVd816iBAh1g== + +"@session-foundation/mnemonic@^0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@session-foundation/mnemonic/-/mnemonic-0.0.8.tgz#241c96d63dbfb93ae5f266780043540a64ad109a" + integrity sha512-8YCHnNDEiWdX46wy5knvXN/601J7Vs8mkqwf+4OCJP8ksnHz8CVZDpdwO/RVx1DwDx9fYZLd4OqugY/JexPdoQ== + dependencies: + buffer-crc32 "^1.0.0" + +"@session-foundation/qa-seeder@^0.1.23": + version "0.1.23" + resolved "https://registry.yarnpkg.com/@session-foundation/qa-seeder/-/qa-seeder-0.1.23.tgz#d2622ba8af9397b5596b1714e52e3a6230272036" + integrity sha512-GMXVqgBoPEHJpsXMOtxoXBi49wXh1JjHkn8pvGN767+gdfwfX2GXxdK3bHvA0LYpLJdSXgUXiUtWo5IMmrHbVg== + dependencies: + "@session-foundation/basic-types" "^0.0.6" + "@session-foundation/libsession-wasm" "^0.0.7" + "@session-foundation/mnemonic" "^0.0.8" + "@session-foundation/sodium" "^0.0.6" + lodash "^4.17.21" + +"@session-foundation/sodium@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@session-foundation/sodium/-/sodium-0.0.6.tgz#40b518927b220df897cb14281f7e0c0644bab9bf" + integrity sha512-PDecdG3LR9rOinPHGVlTaJc1E0e2SS6ctfFhfgrEbEW3ZWymLXO5D36oAfNY1yuxM2QyiXCO+L99IPv4biGZgw== + dependencies: + "@session-foundation/basic-types" "0.0.6" + buffer-crc32 "^1.0.0" + libsodium-wrappers-sumo "^0.7.15" + "@sindresorhus/is@^4.0.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -523,6 +562,11 @@ braces@^3.0.3: dependencies: fill-range "^7.1.1" +buffer-crc32@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-1.0.0.tgz#a10993b9055081d55304bd9feb4a072de179f405" + integrity sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w== + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" @@ -1542,6 +1586,18 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +libsodium-sumo@^0.7.16: + version "0.7.16" + resolved "https://registry.yarnpkg.com/libsodium-sumo/-/libsodium-sumo-0.7.16.tgz#85037acdf9029296373bf2a9f078930a723eedb5" + integrity sha512-x6atrz2AdXCJg6G709x9W9TTJRI6/0NcL5dD0l5GGVqNE48UJmDsjO4RUWYTeyXXUpg+NXZ2SHECaZnFRYzwGA== + +libsodium-wrappers-sumo@^0.7.15: + version "0.7.16" + resolved "https://registry.yarnpkg.com/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.16.tgz#53838cabe5d99768a3c070bdb65cd0043e0d0bfd" + integrity sha512-gR0JEFPeN3831lB9+ogooQk0KH4K5LSMIO5Prd5Q5XYR2wHFtZfPg0eP7t1oJIWq+UIzlU4WVeBxZ97mt28tXw== + dependencies: + libsodium-sumo "^0.7.16" + locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"