Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions tests/automation/call_checks.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { englishStrippedStr } from '../localization/englishStrippedStr';
import { tStripped } from '../localization/lib';
import { Global, HomeScreen } from './locators';
import { test_Alice_1W_Bob_1W } from './setup/sessionTest';
import { createContact } from './utilities/create_contact';
Expand All @@ -22,23 +22,21 @@ test_Alice_1W_Bob_1W(
await waitForTestIdWithText(
bobWindow1,
'call-notification-answered-a-call',
englishStrippedStr('callsInProgress').toString(),
tStripped('callsInProgress'),
);
// Control message should be '{callerName} called you'
// await waitForTestIdWithText(
// bobWindow1,
// 'call-notification-answered-a-call',
// englishStrippedStr('callsCalledYou')
// tStripped('callsCalledYou')
// .withArgs({ name: caller.userName })
// .toString(),
// );
// In the callers window, the message is 'You called {reciverName}'
await waitForTestIdWithText(
aliceWindow1,
'call-notification-started-call',
englishStrippedStr('callsYouCalled')
.withArgs({ name: bob.userName })
.toString(),
tStripped('callsYouCalled', { name: bob.userName }),
);
},
);
6 changes: 3 additions & 3 deletions tests/automation/community_tests.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { englishStrippedStr } from '../localization/englishStrippedStr';
import { tStripped } from '../localization/lib';
import { testCommunityName } from './constants/community';
import { Conversation, Global, HomeScreen } from './locators';
import { newUser } from './setup/new_user';
Expand Down Expand Up @@ -26,8 +26,8 @@ import {
waitForTestIdWithText,
} from './utilities/utils';

const banUserString = englishStrippedStr('banUser').toString();
const unbanUserString = englishStrippedStr('banUnbanUser').toString();
const banUserString = tStripped('banUser');
const unbanUserString = tStripped('banUnbanUser');

test_Alice_2W(
'Join community and sync',
Expand Down
15 changes: 6 additions & 9 deletions tests/automation/cta_donations.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Page } from '@playwright/test';

import { englishStrippedStr } from '../localization/englishStrippedStr';
import { tStripped } from '../localization/lib';
import { CTA, Global } from './locators';
import { test_Alice_1W } from './setup/sessionTest';
import { mockDBCreationTime } from './utilities/time_travel';
Expand All @@ -15,12 +15,9 @@ import {
async function verifyDonateCTAShows(window: Page) {
await checkCTAStrings(
window,
englishStrippedStr('donateSessionHelp').toString(),
englishStrippedStr('donateSessionDescription').toString(),
[
englishStrippedStr('donate').toString(),
englishStrippedStr('maybeLater').toString(),
],
tStripped('donateSessionHelp'),
tStripped('donateSessionDescription'),
[tStripped('donate'), tStripped('maybeLater')],
);
}

Expand Down Expand Up @@ -63,8 +60,8 @@ urlModalButtons.forEach(({ button, name }) => {
await clickOn(aliceWindow1, CTA.confirmButton);
await checkModalStrings(
aliceWindow1,
englishStrippedStr('urlOpen').toString(),
englishStrippedStr('urlOpenDescription').withArgs({ url }).toString(),
tStripped('urlOpen'),
tStripped('urlOpenDescription', { url }),
'openUrlModal',
);

Expand Down
28 changes: 8 additions & 20 deletions tests/automation/delete_account.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Page } from '@playwright/test';

import { englishStrippedStr } from '../localization/englishStrippedStr';
import { tStripped } from '../localization/lib';
import { sleepFor } from '../promise_utils';
import { Global, HomeScreen, LeftPane, Onboarding, Settings } from './locators';
import { forceCloseAllWindows } from './setup/closeWindows';
Expand Down Expand Up @@ -43,23 +43,17 @@ sessionTestTwoWindows(
await clickOnWithText(
windowA,
Settings.clearDataMenuItem,
englishStrippedStr('sessionClearData').toString(),
tStripped('sessionClearData'),
);
// Select entire account
await clickOnWithText(
windowA,
Settings.clearDeviceAndNetworkRadial,
englishStrippedStr('clearDeviceAndNetwork').toString(),
tStripped('clearDeviceAndNetwork'),
);
// Confirm deletion by clicking Clear, twice
await clickOnMatchingText(
windowA,
englishStrippedStr('clear').toString(),
);
await clickOnMatchingText(
windowA,
englishStrippedStr('clear').toString(),
);
await clickOnMatchingText(windowA, tStripped('clear'));
await clickOnMatchingText(windowA, tStripped('clear'));
await waitForLoadingAnimationToFinish(
windowA,
Global.loadingSpinner.selector,
Expand Down Expand Up @@ -136,18 +130,12 @@ sessionTestTwoWindows(
await clickOnWithText(
windowA,
Settings.clearDataMenuItem,
englishStrippedStr('sessionClearData').toString(),
tStripped('sessionClearData'),
);
// Keep 'Clear Device only' selection
// Confirm deletion by clicking Clear, twice
await clickOnMatchingText(
windowA,
englishStrippedStr('clear').toString(),
);
await clickOnMatchingText(
windowA,
englishStrippedStr('clear').toString(),
);
await clickOnMatchingText(windowA, tStripped('clear'));
await clickOnMatchingText(windowA, tStripped('clear'));
restoringWindows = await openApp(1);
const [restoringWindow] = restoringWindows;
// Sign in with deleted account and check that nothing restores
Expand Down
126 changes: 51 additions & 75 deletions tests/automation/disappearing_message_checks.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { englishStrippedStr } from '../localization/englishStrippedStr';
import { tStripped } from '../localization/lib';
import { sleepFor } from '../promise_utils';
import { testCommunityName } from './constants/community';
import {
Expand Down Expand Up @@ -60,23 +60,19 @@ mediaArray.forEach(
waitForTestIdWithText(
aliceWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSetYou')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
})
.toString(),
tStripped('disappearingMessagesSetYou', {
time: formattedTime,
disappearing_messages_type: disappearAction,
}),
),
waitForTestIdWithText(
bobWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSet')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
})
.toString(),
tStripped('disappearingMessagesSet', {
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
}),
),
]);
// Send media
Expand Down Expand Up @@ -128,23 +124,19 @@ test_Alice_1W_Bob_1W(
waitForTestIdWithText(
aliceWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSetYou')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
})
.toString(),
tStripped('disappearingMessagesSetYou', {
time: formattedTime,
disappearing_messages_type: disappearAction,
}),
),
waitForTestIdWithText(
bobWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSet')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
})
.toString(),
tStripped('disappearingMessagesSet', {
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
}),
),
]);
await typeIntoInput(aliceWindow1, 'message-input-text-area', longText);
Expand Down Expand Up @@ -173,23 +165,19 @@ test_Alice_1W_Bob_1W(
waitForTestIdWithText(
aliceWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSetYou')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
})
.toString(),
tStripped('disappearingMessagesSetYou', {
time: formattedTime,
disappearing_messages_type: disappearAction,
}),
),
waitForTestIdWithText(
bobWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSet')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
})
.toString(),
tStripped('disappearingMessagesSet', {
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
}),
),
]);
await sendLinkPreview(aliceWindow1, testLink);
Expand Down Expand Up @@ -227,23 +215,19 @@ test_Alice_1W_Bob_1W(
waitForTestIdWithText(
aliceWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSetYou')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
})
.toString(),
tStripped('disappearingMessagesSetYou', {
time: formattedTime,
disappearing_messages_type: disappearAction,
}),
),
waitForTestIdWithText(
bobWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSet')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
})
.toString(),
tStripped('disappearingMessagesSet', {
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
}),
),
]);
await joinCommunity(aliceWindow1);
Expand All @@ -254,7 +238,7 @@ test_Alice_1W_Bob_1W(
await waitForTestIdWithText(
aliceWindow1,
'modal-heading',
englishStrippedStr('membersInvite').toString(),
tStripped('membersInvite'),
);
await clickOnWithText(aliceWindow1, Global.contactItem, bob.userName);
await clickOn(aliceWindow1, Global.confirmButton);
Expand Down Expand Up @@ -321,23 +305,19 @@ test_Alice_1W_Bob_1W(
waitForTestIdWithText(
aliceWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSetYou')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
})
.toString(),
tStripped('disappearingMessagesSetYou', {
time: formattedTime,
disappearing_messages_type: disappearAction,
}),
),
waitForTestIdWithText(
bobWindow1,
Conversation.disappearingControlMessage.selector,
englishStrippedStr('disappearingMessagesSet')
.withArgs({
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
})
.toString(),
tStripped('disappearingMessagesSet', {
time: formattedTime,
disappearing_messages_type: disappearAction,
name: alice.userName,
}),
),
]);
await makeVoiceCall(aliceWindow1, bobWindow1);
Expand All @@ -346,15 +326,13 @@ test_Alice_1W_Bob_1W(
waitForTestIdWithText(
bobWindow1,
'call-notification-answered-a-call',
englishStrippedStr('callsInProgress').toString(),
tStripped('callsInProgress'),
),
// In the callers window, the message is 'You called {reciverName}'
waitForTestIdWithText(
aliceWindow1,
'call-notification-started-call',
englishStrippedStr('callsYouCalled')
.withArgs({ name: bob.userName })
.toString(),
tStripped('callsYouCalled', { name: bob.userName }),
),
]);
// Wait 30 seconds for call message to disappear
Expand All @@ -365,16 +343,14 @@ test_Alice_1W_Bob_1W(
'data-testid',
'call-notification-answered-a-call',
undefined,
englishStrippedStr('callsInProgress').toString(),
tStripped('callsInProgress'),
),
hasElementBeenDeleted(
aliceWindow1,
'data-testid',
'call-notification-started-call',
undefined,
englishStrippedStr('callsYouCalled')
.withArgs({ name: bob.userName })
.toString(),
tStripped('callsYouCalled', { name: bob.userName }),
),
]);
},
Expand Down
Loading