Skip to content

Commit 1983bbf

Browse files
committed
feat: add groups warning banner locator
1 parent 958ca3a commit 1983bbf

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

run/test/specs/locators/groups.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { LocatorsInterface } from '.';
22
import { StrategyExtractionObj } from '../../../types/testing';
3+
import { englishStripped } from '../../../localizer/i18n/localizedString';
34

45
export class GroupNameInput extends LocatorsInterface {
56
public build(): StrategyExtractionObj {
@@ -103,3 +104,23 @@ export class LeaveGroupButton extends LocatorsInterface {
103104
}
104105
}
105106
}
107+
export class LatestReleaseBanner extends LocatorsInterface {
108+
public build() {
109+
switch (this.platform) {
110+
// On Android, the text of the banner is exposed to Appium
111+
// so it's possible to verify that the banner is visible and it has the correct text
112+
case 'android':
113+
return {
114+
strategy: 'id',
115+
selector: 'Version warning banner',
116+
text: englishStripped('groupInviteVersion').toString(),
117+
} as const;
118+
case 'ios':
119+
// On iOS, the text is currently not exposed to Appium
120+
return {
121+
strategy: 'accessibility id',
122+
selector: 'Version warning banner',
123+
} as const;
124+
}
125+
}
126+
}

run/types/testing.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ export type AccessibilityId =
344344
| '1967-05-06 07:00:00 +0000'
345345
| '1967-05-05 20:00:00 +0000'
346346
| '1967-05-05 21:00:00 +0000'
347-
| 'Pin';
347+
| 'Pin'
348+
| 'Version warning banner';
348349

349350
export type Id =
350351
| 'Modal heading'
@@ -405,7 +406,8 @@ export type Id =
405406
| 'Hide'
406407
| 'com.google.android.apps.photos:id/text'
407408
| 'network.loki.messenger:id/search_cancel'
408-
| 'Download media';
409+
| 'Download media'
410+
| 'Version warning banner';
409411

410412
export type TestRisk = 'high' | 'medium' | 'low' | undefined;
411413

0 commit comments

Comments
 (0)