Skip to content

chore: run from artefact url #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 0 additions & 3 deletions screenshots/Change-avatar/avatar-updated-blue-darwin.jpeg

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions screenshots/landing-page-states/new-account-darwin.png

This file was deleted.

3 changes: 0 additions & 3 deletions screenshots/landing-page-states/restored-account-darwin.png

This file was deleted.

4 changes: 2 additions & 2 deletions tests/automation/create_user.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ sessionTestOneWindow('Create User', async ([window]) => {
await sleepFor(100, true);
// check username matches
await waitForTestIdWithText(window, 'your-profile-name', userA.userName);
// check session id matches
await waitForTestIdWithText(window, 'your-session-id', userA.accountid);
// check Account ID matches
await waitForTestIdWithText(window, 'your-account-id', userA.accountid);
// exit profile modal
await clickOnTestIdWithText(window, 'modal-close-button');
// go to settings section
Expand Down
2 changes: 1 addition & 1 deletion tests/automation/disappearing_message_checks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ test_Alice_1W_Bob_1W(
// To stop the layout shift
await sleepFor(500);
await clickOnTestIdWithText(aliceWindow1, 'conversation-options-avatar');
await clickOnTestIdWithText(aliceWindow1, 'add-user-button');
await clickOnTestIdWithText(aliceWindow1, 'invite-contacts-menu-option');
await waitForTestIdWithText(
aliceWindow1,
'modal-heading',
Expand Down
2 changes: 1 addition & 1 deletion tests/automation/disappearing_messages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ test_Alice_2W_Bob_1W(
await clickOnElement({
window: aliceWindow1,
strategy: 'data-testid',
selector: 'disappearing-messages',
selector: 'disappearing-messages-menu-option',
maxWait: 100,
});
await clickOnElement({
Expand Down
10 changes: 8 additions & 2 deletions tests/automation/enforce_localized_str.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ function getExpectedStringFromKey(
return 'Your IP is visible to your call partner and a Session Technology Foundation server while using beta calls.';
case 'blockDescription':
return 'Are you sure you want to block {name}? Blocked users cannot send you message requests, group invites or call you.';
case 'conversationsDeleteDescription':
return 'Are you sure you want to delete your conversation with {name}? New messages from {name} will start a new conversation.';
case 'noteToSelfHide':
return 'Hide Note to Self';
case 'noteToSelfHideDescription':
Expand Down Expand Up @@ -236,6 +234,14 @@ function getExpectedStringFromKey(
return 'View QR';
case 'recoveryPasswordView':
return 'View Password';
case 'deleteConversationDescription':
return 'Are you sure you want to delete your conversation with {name}? This will permanently delete all messages and attachments.';
case 'manageMembers':
return 'Manage Members';
case 'recoveryPasswordHidePermanentlyDescription1':
return 'Without your recovery password, you cannot load your account on new devices. We strongly recommend you save your recovery password in a safe and secure place before continuing.';
case 'recoveryPasswordHidePermanentlyDescription2':
return 'Are you sure you want to permanently hide your recovery password on this device? This cannot be undone.';
default:
// returning nul means we don't have an expected string yet for this key.
// This will make the test fail
Expand Down
10 changes: 3 additions & 7 deletions tests/automation/group_testing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W_Dracula_1W(
await clickOnElement({
window: aliceWindow1,
strategy: 'data-testid',
selector: 'add-user-button',
selector: 'invite-contacts-menu-option',
});
// Waiting for animation of right panel to appear
await sleepFor(1000);
Expand Down Expand Up @@ -140,8 +140,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W(
// Click on edit group name
await clickOnTestIdWithText(aliceWindow1, 'conversation-options-avatar');
await clickOnTestIdWithText(aliceWindow1, 'edit-group-name');
await typeIntoInput(aliceWindow1, 'group-name-input', ' ');
await aliceWindow1.keyboard.press('Enter');
await clickOnTestIdWithText(aliceWindow1, 'clear-group-info-name-button');
await waitForTestIdWithText(aliceWindow1, 'error-message');
const actualError = await grabTextFromElement(
aliceWindow1,
Expand All @@ -157,10 +156,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W(
aliceWindow1,
englishStrippedStr('cancel').toString(),
);
await clickOnTestIdWithText(
aliceWindow1,
'back-button-conversation-options',
);
await clickOnTestIdWithText(aliceWindow1, 'modal-close-button');
},
);

Expand Down
8 changes: 4 additions & 4 deletions tests/automation/input_validations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ import {
await clickOnTestIdWithText(window, 'existing-account-button');
await typeIntoInput(window, 'recovery-phrase-input', incorrectSeed);
await clickOnTestIdWithText(window, 'continue-button');
await waitForTestIdWithText(window, 'session-error-message');
await waitForTestIdWithText(window, 'error-message');
const actualError = await grabTextFromElement(
window,
'data-testid',
'session-error-message',
'error-message',
);
if (actualError !== expectedError) {
throw new Error(
Expand Down Expand Up @@ -74,11 +74,11 @@ import {
await clickOnTestIdWithText(window, 'create-account-button');
await typeIntoInput(window, 'display-name-input', displayName);
await clickOnTestIdWithText(window, 'continue-button');
await waitForTestIdWithText(window, 'session-error-message');
await waitForTestIdWithText(window, 'error-message');
const actualError = await grabTextFromElement(
window,
'data-testid',
'session-error-message',
'error-message',
);
if (testName === 'No name') {
console.log('Expected failure: see SES-2832');
Expand Down
6 changes: 6 additions & 0 deletions tests/automation/landing_page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { compareScreenshot, waitForElement } from './utilities/utils';

export type ElementState = 'new-account' | 'restored-account';

// TODO: Normalize screenshot dimensions before comparison to handle different pixel densities (e.g. with sharp)
// This would fix MacBook Retina (2x) vs M4 Mac Mini (1x) pixel density differences (1000x1584 vs 500x792)
// Alternatives:
// - Try to set deviceScaleFactor: 1 in Playwright context to force consistent scaling
// - Record pixel density dependent screenshots

test_Alice_2W(
`Landing page states`,
async ({ aliceWindow1, aliceWindow2 }, testInfo) => {
Expand Down
14 changes: 8 additions & 6 deletions tests/automation/linked_device_group.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ test_group_Alice_1W_Bob_1W_Charlie_1W(
// Check for group members
await clickOnTestIdWithText(aliceWindow2, 'conversation-options-avatar');
// Check right panel has correct name
await waitForTestIdWithText(aliceWindow2, 'right-panel-group-name');
await clickOnTestIdWithText(aliceWindow2, 'group-members');
await waitForTestIdWithText(aliceWindow2, 'group-name');
await clickOnTestIdWithText(aliceWindow2, 'manage-members-menu-option');
await waitForTestIdWithText(
aliceWindow2,
'modal-heading',
englishStrippedStr('groupMembers').toString(),
englishStrippedStr('manageMembers').toString(),
);
// Check for You, Bob and Charlie
await Promise.all([
Expand Down Expand Up @@ -181,7 +181,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W(
);
// Check for group members
await clickOnTestIdWithText(aliceWindow2, 'conversation-options-avatar');
await clickOnTestIdWithText(aliceWindow2, 'group-members');
await clickOnTestIdWithText(aliceWindow2, 'manage-members-menu-option');
// Check for You, Bob and Charlie
await Promise.all([
waitForTestIdWithText(
Expand All @@ -193,6 +193,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W(
waitForTestIdWithText(aliceWindow2, 'contact', charlie.userName),
]);
await clickOnTestIdWithText(aliceWindow2, 'session-confirm-cancel-button');
await clickOnTestIdWithText(aliceWindow2, 'modal-close-button');
// Delete device data on alicewindow2
await clearDataOnWindow(aliceWindow2);
const [restoredWindow] = await openApp(1);
Expand All @@ -217,7 +218,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W(
);
// Check for group members
await clickOnTestIdWithText(restoredWindow, 'conversation-options-avatar');
await clickOnTestIdWithText(restoredWindow, 'group-members');
await clickOnTestIdWithText(restoredWindow, 'manage-members-menu-option');
// Check for You, Bob and Charlie
await Promise.all([
waitForTestIdWithText(
Expand All @@ -233,6 +234,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W(
restoredWindow,
'session-confirm-cancel-button',
);
await clickOnTestIdWithText(restoredWindow, 'modal-close-button');
// Delete device data on restoredWindow
await clearDataOnWindow(restoredWindow);
const [restoredWindow2] = await openApp(1);
Expand All @@ -257,7 +259,7 @@ test_group_Alice_1W_Bob_1W_Charlie_1W(
);
// Check for group members
await clickOnTestIdWithText(restoredWindow2, 'conversation-options-avatar');
await clickOnTestIdWithText(restoredWindow2, 'group-members');
await clickOnTestIdWithText(restoredWindow2, 'manage-members-menu-option');
// Check for You, Bob and Charlie
await Promise.all([
waitForTestIdWithText(
Expand Down
10 changes: 5 additions & 5 deletions tests/automation/linked_device_user.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ sessionTestOneWindow('Link a device', async ([aliceWindow1]) => {
'your-profile-name',
userA.userName,
);
// Verify Session ID
// Verify Account ID
await waitForTestIdWithText(
aliceWindow1,
'your-session-id',
'your-account-id',
userA.accountid,
);
// exit profile modal
Expand Down Expand Up @@ -161,7 +161,7 @@ test_Alice_2W(
});
// This file is saved in `Profile-picture-syncs` folder
expect(screenshot).toMatchSnapshot({
name: 'avatar-updated-blue.jpeg',
name: `avatar-updated-blue.jpeg`,
});
correctScreenshot = true;
console.info(
Expand Down Expand Up @@ -407,7 +407,7 @@ test_Alice_2W_Bob_1W(
await checkModalStrings(
aliceWindow1,
englishStrippedStr('conversationsDelete').toString(),
englishStrippedStr('conversationsDeleteDescription')
englishStrippedStr('deleteConversationDescription')
.withArgs({ name: bob.userName })
.toString(),
);
Expand Down Expand Up @@ -501,7 +501,7 @@ test_Alice_2W(
aliceWindow2,
'data-testid',
'module-conversation__user__profile-name',
8000,
10000,
englishStrippedStr('noteToSelf').toString(),
),
]);
Expand Down
2 changes: 1 addition & 1 deletion tests/automation/message_checks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ test_Alice_1W_Bob_1W(
await createContact(aliceWindow1, bobWindow1, alice, bob);
await joinCommunity(aliceWindow1);
await clickOnTestIdWithText(aliceWindow1, 'conversation-options-avatar');
await clickOnTestIdWithText(aliceWindow1, 'add-user-button');
await clickOnTestIdWithText(aliceWindow1, 'invite-contacts-menu-option');
await waitForTestIdWithText(
aliceWindow1,
'modal-heading',
Expand Down
6 changes: 3 additions & 3 deletions tests/automation/setup/new_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export const newUser = async (
// await clickOnTestIdWithText(window, 'modal-close-button');
await clickOnTestIdWithText(window, 'leftpane-primary-avatar');

// Save session ID to a variable
let accountid = await window.innerText('[data-testid=your-session-id]');
accountid = accountid.replace(/(\r\n|\n|\r)/gm, ''); // remove the new line in the SessionID as it is rendered with one forced
// Save Account ID to a variable
let accountid = await window.innerText('[data-testid=your-account-id]');
accountid = accountid.replace(/(\r\n|\n|\r)/gm, ''); // remove the new line in the Account ID as it is rendered with one forced

console.log(
`${userName}: Account ID: "${chalk.blue(
Expand Down
19 changes: 9 additions & 10 deletions tests/automation/types/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export type MediaType = 'image' | 'video' | 'audio' | 'file';
export type Strategy = 'data-testid' | 'class' | ':has-text';

// Would be good to find a way to sort those with prettier
// TODO sort with eslint plugin perfectionist
export type DataTestId =
| 'session-id-signup'
| 'display-name-input'
Expand All @@ -89,7 +90,6 @@ export type DataTestId =
| 'control-message'
| 'disappear-control-message'
| 'disappearing-messages-indicator'
| 'back-button-conversation-options'
| 'conversation-options-avatar'
| 'settings-section'
| 'clear-data-settings-menu-item'
Expand All @@ -107,7 +107,7 @@ export type DataTestId =
| 'disappearing-messages-dropdown'
| 'session-toast'
| 'accept-message-request'
| 'confirm-nickname'
| 'set-nickname-confirm-button'
| 'nickname-input'
| 'three-dots-conversation-options'
| 'message-section'
Expand Down Expand Up @@ -142,22 +142,20 @@ export type DataTestId =
| 'new-closed-group-name'
| 'create-group-button'
| 'link-device'
| 'group-name-input'
| 'right-panel-group-name'
| 'update-group-info-name-input'
| 'group-name'
| 'header-conversation-name'
| 'copy-button-profile-update'
| 'loading-spinner'
| 'empty-conversation-notification'
| 'your-profile-name'
| 'your-session-id'
| 'mentions-popup-row'
| 'enable-read-receipts'
| 'disappear-set-button'
| 'disappear-after-read-option'
| 'disappearing-messages'
| 'disappearing-messages-menu-option'
| 'disappear-after-send-option'
| 'disappear-set-button'
| 'add-user-button'
| 'message-content'
| 'group-update-message'
| 'message-request-response-message'
Expand All @@ -168,7 +166,6 @@ export type DataTestId =
| 'existing-account-button'
| 'context-menu-item'
| 'modal-description'
| 'session-error-message'
| DMTimeOption
| `input-${DMTimeOption}`
| 'disappear-messages-type-and-time'
Expand All @@ -189,6 +186,8 @@ export type DataTestId =
| 'link-preview-image'
| 'link-preview-title'
| 'error-message'
| 'group-members'
| 'manage-members-menu-option'
| 'session-confirm-cancel-button'
| 'session-recovery-password';
| 'session-recovery-password'
| 'invite-contacts-menu-option'
| 'clear-group-info-name-button';
10 changes: 8 additions & 2 deletions tests/automation/user_actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ test_Alice_1W_no_network('Change username', async ({ aliceWindow1 }) => {
await clickOnTestIdWithText(aliceWindow1, 'modal-close-button');
});

// TODO: Normalize screenshot dimensions before comparison to handle different pixel densities (e.g. with sharp)
// This would fix MacBook Retina (2x) vs M4 Mac Mini (1x) pixel density differences (56x56 vs 28x28)
// Alternatives:
// - Try to set deviceScaleFactor: 1 in Playwright context to force consistent scaling
// - Record pixel density dependent screenshots

test_Alice_1W_no_network(
'Change avatar',
async ({ aliceWindow1 }, testInfo) => {
Expand Down Expand Up @@ -248,7 +254,7 @@ test_Alice_1W_Bob_1W(
await sleepFor(100);
await clickOnTestIdWithText(
aliceWindow1,
'confirm-nickname',
'set-nickname-confirm-button',
englishStrippedStr('save').toString(),
);
await sleepFor(1000);
Expand Down Expand Up @@ -370,7 +376,7 @@ test_Alice_1W_Bob_1W(
await checkModalStrings(
aliceWindow1,
englishStrippedStr('conversationsDelete').toString(),
englishStrippedStr('conversationsDeleteDescription')
englishStrippedStr('deleteConversationDescription')
.withArgs({ name: bob.userName })
.toString(),
);
Expand Down
8 changes: 4 additions & 4 deletions tests/automation/utilities/rename_group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export const renameGroup = async (
await clickOnMatchingText(window, oldGroupName);
await clickOnTestIdWithText(window, 'conversation-options-avatar');
await clickOnTestIdWithText(window, 'edit-group-name');
await typeIntoInput(window, 'group-name-input', newGroupName);
await typeIntoInput(window, 'update-group-info-name-input', newGroupName);
await window.keyboard.press('Enter');
await clickOnMatchingText(window, englishStrippedStr('okay').toString());
await waitForTestIdWithText(window, 'right-panel-group-name', newGroupName);
await clickOnTestIdWithText(window, 'back-button-conversation-options');
await clickOnMatchingText(window, englishStrippedStr('save').toString());
await waitForTestIdWithText(window, 'group-name', newGroupName);
await clickOnTestIdWithText(window, 'modal-close-button');
// Check config message
await waitForMatchingText(
window,
Expand Down
Loading