Skip to content

Commit d11d033

Browse files
authored
feat: add self-healing capabilities (#69)
* feat: add fuse.js * feat: add custom category for healed tests * feat: add self-healing locators * feat: strip system element prefixes * fix: remove findwithfallback from checkmodalstrings
1 parent 94b814c commit d11d033

21 files changed

+218
-91
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"eslint": "^9.14.0",
3838
"eslint-plugin-perfectionist": "^4.15.0",
3939
"fs-extra": "^11.3.0",
40+
"fuse.js": "^7.1.0",
4041
"gh-pages": "^6.3.0",
4142
"glob": "^11.0.3",
4243
"globals": "^15.12.0",

playwright.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@ const useAllure = process.env.CI === '1' && process.env.ALLURE_ENABLED !== 'fals
1818
const baseReporter: ReporterDescription = [
1919
'./node_modules/@session-foundation/playwright-reporter/dist/index.js',
2020
];
21-
const allureReporter: ReporterDescription = ['allure-playwright', { resultsDir: allureResultsDir }];
21+
const allureReporter: ReporterDescription = [
22+
'allure-playwright',
23+
{
24+
resultsDir: allureResultsDir,
25+
categories: [
26+
{
27+
name: 'Self-healed tests', // Custom category to group healed tests for better visibility
28+
messageRegex: '.*healed.*',
29+
},
30+
],
31+
},
32+
];
2233

2334
export default defineConfig({
2435
timeout: 480000,

run/test/specs/disappear_after_send_off_1o1.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ async function disappearAfterSendOff1o1(platform: SupportedPlatformsType, testIn
8383
await sleepFor(500);
8484
await bob1.checkModalStrings(
8585
englishStrippedStr('disappearingMessagesFollowSetting').toString(),
86-
englishStrippedStr('disappearingMessagesFollowSettingOff').toString(),
87-
false
86+
englishStrippedStr('disappearingMessagesFollowSettingOff').toString()
8887
);
8988
await bob1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Confirm' });
9089
// Check conversation subtitle?

run/test/specs/disappearing_link.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ async function disappearingLinkMessage1o1Android(
108108
await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => {
109109
await alice1.checkModalStrings(
110110
englishStrippedStr('linkPreviewsEnable').toString(),
111-
englishStrippedStr('linkPreviewsFirstDescription').toString(),
112-
false
111+
englishStrippedStr('linkPreviewsFirstDescription').toString()
113112
);
114113
});
115114
await alice1.clickOnByAccessibilityID('Enable');

run/test/specs/group_disappearing_messages_link.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ async function disappearingLinkMessageGroup(platform: SupportedPlatformsType, te
4848
await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => {
4949
await alice1.checkModalStrings(
5050
englishStrippedStr('linkPreviewsEnable').toString(),
51-
englishStrippedStr('linkPreviewsFirstDescription').toString(),
52-
false
51+
englishStrippedStr('linkPreviewsFirstDescription').toString()
5352
);
5453
});
5554
// Accept link preview modal

run/test/specs/group_message_link_preview.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ async function sendLinkGroupAndroid(platform: SupportedPlatformsType, testInfo:
9696
// Accept dialog for link preview
9797
await alice1.checkModalStrings(
9898
englishStrippedStr('linkPreviewsEnable').toString(),
99-
englishStrippedStr('linkPreviewsFirstDescription').toString(),
100-
true
99+
englishStrippedStr('linkPreviewsFirstDescription').toString()
101100
);
102101
await alice1.clickOnByAccessibilityID('Enable');
103102
//wait for preview to generate

run/test/specs/linked_device_hide_note_to_self.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ async function hideNoteToSelf(platform: SupportedPlatformsType, testInfo: TestIn
4646
await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => {
4747
await alice1.checkModalStrings(
4848
englishStrippedStr('noteToSelfHide').toString(),
49-
englishStrippedStr('hideNoteToSelfDescription').toString(), // This one fails on iOS, see SES-4144
50-
false
49+
englishStrippedStr('hideNoteToSelfDescription').toString() // This one fails on iOS, see SES-4144
5150
);
5251
});
5352
await alice1.clickOnByAccessibilityID('Hide');

run/test/specs/message_link_preview.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ async function sendLinkAndroid(platform: SupportedPlatformsType, testInfo: TestI
8282
// Accept dialog for link preview
8383
await alice1.checkModalStrings(
8484
englishStrippedStr('linkPreviewsEnable').toString(),
85-
englishStrippedStr('linkPreviewsFirstDescription').toString(),
86-
true
85+
englishStrippedStr('linkPreviewsFirstDescription').toString()
8786
);
8887
await alice1.clickOnElementAll({
8988
strategy: 'accessibility id',

run/test/specs/message_requests_block.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ async function blockedRequest(platform: SupportedPlatformsType, testInfo: TestIn
4141
await sleepFor(1000);
4242
await device2.checkModalStrings(
4343
englishStrippedStr('block').toString(),
44-
englishStrippedStr('blockDescription').withArgs({ name: alice.userName }).toString(),
45-
false
44+
englishStrippedStr('blockDescription').withArgs({ name: alice.userName }).toString()
4645
);
4746
await device2.clickOnByAccessibilityID('Block'); // This is an old Android modal so can't use the modern locator class
4847
// "messageRequestsNonePending": "No pending message requests",

run/test/specs/message_requests_clear_all.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ async function clearAllRequests(platform: SupportedPlatformsType, testInfo: Test
2929
await device2.clickOnByAccessibilityID('Clear all');
3030
await device2.checkModalStrings(
3131
englishStrippedStr('clearAll').toString(),
32-
englishStrippedStr('messageRequestsClearAllExplanation').toString(),
33-
true
32+
englishStrippedStr('messageRequestsClearAllExplanation').toString()
3433
);
3534
await device2.clickOnByAccessibilityID('Clear');
3635
// "messageRequestsNonePending": "No pending message requests",

0 commit comments

Comments
 (0)