Skip to content

Commit 8e0b68e

Browse files
authored
Merge pull request #51 from session-foundation/ios-2110
iOS 2.11.0/iOS 18 changes
2 parents 0548776 + 21c635f commit 8e0b68e

10 files changed

+55
-54
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"dependencies": {
5151
"@playwright/test": "^1.45.1",
5252
"@session-foundation/playwright-reporter": "^0.0.7",
53-
"@session-foundation/qa-seeder": "^0.1.1",
53+
"@session-foundation/qa-seeder": "^0.1.17",
5454
"appium": "^2.4.1",
5555
"appium-uiautomator2-driver": "patch:appium-uiautomator2-driver@npm%3A3.8.2#~/patches/appium-uiautomator2-driver-npm-3.8.2-1ce2a0f39e.patch",
5656
"appium-xcuitest-driver": "^7.26.0",
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

run/test/specs/disappearing_link.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ async function disappearingLinkMessage1o1Ios(platform: SupportedPlatformsType) {
3737
strategy: 'accessibility id',
3838
selector: 'Message input box',
3939
});
40-
await alice1.waitForTextElementToBePresent({
41-
...new OutgoingMessageStatusSent(alice1).build(),
42-
maxWait: 20000,
43-
});
4440
// Accept dialog for link preview
4541
await alice1.checkModalStrings(
4642
englishStrippedStr('linkPreviewsEnable').toString(),
@@ -49,6 +45,10 @@ async function disappearingLinkMessage1o1Ios(platform: SupportedPlatformsType) {
4945
await alice1.clickOnByAccessibilityID('Enable');
5046
// No preview on first send
5147
await alice1.clickOnByAccessibilityID('Send message button');
48+
await alice1.waitForTextElementToBePresent({
49+
...new OutgoingMessageStatusSent(alice1).build(),
50+
maxWait: 20000,
51+
});
5252
// Send again for image
5353
await alice1.inputText(testLink, {
5454
strategy: 'accessibility id',

run/test/specs/message_long_text.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { longText } from '../../constants';
22
import { bothPlatformsItSeparate } from '../../types/sessionIt';
33
import { open_Alice1_Bob1_friends } from './state_builder';
44
import { SupportedPlatformsType, closeApp } from './utils/open_app';
5+
import { sleepFor } from './utils';
6+
import { ConversationItem } from './locators/home';
57

68
bothPlatformsItSeparate({
79
title: 'Send long message 1:1',
@@ -20,7 +22,7 @@ async function sendLongMessageIos(platform: SupportedPlatformsType) {
2022
// Open device and server
2123
const {
2224
devices: { alice1, bob1 },
23-
prebuilt: { alice },
25+
prebuilt: { alice, bob },
2426
} = await open_Alice1_Bob1_friends({
2527
platform,
2628
focusFriendsConvo: true,
@@ -29,7 +31,10 @@ async function sendLongMessageIos(platform: SupportedPlatformsType) {
2931
await alice1.sendMessage(longText);
3032
// Reply to message (User B to User A)
3133
const sentMessage = await bob1.replyToMessage(alice, longText);
32-
// Check reply came through on alice1
34+
// The CI kept throwing a stale element error here so we leave the convo and come back
35+
await alice1.navigateBack();
36+
await alice1.clickOnElementAll(new ConversationItem(alice1, bob.userName));
37+
await sleepFor(1000);
3338
await alice1.findMessageWithBody(sentMessage);
3439
// Close app
3540
await closeApp(alice1, bob1);

run/test/specs/user_actions_share_to_session.spec.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,21 @@ async function shareToSession(platform: SupportedPlatformsType) {
4646
});
4747
} else {
4848
testImage = await alice1.doesElementExist({
49-
strategy: 'accessibility id',
50-
selector: 'Photo, 25 March, 11:09 am',
49+
strategy: 'xpath',
50+
selector:
51+
'//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="Photo, 17 April, 9:56 am"]',
5152
});
5253
}
5354
if (!testImage) {
5455
await alice1.pushMediaToDevice(fileName, ronSwansonBirthday);
5556
}
56-
await alice1.onIOS().clickOnByAccessibilityID('Photo, 25 March, 11:09 am', 1000);
57+
await alice1.onIOS().clickOnByAccessibilityID('Select');
58+
await alice1
59+
.onIOS()
60+
.clickOnElementXPath(
61+
'//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="Photo, 17 April, 9:56 am"]',
62+
1000
63+
);
5764
await alice1.onAndroid().clickOnElementAll(new ImageName(alice1));
5865
await alice1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Share' });
5966
await alice1.clickOnElementAll(new ShareExtensionIcon(alice1));

run/test/specs/utils/verify_screenshots.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { cropScreenshot, getDiffDirectory, saveImage } from './utilities';
1212
// The function takes a screenshot of an element and verifies it against a baseline screenshot
1313
// Supports locators with optional multiple states, enforcing correct state usage where applicable
1414
// If no baseline is available, the element screenshot is retained for potential future use as a new baseline
15-
// The baseline images were taken on a Pixel 6 (1080x2061) and an iPhone 15 Pro Max (1290x2462)
15+
// The baseline images were taken on a Pixel 6 (1080x2061) and an iPhone 16 Pro Max (1320x2868)
1616
//
1717
// Example usage:
1818
// Locator with multiple states;

run/types/DeviceWrapper.ts

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
ReadReceiptsButton,
1515
SendMediaButton,
1616
} from '../../run/test/specs/locators';
17-
import { IOS_XPATHS } from '../constants';
1817
import { ModalDescription, ModalHeading } from '../test/specs/locators/global';
1918
import { SaveProfilePictureButton, UserSettings } from '../test/specs/locators/settings';
2019
import { EnterAccountID } from '../test/specs/locators/start_conversation';
@@ -1242,22 +1241,9 @@ export class DeviceWrapper {
12421241
selector: 'Allow Full Access',
12431242
maxWait: 500,
12441243
});
1245-
await this.clickOnByAccessibilityID('Recents');
1246-
// Select video
1247-
const videoFolder = await this.doesElementExist({
1248-
strategy: 'xpath',
1249-
selector: IOS_XPATHS.VIDEO_TOGGLE,
1250-
maxWait: 5000,
1251-
});
1252-
if (videoFolder) {
1253-
console.log('Videos folder found');
1254-
await this.clickOnByAccessibilityID('Videos');
1255-
await this.clickOnByAccessibilityID(formattedDate);
1256-
} else {
1257-
console.log('Videos folder NOT found');
1258-
await this.pushMediaToDevice(fileName, bestDayOfYear);
1259-
await this.clickOnByAccessibilityID(formattedDate, 5000);
1260-
}
1244+
await this.pushMediaToDevice(fileName, bestDayOfYear);
1245+
await sleepFor(5000);
1246+
await this.clickOnByAccessibilityID(formattedDate, 5000);
12611247
// Send with message
12621248
await this.clickOnByAccessibilityID('Text input box');
12631249
await this.inputText(message, { strategy: 'accessibility id', selector: 'Text input box' });
@@ -1439,17 +1425,17 @@ export class DeviceWrapper {
14391425
if (this.isIOS()) {
14401426
await this.modalPopup({ strategy: 'accessibility id', selector: 'Allow Full Access' });
14411427
const profilePicture = await this.doesElementExist({
1442-
strategy: 'accessibility id',
1443-
selector: formattedDateiOS,
1428+
strategy: 'xpath',
1429+
selector: `//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="${formattedDateiOS}"]`,
14441430
maxWait: 2000,
14451431
});
14461432
if (!profilePicture) {
14471433
await this.pushMediaToDevice(fileName, spongeBobsBirthday);
14481434
}
14491435
await sleepFor(100);
14501436
await this.clickOnElementAll({
1451-
strategy: 'accessibility id',
1452-
selector: formattedDateiOS,
1437+
strategy: 'xpath',
1438+
selector: `//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="${formattedDateiOS}"]`,
14531439
});
14541440
await this.clickOnByAccessibilityID('Done');
14551441
} else if (this.isAndroid()) {

run/types/testing.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ export type Coordinates = {
4646
};
4747

4848
export const InteractionPoints: Record<string, Coordinates> = {
49-
ImagesFolderKeyboardOpen: { x: 34, y: 498 },
50-
ImagesFolderKeyboardClosed: { x: 34, y: 763 },
51-
GifButtonKeyboardOpen: { x: 34, y: 394 },
52-
GifButtonKeyboardClosed: { x: 34, y: 663 },
53-
DocumentKeyboardOpen: { x: 34, y: 445 },
49+
ImagesFolderKeyboardOpen: { x: 36, y: 527 },
50+
ImagesFolderKeyboardClosed: { x: 36, y: 792 },
51+
GifButtonKeyboardOpen: { x: 36, y: 420 },
52+
GifButtonKeyboardClosed: { x: 36, y: 689 },
53+
DocumentKeyboardOpen: { x: 36, y: 476 },
54+
DocumentKeyboardClosed: { x: 36, y: 740 },
5455
NetworkPageAndroid: { x: 880, y: 1150 },
5556
NetworkPageIOS: { x: 308, y: 220 },
56-
DocumentKeyboardClosed: { x: 34, y: 712 },
5757
};
5858

5959
export type Strategy = 'accessibility id' | 'xpath' | 'id' | 'class name';
@@ -136,7 +136,9 @@ export type XPath =
136136
| `//XCUIElementTypeOther[contains(@name, "Hey,")][1]`
137137
| `//XCUIElementTypeCell[@name="Session"]`
138138
| `//*[starts-with(@content-desc, "Photo taken on")]`
139-
| `(//android.widget.ImageView[@resource-id="network.loki.messenger:id/thumbnail"])[1]`;
139+
| `(//android.widget.ImageView[@resource-id="network.loki.messenger:id/thumbnail"])[1]`
140+
| '//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="Photo, 01 May 1998, 7:00 am"]'
141+
| '//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="Photo, 17 April, 9:56 am"]';
140142

141143
export type AccessibilityId =
142144
| 'Create account button'
@@ -358,7 +360,8 @@ export type AccessibilityId =
358360
| 'Open'
359361
| 'Learn about staking link'
360362
| 'Last updated timestamp'
361-
| 'Albums';
363+
| 'Albums'
364+
| 'Select';
362365

363366
export type Id =
364367
| 'Modal heading'

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,23 +1021,23 @@ __metadata:
10211021
languageName: node
10221022
linkType: hard
10231023

1024-
"@session-foundation/qa-seeder@npm:^0.1.1":
1025-
version: 0.1.1
1026-
resolution: "@session-foundation/qa-seeder@npm:0.1.1"
1024+
"@session-foundation/qa-seeder@npm:^0.1.17":
1025+
version: 0.1.17
1026+
resolution: "@session-foundation/qa-seeder@npm:0.1.17"
10271027
dependencies:
10281028
"@session-foundation/basic-types": "npm:^0.0.4"
10291029
"@session-foundation/mnemonic": "npm:^0.0.6"
1030-
"@session-foundation/session-tooling": "npm:^0.1.0"
1030+
"@session-foundation/session-tooling": "npm:^0.1.1"
10311031
"@session-foundation/sodium": "npm:^0.0.3"
10321032
lodash: "npm:^4.17.21"
1033-
checksum: 10c0/777cc3e1412d20212570e22d8d27edf06ae18a921ea66d1e1384c39e3fb66db2298ed472867fd541758de35fe6055571b5671cf3f84062b69e36061a301c603e
1033+
checksum: 10c0/dc5c6afcb73b8145bedfaf4a7b5d2375a84b43fc6bf3fe2410e40ee9a473f14815194d693123934b653cf26b6160d337dd5fa30004c280d44accd9e98584b72a
10341034
languageName: node
10351035
linkType: hard
10361036

1037-
"@session-foundation/session-tooling@npm:^0.1.0":
1038-
version: 0.1.0
1039-
resolution: "@session-foundation/session-tooling@npm:0.1.0"
1040-
checksum: 10c0/3bed91e02268b47b5fda1695c9ce8d4f9e74e9643eaffe7b6b099e460260da1f54c79c5459c23ef87fcaebe88046dfda027ef7fd16494d69ad96a98937c426ff
1037+
"@session-foundation/session-tooling@npm:^0.1.1":
1038+
version: 0.1.1
1039+
resolution: "@session-foundation/session-tooling@npm:0.1.1"
1040+
checksum: 10c0/125784ee220e748cf69b0d0b667e0f75dc137550f2e274d8331c1c23ededa2c7b2aab86aa2cdd470c8419dde98df0ac0a593d3ebf89f1537f62914e6a04d9347
10411041
languageName: node
10421042
linkType: hard
10431043

@@ -6987,7 +6987,7 @@ __metadata:
69876987
"@eslint/js": "npm:^9.14.0"
69886988
"@playwright/test": "npm:^1.45.1"
69896989
"@session-foundation/playwright-reporter": "npm:^0.0.7"
6990-
"@session-foundation/qa-seeder": "npm:^0.1.1"
6990+
"@session-foundation/qa-seeder": "npm:^0.1.17"
69916991
"@types/lodash": "npm:^4.14.191"
69926992
"@types/node": "npm:^20.14.10"
69936993
"@types/sinon": "npm:^17.0.3"

0 commit comments

Comments
 (0)