Skip to content

iOS 2.11.0 changes #51

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

Merged
merged 9 commits into from
Jun 4, 2025
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"dependencies": {
"@playwright/test": "^1.45.1",
"@session-foundation/playwright-reporter": "^0.0.7",
"@session-foundation/qa-seeder": "^0.1.1",
"@session-foundation/qa-seeder": "^0.1.17",
"appium": "^2.4.1",
"appium-uiautomator2-driver": "patch:appium-uiautomator2-driver@npm%3A3.8.2#~/patches/appium-uiautomator2-driver-npm-3.8.2-1ce2a0f39e.patch",
"appium-xcuitest-driver": "^7.26.0",
Expand Down
4 changes: 2 additions & 2 deletions run/screenshots/ios/landingpage_new_account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions run/screenshots/ios/landingpage_restore_account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions run/test/specs/disappearing_link.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ async function disappearingLinkMessage1o1Ios(platform: SupportedPlatformsType) {
strategy: 'accessibility id',
selector: 'Message input box',
});
await alice1.waitForTextElementToBePresent({
...new OutgoingMessageStatusSent(alice1).build(),
maxWait: 20000,
});
// Accept dialog for link preview
await alice1.checkModalStrings(
englishStrippedStr('linkPreviewsEnable').toString(),
Expand All @@ -49,6 +45,10 @@ async function disappearingLinkMessage1o1Ios(platform: SupportedPlatformsType) {
await alice1.clickOnByAccessibilityID('Enable');
// No preview on first send
await alice1.clickOnByAccessibilityID('Send message button');
await alice1.waitForTextElementToBePresent({
...new OutgoingMessageStatusSent(alice1).build(),
maxWait: 20000,
});
// Send again for image
await alice1.inputText(testLink, {
strategy: 'accessibility id',
Expand Down
9 changes: 7 additions & 2 deletions run/test/specs/message_long_text.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { longText } from '../../constants';
import { bothPlatformsItSeparate } from '../../types/sessionIt';
import { open_Alice1_Bob1_friends } from './state_builder';
import { SupportedPlatformsType, closeApp } from './utils/open_app';
import { sleepFor } from './utils';
import { ConversationItem } from './locators/home';

bothPlatformsItSeparate({
title: 'Send long message 1:1',
Expand All @@ -20,7 +22,7 @@ async function sendLongMessageIos(platform: SupportedPlatformsType) {
// Open device and server
const {
devices: { alice1, bob1 },
prebuilt: { alice },
prebuilt: { alice, bob },
} = await open_Alice1_Bob1_friends({
platform,
focusFriendsConvo: true,
Expand All @@ -29,7 +31,10 @@ async function sendLongMessageIos(platform: SupportedPlatformsType) {
await alice1.sendMessage(longText);
// Reply to message (User B to User A)
const sentMessage = await bob1.replyToMessage(alice, longText);
// Check reply came through on alice1
// The CI kept throwing a stale element error here so we leave the convo and come back
await alice1.navigateBack();
await alice1.clickOnElementAll(new ConversationItem(alice1, bob.userName));
await sleepFor(1000);
await alice1.findMessageWithBody(sentMessage);
// Close app
await closeApp(alice1, bob1);
Expand Down
13 changes: 10 additions & 3 deletions run/test/specs/user_actions_share_to_session.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,21 @@ async function shareToSession(platform: SupportedPlatformsType) {
});
} else {
testImage = await alice1.doesElementExist({
strategy: 'accessibility id',
selector: 'Photo, 25 March, 11:09 am',
strategy: 'xpath',
selector:
'//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="Photo, 17 April, 9:56 am"]',
});
}
if (!testImage) {
await alice1.pushMediaToDevice(fileName, ronSwansonBirthday);
}
await alice1.onIOS().clickOnByAccessibilityID('Photo, 25 March, 11:09 am', 1000);
await alice1.onIOS().clickOnByAccessibilityID('Select');
await alice1
.onIOS()
.clickOnElementXPath(
'//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="Photo, 17 April, 9:56 am"]',
1000
);
await alice1.onAndroid().clickOnElementAll(new ImageName(alice1));
await alice1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Share' });
await alice1.clickOnElementAll(new ShareExtensionIcon(alice1));
Expand Down
2 changes: 1 addition & 1 deletion run/test/specs/utils/verify_screenshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { cropScreenshot, getDiffDirectory, saveImage } from './utilities';
// The function takes a screenshot of an element and verifies it against a baseline screenshot
// Supports locators with optional multiple states, enforcing correct state usage where applicable
// If no baseline is available, the element screenshot is retained for potential future use as a new baseline
// The baseline images were taken on a Pixel 6 (1080x2061) and an iPhone 15 Pro Max (1290x2462)
// The baseline images were taken on a Pixel 6 (1080x2061) and an iPhone 16 Pro Max (1320x2868)
//
// Example usage:
// Locator with multiple states;
Expand Down
28 changes: 7 additions & 21 deletions run/types/DeviceWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
ReadReceiptsButton,
SendMediaButton,
} from '../../run/test/specs/locators';
import { IOS_XPATHS } from '../constants';
import { ModalDescription, ModalHeading } from '../test/specs/locators/global';
import { SaveProfilePictureButton, UserSettings } from '../test/specs/locators/settings';
import { EnterAccountID } from '../test/specs/locators/start_conversation';
Expand Down Expand Up @@ -1242,22 +1241,9 @@ export class DeviceWrapper {
selector: 'Allow Full Access',
maxWait: 500,
});
await this.clickOnByAccessibilityID('Recents');
// Select video
const videoFolder = await this.doesElementExist({
strategy: 'xpath',
selector: IOS_XPATHS.VIDEO_TOGGLE,
maxWait: 5000,
});
if (videoFolder) {
console.log('Videos folder found');
await this.clickOnByAccessibilityID('Videos');
await this.clickOnByAccessibilityID(formattedDate);
} else {
console.log('Videos folder NOT found');
await this.pushMediaToDevice(fileName, bestDayOfYear);
await this.clickOnByAccessibilityID(formattedDate, 5000);
}
await this.pushMediaToDevice(fileName, bestDayOfYear);
await sleepFor(5000);
await this.clickOnByAccessibilityID(formattedDate, 5000);
// Send with message
await this.clickOnByAccessibilityID('Text input box');
await this.inputText(message, { strategy: 'accessibility id', selector: 'Text input box' });
Expand Down Expand Up @@ -1439,17 +1425,17 @@ export class DeviceWrapper {
if (this.isIOS()) {
await this.modalPopup({ strategy: 'accessibility id', selector: 'Allow Full Access' });
const profilePicture = await this.doesElementExist({
strategy: 'accessibility id',
selector: formattedDateiOS,
strategy: 'xpath',
selector: `//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="${formattedDateiOS}"]`,
maxWait: 2000,
});
if (!profilePicture) {
await this.pushMediaToDevice(fileName, spongeBobsBirthday);
}
await sleepFor(100);
await this.clickOnElementAll({
strategy: 'accessibility id',
selector: formattedDateiOS,
strategy: 'xpath',
selector: `//XCUIElementTypeImage[@name="PXGGridLayout-Info" and @label="${formattedDateiOS}"]`,
});
await this.clickOnByAccessibilityID('Done');
} else if (this.isAndroid()) {
Expand Down
19 changes: 11 additions & 8 deletions run/types/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ export type Coordinates = {
};

export const InteractionPoints: Record<string, Coordinates> = {
ImagesFolderKeyboardOpen: { x: 34, y: 498 },
ImagesFolderKeyboardClosed: { x: 34, y: 763 },
GifButtonKeyboardOpen: { x: 34, y: 394 },
GifButtonKeyboardClosed: { x: 34, y: 663 },
DocumentKeyboardOpen: { x: 34, y: 445 },
ImagesFolderKeyboardOpen: { x: 36, y: 527 },
ImagesFolderKeyboardClosed: { x: 36, y: 792 },
GifButtonKeyboardOpen: { x: 36, y: 420 },
GifButtonKeyboardClosed: { x: 36, y: 689 },
DocumentKeyboardOpen: { x: 36, y: 476 },
DocumentKeyboardClosed: { x: 36, y: 740 },
NetworkPageAndroid: { x: 880, y: 1150 },
NetworkPageIOS: { x: 308, y: 220 },
DocumentKeyboardClosed: { x: 34, y: 712 },
};

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

export type AccessibilityId =
| 'Create account button'
Expand Down Expand Up @@ -358,7 +360,8 @@ export type AccessibilityId =
| 'Open'
| 'Learn about staking link'
| 'Last updated timestamp'
| 'Albums';
| 'Albums'
| 'Select';

export type Id =
| 'Modal heading'
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1021,23 +1021,23 @@ __metadata:
languageName: node
linkType: hard

"@session-foundation/qa-seeder@npm:^0.1.1":
version: 0.1.1
resolution: "@session-foundation/qa-seeder@npm:0.1.1"
"@session-foundation/qa-seeder@npm:^0.1.17":
version: 0.1.17
resolution: "@session-foundation/qa-seeder@npm:0.1.17"
dependencies:
"@session-foundation/basic-types": "npm:^0.0.4"
"@session-foundation/mnemonic": "npm:^0.0.6"
"@session-foundation/session-tooling": "npm:^0.1.0"
"@session-foundation/session-tooling": "npm:^0.1.1"
"@session-foundation/sodium": "npm:^0.0.3"
lodash: "npm:^4.17.21"
checksum: 10c0/777cc3e1412d20212570e22d8d27edf06ae18a921ea66d1e1384c39e3fb66db2298ed472867fd541758de35fe6055571b5671cf3f84062b69e36061a301c603e
checksum: 10c0/dc5c6afcb73b8145bedfaf4a7b5d2375a84b43fc6bf3fe2410e40ee9a473f14815194d693123934b653cf26b6160d337dd5fa30004c280d44accd9e98584b72a
languageName: node
linkType: hard

"@session-foundation/session-tooling@npm:^0.1.0":
version: 0.1.0
resolution: "@session-foundation/session-tooling@npm:0.1.0"
checksum: 10c0/3bed91e02268b47b5fda1695c9ce8d4f9e74e9643eaffe7b6b099e460260da1f54c79c5459c23ef87fcaebe88046dfda027ef7fd16494d69ad96a98937c426ff
"@session-foundation/session-tooling@npm:^0.1.1":
version: 0.1.1
resolution: "@session-foundation/session-tooling@npm:0.1.1"
checksum: 10c0/125784ee220e748cf69b0d0b667e0f75dc137550f2e274d8331c1c23ededa2c7b2aab86aa2cdd470c8419dde98df0ac0a593d3ebf89f1537f62914e6a04d9347
languageName: node
linkType: hard

Expand Down Expand Up @@ -6987,7 +6987,7 @@ __metadata:
"@eslint/js": "npm:^9.14.0"
"@playwright/test": "npm:^1.45.1"
"@session-foundation/playwright-reporter": "npm:^0.0.7"
"@session-foundation/qa-seeder": "npm:^0.1.1"
"@session-foundation/qa-seeder": "npm:^0.1.17"
"@types/lodash": "npm:^4.14.191"
"@types/node": "npm:^20.14.10"
"@types/sinon": "npm:^17.0.3"
Expand Down
Loading