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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"eslint": "^9.14.0",
"eslint-plugin-perfectionist": "^4.15.0",
"fs-extra": "^11.3.0",
"fuse.js": "^7.1.0",
"gh-pages": "^6.3.0",
"glob": "^11.0.3",
"globals": "^15.12.0",
Expand Down
13 changes: 12 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@ const useAllure = process.env.CI === '1' && process.env.ALLURE_ENABLED !== 'fals
const baseReporter: ReporterDescription = [
'./node_modules/@session-foundation/playwright-reporter/dist/index.js',
];
const allureReporter: ReporterDescription = ['allure-playwright', { resultsDir: allureResultsDir }];
const allureReporter: ReporterDescription = [
'allure-playwright',
{
resultsDir: allureResultsDir,
categories: [
{
name: 'Self-healed tests', // Custom category to group healed tests for better visibility
messageRegex: '.*healed.*',
},
],
},
];

export default defineConfig({
timeout: 480000,
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/disappear_after_send_off_1o1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ async function disappearAfterSendOff1o1(platform: SupportedPlatformsType, testIn
await sleepFor(500);
await bob1.checkModalStrings(
englishStrippedStr('disappearingMessagesFollowSetting').toString(),
englishStrippedStr('disappearingMessagesFollowSettingOff').toString(),
false
englishStrippedStr('disappearingMessagesFollowSettingOff').toString()
);
await bob1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Confirm' });
// Check conversation subtitle?
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/disappearing_link.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ async function disappearingLinkMessage1o1Android(
await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => {
await alice1.checkModalStrings(
englishStrippedStr('linkPreviewsEnable').toString(),
englishStrippedStr('linkPreviewsFirstDescription').toString(),
false
englishStrippedStr('linkPreviewsFirstDescription').toString()
);
});
await alice1.clickOnByAccessibilityID('Enable');
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/group_disappearing_messages_link.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ async function disappearingLinkMessageGroup(platform: SupportedPlatformsType, te
await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => {
await alice1.checkModalStrings(
englishStrippedStr('linkPreviewsEnable').toString(),
englishStrippedStr('linkPreviewsFirstDescription').toString(),
false
englishStrippedStr('linkPreviewsFirstDescription').toString()
);
});
// Accept link preview modal
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/group_message_link_preview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ async function sendLinkGroupAndroid(platform: SupportedPlatformsType, testInfo:
// Accept dialog for link preview
await alice1.checkModalStrings(
englishStrippedStr('linkPreviewsEnable').toString(),
englishStrippedStr('linkPreviewsFirstDescription').toString(),
true
englishStrippedStr('linkPreviewsFirstDescription').toString()
);
await alice1.clickOnByAccessibilityID('Enable');
//wait for preview to generate
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/linked_device_hide_note_to_self.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ async function hideNoteToSelf(platform: SupportedPlatformsType, testInfo: TestIn
await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => {
await alice1.checkModalStrings(
englishStrippedStr('noteToSelfHide').toString(),
englishStrippedStr('hideNoteToSelfDescription').toString(), // This one fails on iOS, see SES-4144
false
englishStrippedStr('hideNoteToSelfDescription').toString() // This one fails on iOS, see SES-4144
);
});
await alice1.clickOnByAccessibilityID('Hide');
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/message_link_preview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ async function sendLinkAndroid(platform: SupportedPlatformsType, testInfo: TestI
// Accept dialog for link preview
await alice1.checkModalStrings(
englishStrippedStr('linkPreviewsEnable').toString(),
englishStrippedStr('linkPreviewsFirstDescription').toString(),
true
englishStrippedStr('linkPreviewsFirstDescription').toString()
);
await alice1.clickOnElementAll({
strategy: 'accessibility id',
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/message_requests_block.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ async function blockedRequest(platform: SupportedPlatformsType, testInfo: TestIn
await sleepFor(1000);
await device2.checkModalStrings(
englishStrippedStr('block').toString(),
englishStrippedStr('blockDescription').withArgs({ name: alice.userName }).toString(),
false
englishStrippedStr('blockDescription').withArgs({ name: alice.userName }).toString()
);
await device2.clickOnByAccessibilityID('Block'); // This is an old Android modal so can't use the modern locator class
// "messageRequestsNonePending": "No pending message requests",
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/message_requests_clear_all.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ async function clearAllRequests(platform: SupportedPlatformsType, testInfo: Test
await device2.clickOnByAccessibilityID('Clear all');
await device2.checkModalStrings(
englishStrippedStr('clearAll').toString(),
englishStrippedStr('messageRequestsClearAllExplanation').toString(),
true
englishStrippedStr('messageRequestsClearAllExplanation').toString()
);
await device2.clickOnByAccessibilityID('Clear');
// "messageRequestsNonePending": "No pending message requests",
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/message_requests_decline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ async function declineRequest(platform: SupportedPlatformsType, testInfo: TestIn
.onAndroid()
.checkModalStrings(
englishStrippedStr('delete').toString(),
englishStrippedStr('messageRequestsContactDelete').toString(),
false
englishStrippedStr('messageRequestsContactDelete').toString()
);
await device2.clickOnElementAll(new DeleteMesssageRequestConfirmation(device2));
// "messageRequestsNonePending": "No pending message requests",
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/message_requests_delete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ async function deleteRequest(platform: SupportedPlatformsType, testInfo: TestInf
.onAndroid()
.checkModalStrings(
englishStrippedStr('delete').toString(),
englishStrippedStr('messageRequestsContactDelete').toString(),
false
englishStrippedStr('messageRequestsContactDelete').toString()
);
await device2.clickOnElementAll(new DeleteMesssageRequestConfirmation(device2));
// "messageRequestsNonePending": "No pending message requests",
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/user_actions_block_conversation_list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ async function blockUserInConversationList(platform: SupportedPlatformsType, tes
await alice1.clickOnElementAll(new LongPressBlockOption(alice1));
await alice1.checkModalStrings(
englishStrippedStr('block').toString(),
englishStrippedStr('blockDescription').withArgs({ name: USERNAME.BOB }).toString(),
false
englishStrippedStr('blockDescription').withArgs({ name: USERNAME.BOB }).toString()
);
await alice1.clickOnByAccessibilityID('Block');
// Once you block the conversation disappears from the home screen
Expand Down
3 changes: 1 addition & 2 deletions run/test/specs/user_actions_delete_conversation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ async function deleteConversation(platform: SupportedPlatformsType, testInfo: Te
englishStrippedStr('conversationsDelete').toString(),
englishStrippedStr('deleteConversationDescription')
.withArgs({ name: USERNAME.BOB })
.toString(),
false
.toString()
);
});
await alice1.clickOnByAccessibilityID('Delete');
Expand Down
6 changes: 2 additions & 4 deletions run/test/specs/user_actions_unblock_user.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ async function unblockUser(platform: SupportedPlatformsType, testInfo: TestInfo)
await alice1.clickOnElementAll(new BlockUser(alice1));
await alice1.checkModalStrings(
englishStrippedStr('block').toString(),
englishStrippedStr('blockDescription').withArgs({ name: bob.userName }).toString(),
true
englishStrippedStr('blockDescription').withArgs({ name: bob.userName }).toString()
);
await alice1.clickOnElementAll(new BlockUserConfirmationModal(alice1));
await alice1.navigateBack();
Expand All @@ -59,8 +58,7 @@ async function unblockUser(platform: SupportedPlatformsType, testInfo: TestInfo)
await alice1.clickOnElementAll(new BlockedBanner(alice1));
await alice1.checkModalStrings(
englishStrippedStr('blockUnblock').toString(),
englishStrippedStr('blockUnblockName').withArgs({ name: bob.userName }).toString(),
false
englishStrippedStr('blockUnblockName').withArgs({ name: bob.userName }).toString()
);
await alice1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Unblock' });
await alice1.verifyElementNotPresent({ ...new BlockedBanner(alice1).build(), maxWait: 2000 });
Expand Down
39 changes: 22 additions & 17 deletions run/test/specs/utils/open_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const openAppMultipleDevices = async (
): Promise<DeviceWrapper[]> => {
// Create an array of promises for each device
const devicePromises = Array.from({ length: numberOfDevices }, (_, index) =>
openAppOnPlatform(platform, index as CapabilitiesIndexType)
openAppOnPlatform(platform, index as CapabilitiesIndexType, testInfo)
);

// Use Promise.all to wait for all device apps to open
Expand All @@ -47,12 +47,15 @@ export const openAppMultipleDevices = async (

const openAppOnPlatform = async (
platform: SupportedPlatformsType,
capabilitiesIndex: CapabilitiesIndexType
capabilitiesIndex: CapabilitiesIndexType,
testInfo: TestInfo
): Promise<{
device: DeviceWrapper;
}> => {
console.info('starting capabilitiesIndex', capabilitiesIndex, platform);
return platform === 'ios' ? openiOSApp(capabilitiesIndex) : openAndroidApp(capabilitiesIndex);
return platform === 'ios'
? openiOSApp(capabilitiesIndex, testInfo)
: openAndroidApp(capabilitiesIndex, testInfo);
};

export const openAppOnPlatformSingleDevice = async (
Expand All @@ -61,7 +64,7 @@ export const openAppOnPlatformSingleDevice = async (
): Promise<{
device: DeviceWrapper;
}> => {
const result = await openAppOnPlatform(platform, 0);
const result = await openAppOnPlatform(platform, 0, testInfo);

registerDevicesForTest(testInfo, [result.device], platform);

Expand All @@ -76,8 +79,8 @@ export const openAppTwoDevices = async (
device2: DeviceWrapper;
}> => {
const [app1, app2] = await Promise.all([
openAppOnPlatform(platform, 0),
openAppOnPlatform(platform, 1),
openAppOnPlatform(platform, 0, testInfo),
openAppOnPlatform(platform, 1, testInfo),
]);

const result = { device1: app1.device, device2: app2.device };
Expand All @@ -96,9 +99,9 @@ export const openAppThreeDevices = async (
device3: DeviceWrapper;
}> => {
const [app1, app2, app3] = await Promise.all([
openAppOnPlatform(platform, 0),
openAppOnPlatform(platform, 1),
openAppOnPlatform(platform, 2),
openAppOnPlatform(platform, 0, testInfo),
openAppOnPlatform(platform, 1, testInfo),
openAppOnPlatform(platform, 2, testInfo),
]);

const result = {
Expand All @@ -122,10 +125,10 @@ export const openAppFourDevices = async (
device4: DeviceWrapper;
}> => {
const [app1, app2, app3, app4] = await Promise.all([
openAppOnPlatform(platform, 0),
openAppOnPlatform(platform, 1),
openAppOnPlatform(platform, 2),
openAppOnPlatform(platform, 3),
openAppOnPlatform(platform, 0, testInfo),
openAppOnPlatform(platform, 1, testInfo),
openAppOnPlatform(platform, 2, testInfo),
openAppOnPlatform(platform, 3, testInfo),
]);

const result = {
Expand Down Expand Up @@ -204,7 +207,8 @@ async function waitForEmulatorToBeRunning(emulatorName: string) {
}

const openAndroidApp = async (
capabilitiesIndex: CapabilitiesIndexType
capabilitiesIndex: CapabilitiesIndexType,
testInfo: TestInfo
): Promise<{
device: DeviceWrapper;
}> => {
Expand Down Expand Up @@ -254,7 +258,7 @@ const openAndroidApp = async (
const device = new AndroidUiautomator2Driver(opts);
const udid = getAndroidUdid(actualCapabilitiesIndex);
console.log(`udid: ${udid}`);
const wrappedDevice = new DeviceWrapper(device, udid);
const wrappedDevice = new DeviceWrapper(device, udid, testInfo);

await runScriptAndLog(`${getAdbFullPath()} -s ${targetName} shell settings put global heads_up_notifications_enabled 0
`);
Expand All @@ -277,7 +281,8 @@ const openAndroidApp = async (
};

const openiOSApp = async (
capabilitiesIndex: CapabilitiesIndexType
capabilitiesIndex: CapabilitiesIndexType,
testInfo: TestInfo
): Promise<{
device: DeviceWrapper;
}> => {
Expand All @@ -294,7 +299,7 @@ const openiOSApp = async (
const capabilities = getIosCapabilities(actualCapabilitiesIndex as CapabilitiesIndexType);
const udid = capabilities.alwaysMatch['appium:udid'] as string;

const { device: wrappedDevice } = await cleanPermissions(opts, udid, capabilities);
const { device: wrappedDevice } = await cleanPermissions(opts, udid, capabilities, testInfo);
return { device: wrappedDevice };
};

Expand Down
6 changes: 4 additions & 2 deletions run/test/specs/utils/permissions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { TestInfo } from '@playwright/test';
import { W3CCapabilities } from '@wdio/types/build/Capabilities';
import { XCUITestDriver, XCUITestDriverOpts } from 'appium-xcuitest-driver/build/lib/driver';

Expand All @@ -8,7 +9,8 @@ import { runScriptAndLog } from './utilities';
export const cleanPermissions = async (
opts: XCUITestDriverOpts,
udid: string,
capabilities: W3CCapabilities
capabilities: W3CCapabilities,
testInfo: TestInfo
) => {
let wrappedDevice: DeviceWrapper | null = null;
const maxRetries = 3;
Expand All @@ -17,7 +19,7 @@ export const cleanPermissions = async (
do {
try {
const device: XCUITestDriver = new XCUITestDriver(opts);
wrappedDevice = new DeviceWrapper(device, udid);
wrappedDevice = new DeviceWrapper(device, udid, testInfo);

await wrappedDevice.createSession(capabilities);
// This function closes any pop up that hasn't been dismissed from a previous test (only happens for iOS currently)
Expand Down
9 changes: 3 additions & 6 deletions run/test/specs/voice_calls.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ async function voiceCallAndroid(platform: SupportedPlatformsType, testInfo: Test
await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('enable calls permission'), async () => {
await alice1.checkModalStrings(
englishStrippedStr('callsPermissionsRequired').toString(),
englishStrippedStr('callsPermissionsRequiredDescription').toString(),
false
englishStrippedStr('callsPermissionsRequiredDescription').toString()
);
await alice1.clickOnElementAll({
strategy: 'accessibility id',
Expand All @@ -177,8 +176,7 @@ async function voiceCallAndroid(platform: SupportedPlatformsType, testInfo: Test
await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('beta calls'), async () => {
await alice1.checkModalStrings(
englishStrippedStr('callsVoiceAndVideoBeta').toString(),
englishStrippedStr('callsVoiceAndVideoModalDescription').toString(),
false
englishStrippedStr('callsVoiceAndVideoModalDescription').toString()
);
await alice1.clickOnByAccessibilityID('Enable');
});
Expand All @@ -188,8 +186,7 @@ async function voiceCallAndroid(platform: SupportedPlatformsType, testInfo: Test
await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('notifications permission'), async () => {
await alice1.checkModalStrings(
englishStrippedStr('sessionNotifications').toString(),
englishStrippedStr('callsNotificationsRequired').toString(),
false
englishStrippedStr('callsNotificationsRequired').toString()
);
await alice1.clickOnElementAll(new NotificationSettings(alice1));
await alice1.clickOnElementAll(new NotificationSwitch(alice1));
Expand Down
Loading
Loading