Skip to content

Commit 5beee81

Browse files
authored
Merge pull request #48 from session-foundation/android-1240
Android 1.24.0 changes
2 parents cdbd869 + 44dc46c commit 5beee81

File tree

5 files changed

+38
-28
lines changed

5 files changed

+38
-28
lines changed

.env.sample

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
# this is a sample .env file. Copy it to .env, and edit the .env file to match your needs.
22

3-
export ANDROID_APK=/home/yougotthis/Downloads/session-android-universal.apk
4-
export IOS_APP_PATH_PREFIX=/home/yougotthis/Downloads/Session.app
5-
export SDK_MANAGER_FULL_PATH=/home/yougotthis/Android/Sdk/cmdline-tools/latest/bin/sdkmanager
6-
export AVD_MANAGER_FULL_PATH=/home/yougotthis/Android/Sdk/cmdline-tools/latest/bin/avdmanager
7-
export EMULATOR_FULL_PATH=/home/yougotthis/Android/Sdk/emulator/emulator
8-
export ANDROID_SYSTEM_IMAGE="system-images;android-35;google_atd;x86_64"
9-
export IOS_APP_PATH_PREFIX=just_not_empty
10-
export IOS_1_SIMULATOR=just_not_empty
11-
export IOS_2_SIMULATOR=just_not_empty
12-
export IOS_3_SIMULATOR=just_not_empty
13-
export IOS_4_SIMULATOR=just_not_empty
14-
export IOS_5_SIMULATOR=just_not_empty
15-
export IOS_6_SIMULATOR=just_not_empty
16-
export IOS_7_SIMULATOR=just_not_empty
17-
export IOS_8_SIMULATOR=just_not_empty
18-
export IOS_9_SIMULATOR=just_not_empty
19-
export IOS_10_SIMULATOR=just_not_empty
20-
export IOS_11_SIMULATOR=just_not_empty
21-
export IOS_12_SIMULATOR=just_not_empty
3+
ANDROID_APK=/home/yougotthis/Downloads/session-android-universal.apk
4+
IOS_APP_PATH_PREFIX=/home/yougotthis/Downloads/Session.app
5+
SDK_MANAGER_FULL_PATH=/home/yougotthis/Android/Sdk/cmdline-tools/latest/bin/sdkmanager
6+
AVD_MANAGER_FULL_PATH=/home/yougotthis/Android/Sdk/cmdline-tools/latest/bin/avdmanager
7+
EMULATOR_FULL_PATH=/home/yougotthis/Android/Sdk/emulator/emulator
8+
ANDROID_SYSTEM_IMAGE="system-images;android-35;google_atd;x86_64"
9+
APPIUM_ADB_FULL_PATH=/home/yougotthis/Android/sdk/platform-tools/adb
10+
IOS_1_SIMULATOR=just_not_empty
11+
IOS_2_SIMULATOR=just_not_empty
12+
IOS_3_SIMULATOR=just_not_empty
13+
IOS_4_SIMULATOR=just_not_empty
14+
IOS_5_SIMULATOR=just_not_empty
15+
IOS_6_SIMULATOR=just_not_empty
16+
IOS_7_SIMULATOR=just_not_empty
17+
IOS_8_SIMULATOR=just_not_empty
18+
IOS_9_SIMULATOR=just_not_empty
19+
IOS_10_SIMULATOR=just_not_empty
20+
IOS_11_SIMULATOR=just_not_empty
21+
IOS_12_SIMULATOR=just_not_empty
22+
PRINT_TEST_LOGS=true
23+
PRINT_ONGOING_TEST_LOGS = 1
24+
PRINT_FAILED_TEST_LOGS=1
25+
PLAYWRIGHT_RETRIES_COUNT=0
26+
PLAYWRIGHT_REPEAT_COUNT=0
27+
PLAYWRIGHT_WORKERS_COUNT=1

run/constants/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { XPath } from '../types/testing';
22

33
export const ANDROID_XPATHS: { [key: string]: XPath } = {
44
PRIVACY_TOGGLE: `/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[5]/android.widget.RelativeLayout/android.widget.TextView[2]`,
5-
FIRST_GIF: `/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.ScrollView/androidx.viewpager.widget.ViewPager/android.widget.FrameLayout/androidx.recyclerview.widget.RecyclerView/android.widget.FrameLayout[1]/android.widget.ImageView`,
5+
FIRST_GIF: `(//android.widget.ImageView[@resource-id="network.loki.messenger:id/thumbnail"])[1]`,
66
VOICE_TOGGLE: `/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.Button[1]`,
77
BROWSE_BUTTON: `/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ScrollView/android.widget.TabHost/android.widget.LinearLayout/android.widget.FrameLayout/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.widget.GridView/android.widget.LinearLayout/android.widget.LinearLayout[2]`,
88
MODAL_DESCRIPTIONS: `/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/androidx.appcompat.widget.LinearLayoutCompat/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.TextView[2]`,

run/test/specs/check_avatar_color.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { isSameColor } from './utils/check_colour';
44
import { UserSettings } from './locators/settings';
55
import { ConversationAvatar, ConversationSettings } from './locators/conversation';
66
import { open_Alice1_Bob1_friends } from './state_builder';
7+
import { ConversationItem } from './locators/home';
78

89
bothPlatformsIt({
910
title: 'Avatar color',
@@ -25,6 +26,8 @@ async function avatarColor(platform: SupportedPlatformsType) {
2526
const alice1PixelColor = await alice1.getElementPixelColor(new UserSettings(alice1));
2627
// Get Alice's avatar color on device 2 and turn it into a hex value
2728
let bob1PixelColor;
29+
// Open the conversation with Alice on Bob's device
30+
await bob1.clickOnElementAll(new ConversationItem(bob1, alice.userName));
2831
// The conversation screen looks slightly different per platform so we're grabbing the avatar from different locators
2932
// On iOS the avatar doubles as the Conversation Settings button on the right
3033
// On Android, the avatar is a separate, non-interactable element on the left (and the settings has the 3-dot icon)

run/test/specs/group_disappearing_messages_link.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ async function disappearingLinkMessageGroup(platform: SupportedPlatformsType) {
4444
await alice1.clickOnByAccessibilityID('Enable');
4545
}
4646

47-
await alice1.waitForTextElementToBePresent({
48-
...new OutgoingMessageStatusSent(alice1).build(),
49-
maxWait: 20000,
50-
});
5147
if (platform === 'ios') {
5248
await alice1.checkModalStrings(
5349
englishStrippedStr('linkPreviewsEnable').toString(),
@@ -56,8 +52,13 @@ async function disappearingLinkMessageGroup(platform: SupportedPlatformsType) {
5652
await alice1.clickOnByAccessibilityID('Enable');
5753
}
5854
// Accept dialog for link preview
59-
// No preview on first send
55+
// Let preview load
56+
await sleepFor(5000);
6057
await alice1.clickOnByAccessibilityID('Send message button');
58+
await alice1.waitForTextElementToBePresent({
59+
...new OutgoingMessageStatusSent(alice1).build(),
60+
maxWait: 20000,
61+
});
6162

6263
// Send again for image
6364
await alice1.inputText(testLink, {
@@ -67,7 +68,7 @@ async function disappearingLinkMessageGroup(platform: SupportedPlatformsType) {
6768
if (platform === 'ios') {
6869
await alice1.waitForTextElementToBePresent(new LinkPreview(alice1));
6970
} else {
70-
await sleepFor(1000);
71+
await sleepFor(5000);
7172
}
7273
await alice1.clickOnByAccessibilityID('Send message button');
7374
// Make sure image preview is available in device 2

run/types/testing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ export type XPath =
124124
| `/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ScrollView/android.widget.TabHost/android.widget.LinearLayout/android.widget.FrameLayout/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.widget.GridView/android.widget.LinearLayout/android.widget.LinearLayout[2]`
125125
| `//*[./*[@name='${DISAPPEARING_TIMES}']]/*[2]`
126126
| `/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[5]/android.widget.RelativeLayout/android.widget.TextView[2]`
127-
| `/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.ScrollView/androidx.viewpager.widget.ViewPager/android.widget.FrameLayout/androidx.recyclerview.widget.RecyclerView/android.widget.FrameLayout[1]/android.widget.ImageView`
128127
| `//XCUIElementTypeStaticText[@name="Videos"]`
129128
| `/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.Button[1]`
130129
| `//XCUIElementTypeSwitch[@name="Read Receipts, Send read receipts in one-to-one chats."]`
@@ -136,7 +135,8 @@ export type XPath =
136135
| `//XCUIElementTypeStaticText[@name="Paste"]`
137136
| `//XCUIElementTypeOther[contains(@name, "Hey,")][1]`
138137
| `//XCUIElementTypeCell[@name="Session"]`
139-
| `//*[starts-with(@content-desc, "Photo taken on")]`;
138+
| `//*[starts-with(@content-desc, "Photo taken on")]`
139+
| `(//android.widget.ImageView[@resource-id="network.loki.messenger:id/thumbnail"])[1]`;
140140

141141
export type AccessibilityId =
142142
| 'Create account button'

0 commit comments

Comments
 (0)