Skip to content

updating tests for UCS #50

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 65 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
e2fa12a
updating tests to match new android test tags
burtonemily May 29, 2025
55cc13b
Merge branch 'main' into updated-conversation-settings
burtonemily May 29, 2025
1ba6992
lint fix
burtonemily May 29, 2025
1155324
Merge branch 'updated-conversation-settings' of github.com:session-fo…
burtonemily May 29, 2025
1e6bb12
pull latest
burtonemily May 29, 2025
8d81aba
lint fix
burtonemily May 29, 2025
6b86d72
Merge branch 'main' into updated-conversation-settings
Miki-Session Jun 17, 2025
b6f0d72
Merge branch 'main' into updated-conversation-settings
Miki-Session Jun 18, 2025
b371efe
chore: update app disguise screenshot
Miki-Session Jun 18, 2025
d59ebc8
feat: add BlockedBanner locator and update related tests
Miki-Session Jun 18, 2025
ae19cab
feat: generalize handle_first_open
Miki-Session Jun 18, 2025
be45895
fix: scale match coordinates before tapping in matchAndTapImage
Miki-Session Jun 18, 2025
ad59ca2
chore: remove debug logging
Miki-Session Jun 18, 2025
3aeebab
fix: wait longer for media picker to show
Miki-Session Jun 18, 2025
eb4c2a1
fix: update modal strings for group name change confirmation
Miki-Session Jun 18, 2025
e5df364
fix: add maxWait to ErrorMessage locator
Miki-Session Jun 18, 2025
2f1a950
chore: yarn lint
Miki-Session Jun 18, 2025
64c1623
fix: extend DEVICE_PORT_RANGE for improved port allocation
Miki-Session Jun 19, 2025
342b91d
feat: implement fallback locator logic for new and old Android
Miki-Session Jun 19, 2025
83bd036
chore: bump port range again
Miki-Session Jun 19, 2025
fc49d13
chore: fetch strings
Miki-Session Jun 20, 2025
3b1ec51
WIP: Android 1.25.0 changes
Miki-Session Jun 20, 2025
bb7e685
More Android 1.25.0 changes
Miki-Session Jun 23, 2025
775ca45
Merge remote-tracking branch 'origin/main' into updated-conversation-…
Miki-Session Jun 23, 2025
a59121a
refactor: add test steps to create_account util
Miki-Session Jun 23, 2025
cbb637b
Even more Android 1.25.0 changes
Miki-Session Jun 23, 2025
8da4e10
revert test.step changes to create_account
Miki-Session Jun 23, 2025
e7f4460
fix: Appearance is now id-based
Miki-Session Jun 23, 2025
1bd6e99
fix: CI workflow starts emulators with no snapshot
Miki-Session Jun 24, 2025
b0a2a27
fix: Android 1.25.0 changes
Miki-Session Jun 24, 2025
e537081
fix: update app_disguise.png
Miki-Session Jun 24, 2025
4ca9ef9
fix: try to start emulators without snapshot, wait for them to boot
Miki-Session Jun 24, 2025
df68e14
fix: stop taking full page browser screenshots because they are unrel…
Miki-Session Jun 24, 2025
7b09e54
fix: wipe emulators on start
Miki-Session Jun 24, 2025
5e16fd4
chore: linting
Miki-Session Jun 24, 2025
1369188
fix: CI never finds test_video.mp4
Miki-Session Jun 24, 2025
8e5a67b
fix: CI never finds test_file.pdf
Miki-Session Jun 24, 2025
daf3ab2
tidy up some comments
Miki-Session Jun 24, 2025
6e69f9f
wip: try to add screenshot diffs to allure
Miki-Session Jun 24, 2025
406fefb
feat: allure report includes visual diffs
Miki-Session Jun 25, 2025
d2d00cc
chore: linting
Miki-Session Jun 25, 2025
8401d42
revert: discard temp change to landing page screenshot
Miki-Session Jun 25, 2025
2a34d93
linting again
Miki-Session Jun 25, 2025
4e0e4b4
feat: custom css injection for screenshot formatting
Miki-Session Jun 25, 2025
e9b2f7f
fix: comment
Miki-Session Jun 25, 2025
2866693
refactor: use allureHelpers for all custom logic
Miki-Session Jun 25, 2025
bb70a69
fix: message request tests on iOS
Miki-Session Jun 25, 2025
50b6b61
revert changes to Android CI scripting
Miki-Session Jun 25, 2025
db8885f
fix: include RISK input in report generation and clean up metadata ha…
Miki-Session Jun 25, 2025
cb9e1c4
fix: wait before matchAndTapImage
Miki-Session Jun 25, 2025
f22e995
fix: Android CI tweaks
Miki-Session Jun 25, 2025
c334c19
fix: wait for emulators to become responsive
Miki-Session Jun 25, 2025
030ed1b
fix: wait for simulators to appear in adb
Miki-Session Jun 25, 2025
b54ccc4
fix unexpected end of file
Miki-Session Jun 25, 2025
d5e0be7
wip: wait_for_emulators
Miki-Session Jun 25, 2025
e8f95ca
fix: update report context to remove repoSlug and hardcode GitHub URL
Miki-Session Jun 25, 2025
d6e07db
fix: ios change
Miki-Session Jun 25, 2025
baac0c4
fix: update ReportContext to derive runID and adjust GitHub run URL
Miki-Session Jun 26, 2025
deb1922
fix: start emulators with head & reduce ram to 4GB
Jun 27, 2025
966b5b6
fix: document sending only taps media file once
Miki-Session Jun 27, 2025
ce7d586
fix: remove unused code from closeRun
Miki-Session Jun 27, 2025
3b4e83d
fix: add missing env variables for closeRun composite action
Miki-Session Jun 27, 2025
d77cd35
chore: linting
Miki-Session Jun 27, 2025
4864beb
finishing touches
Miki-Session Jun 27, 2025
615630c
fix: address PR comments
Miki-Session Jun 30, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/android-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,12 @@ jobs:
adb kill-server;
adb start-server;

- name: Start emulators
- name: Start emulators from snapshot
shell: bash
run: |
source ./scripts/ci.sh
start_with_snapshots
wait_for_emulators

- name: List tests part of this run
uses: ./github/actions/list-tests
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ avd/*
.eslintcache
test-results.csv
*.csv
/allure
/allure*
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default tseslint.config(
'run/**/*.js',
'scripts/*.js',
'avd/',
'allure*/',
],
},
eslint.configs.recommended,
Expand Down
3 changes: 3 additions & 0 deletions github/actions/generate-publish-test-report/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ runs:
BUILD_NUMBER: ${{ inputs.BUILD_NUMBER }}
GH_TOKEN: ${{ inputs.GH_TOKEN }}
APK_URL: ${{inputs.APK_URL}}
RISK: ${{inputs.RISK}}
GITHUB_RUN_NUMBER: ${{ inputs.GITHUB_RUN_NUMBER}}
GITHUB_RUN_ATTEMPT: ${{ inputs.GITHUB_RUN_ATTEMPT}}

- name: Publish report to GitHub Pages
if: ${{ success() }}
Expand Down
4 changes: 2 additions & 2 deletions patches/appium-uiautomator2-driver-npm-3.8.2-1ce2a0f39e.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/build/lib/driver.js b/build/lib/driver.js
index 4287b4fc525093dee083bd37869947902bcc0398..3c8c6ab0b8c08ab6519268465e3c5bfd06068f86 100644
index 4287b4fc525093dee083bd37869947902bcc0398..8635fd3d871c55d7e54e22246f9b4b90fbd5686a 100644
--- a/build/lib/driver.js
+++ b/build/lib/driver.js
@@ -60,7 +60,7 @@ const screenshot_1 = require("./commands/screenshot");
const viewport_1 = require("./commands/viewport");
// The range of ports we can use on the system for communicating to the
// UiAutomator2 HTTP server on the device
-const DEVICE_PORT_RANGE = [8200, 8299];
+const DEVICE_PORT_RANGE = [8200, 8399];
+const DEVICE_PORT_RANGE = [8200, 8999];
// The guard is needed to avoid dynamic system port allocation conflicts for
// parallel driver sessions
const DEVICE_PORT_ALLOCATION_GUARD = support_1.util.getLockFileGuard(node_path_1.default.resolve(node_os_1.default.tmpdir(), 'uia2_device_port_guard'), { timeout: 25, tryRecovery: true });
1 change: 1 addition & 0 deletions run/constants/allure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ import path from 'path';
export const allureResultsDir = path.join('allure', 'allure-results');
export const allureCurrentReportDir = path.join('allure', 'allure-report');
export const allureReportsDir = path.join('allure', 'reports');
export const GH_PAGES_BASE_URL = 'https://session-foundation.github.io/session-appium/';
1 change: 0 additions & 1 deletion run/localizer/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export enum LOCALE_DEFAULTS {
staking_reward_pool = 'Staking Reward Pool',
token_name_short = 'SESH',
usd_name_short = 'USD',
session_network_data_price = 'Price data powered by CoinGecko<br/>Accurate at {date_time}',
app_pro = 'Session Pro',
}

Expand Down
49 changes: 40 additions & 9 deletions run/localizer/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@ export const simpleDictionary = {
args: undefined,
},
groupNameEnterShorter: {
en: 'Please enter a shorter group name.',
en: 'Please enter a shorter group name',
args: undefined,
},
groupNameNew: {
Expand Down Expand Up @@ -2222,6 +2222,10 @@ export const simpleDictionary = {
en: 'Message',
args: undefined,
},
messageBubbleReadMore: {
en: 'Read more',
args: undefined,
},
messageEmpty: {
en: 'This message is empty.',
args: undefined,
Expand Down Expand Up @@ -2386,12 +2390,24 @@ export const simpleDictionary = {
en: 'Minimize',
args: undefined,
},
modalMessageCharacterDisplayTitle: {
en: 'Message Length',
args: undefined,
},
modalMessageCharacterTooLongDescription: {
en: 'You have exceeded the character limit for this message. Please shorten your message to {limit} characters or less.',
args: { limit: 'string' },
},
modalMessageCharacterTooLongTitle: {
en: 'Message Too Long',
args: undefined,
},
modalMessageTooLongDescription: {
en: 'Please shorten your message to {count} characters or less.',
args: { count: 'number' },
en: 'Please shorten your message to {limit} characters or less.',
args: { limit: 'string' },
},
modalMessageTooLongTitle: {
en: 'Your message is too long',
en: 'Message Too Long',
args: undefined,
},
next: {
Expand Down Expand Up @@ -3115,11 +3131,7 @@ export const simpleDictionary = {
args: undefined,
},
remainingCharactersOverTooltip: {
en: 'Message is too long',
args: undefined,
},
remainingCharactersTooltip: {
en: '{count} characters remaining',
en: 'Reduce message length by {count}',
args: { count: 'number' },
},
remove: {
Expand Down Expand Up @@ -3570,6 +3582,10 @@ export const simpleDictionary = {
en: 'You',
args: undefined,
},
sessionNetworkDataPrice: {
en: 'Price data powered by CoinGecko<br/>Accurate at {date_time}',
args: { date_time: 'string' },
},
} as const;

export const pluralsDictionary = {
Expand Down Expand Up @@ -3720,6 +3736,14 @@ export const pluralsDictionary = {
},
args: { group_name: 'string', count: 'number' },
},
modalMessageCharacterDisplayDescription: {
en: {
one: 'Messages have a character limit of {limit} characters. You have {count} character remaining',
other:
'Messages have a character limit of {limit} characters. You have {count} characters remaining',
},
args: { limit: 'string', count: 'number' },
},
promotionFailed: {
en: {
one: 'Promotion Failed',
Expand All @@ -3734,6 +3758,13 @@ export const pluralsDictionary = {
},
args: { count: 'number' },
},
remainingCharactersTooltip: {
en: {
one: '{count} character remaining',
other: '{count} characters remaining',
},
args: { count: 'number' },
},
searchMatches: {
en: {
one: '{found_count} of {count} match',
Expand Down
4 changes: 2 additions & 2 deletions run/screenshots/android/app_disguise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions run/screenshots/android/browser_network_page.png

This file was deleted.

3 changes: 0 additions & 3 deletions run/screenshots/android/browser_staking_page.png

This file was deleted.

4 changes: 2 additions & 2 deletions run/screenshots/ios/app_disguise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions run/test/specs/app_disguise_icons.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { AppearanceMenuItem, SelectAppIcon, UserSettings } from './locators/sett
import { verifyElementScreenshot } from './utils/verify_screenshots';
import { AppDisguisePageScreenshot } from './utils/screenshot_paths';
import { sleepFor } from './utils';
import type { TestInfo } from '@playwright/test';

bothPlatformsIt({
title: 'App disguise icons',
Expand All @@ -14,7 +15,7 @@ bothPlatformsIt({
testCb: appDisguiseIcons,
});

async function appDisguiseIcons(platform: SupportedPlatformsType) {
async function appDisguiseIcons(platform: SupportedPlatformsType, testInfo: TestInfo) {
const { device } = await openAppOnPlatformSingleDevice(platform);
await newUser(device, USERNAME.ALICE);
await device.clickOnElementAll(new UserSettings(device));
Expand All @@ -25,6 +26,6 @@ async function appDisguiseIcons(platform: SupportedPlatformsType) {
// Must scroll down to reveal the app disguise option
await device.scrollDown();
await device.clickOnElementAll(new SelectAppIcon(device));
await verifyElementScreenshot(device, new AppDisguisePageScreenshot(device));
await verifyElementScreenshot(device, new AppDisguisePageScreenshot(device), testInfo);
await closeApp(device);
}
2 changes: 1 addition & 1 deletion run/test/specs/app_disguise_set.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function appDisguiseSetIcon(platform: SupportedPlatformsType) {
);
await device.clickOnElementAll(new CloseAppButton(device));
await sleepFor(2000);
// // Open app library and check for disguised app
// Open app library and check for disguised app
await device.swipeFromBottom();
await device.waitForTextElementToBePresent(new DisguisedApp(device));
} finally {
Expand Down
30 changes: 16 additions & 14 deletions run/test/specs/check_avatar_color.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import { bothPlatformsIt } from '../../types/sessionIt';
import { bothPlatformsItSeparate } from '../../types/sessionIt';
import { SupportedPlatformsType, closeApp } from './utils/open_app';
import { isSameColor } from './utils/check_colour';
import { UserSettings } from './locators/settings';
import { ConversationAvatar, ConversationSettings } from './locators/conversation';
import { ConversationSettings } from './locators/conversation';
import { open_Alice1_Bob1_friends } from './state_builder';
import { ConversationItem } from './locators/home';

bothPlatformsIt({
bothPlatformsItSeparate({
title: 'Avatar color',
risk: 'medium',
testCb: avatarColor,
countOfDevicesNeeded: 2,
ios: {
testCb: avatarColor,
shouldSkip: false,
},
android: {
testCb: avatarColor,
shouldSkip: true, // something is going on on Android, test is picking up wildly different pixel colors
},
});

async function avatarColor(platform: SupportedPlatformsType) {
Expand All @@ -22,20 +29,15 @@ async function avatarColor(platform: SupportedPlatformsType) {
focusFriendsConvo: false,
});

// Get Alice's avatar color on device 1 (Home Screen avatar) and turn it into a hex value
// Get Alice's avatar color on device 1 (Settings screen avatar) and turn it into a hex value
await alice1.clickOnElementAll(new UserSettings(alice1));
const alice1PixelColor = await alice1.getElementPixelColor(new UserSettings(alice1));
console.log(alice1PixelColor);
// Get Alice's avatar color on device 2 and turn it into a hex value
let bob1PixelColor;
// Open the conversation with Alice on Bob's device
await bob1.clickOnElementAll(new ConversationItem(bob1, alice.userName));
// The conversation screen looks slightly different per platform so we're grabbing the avatar from different locators
// On iOS the avatar doubles as the Conversation Settings button on the right
// On Android, the avatar is a separate, non-interactable element on the left (and the settings has the 3-dot icon)
if (platform === 'ios') {
bob1PixelColor = await bob1.getElementPixelColor(new ConversationSettings(bob1));
} else {
bob1PixelColor = await bob1.getElementPixelColor(new ConversationAvatar(bob1));
}
const bob1PixelColor = await bob1.getElementPixelColor(new ConversationSettings(bob1));
console.log(bob1PixelColor);
// Color matching devices 1 and 2
const colorMatch = isSameColor(alice1PixelColor, bob1PixelColor);
if (!colorMatch) {
Expand Down
11 changes: 5 additions & 6 deletions run/test/specs/community_tests_join.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { testCommunityLink, testCommunityName } from '../../constants/community';
import { bothPlatformsIt } from '../../types/sessionIt';
import { ConversationItem } from './locators/home';
import { open_Alice2 } from './state_builder';
import { sleepFor } from './utils';
import { joinCommunity } from './utils/join_community';
import { SupportedPlatformsType, closeApp } from './utils/open_app';

Expand All @@ -18,13 +20,10 @@ async function joinCommunityTest(platform: SupportedPlatformsType) {
const testMessage = `Test message + ${new Date().getTime()}`;

await joinCommunity(alice1, testCommunityLink, testCommunityName);
await alice1.onIOS().scrollToBottom();
await sleepFor(5000);
await alice1.scrollToBottom();
await alice1.sendMessage(testMessage);
// Has community synced to device 2?
await alice2.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Conversation list item',
text: testCommunityName,
});
await alice2.waitForTextElementToBePresent(new ConversationItem(alice2, testCommunityName));
await closeApp(alice1, alice2);
}
15 changes: 9 additions & 6 deletions run/test/specs/disappear_after_send_note_to_self.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { bothPlatformsIt } from '../../types/sessionIt';
import { DisappearActions, DISAPPEARING_TIMES, USERNAME } from '../../types/testing';
import { MessageInput } from './locators/conversation';
import { EnterAccountID } from './locators/start_conversation';
import { PlusButton } from './locators/home';
import { EnterAccountID, NewMessageOption, NextButton } from './locators/start_conversation';
import { sleepFor } from './utils';
import { newUser } from './utils/create_account';
import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app';
Expand All @@ -21,12 +21,15 @@ async function disappearAfterSendNoteToSelf(platform: SupportedPlatformsType) {
const controlMode: DisappearActions = 'sent';
const time = DISAPPEARING_TIMES.THIRTY_SECONDS;
// Send message to self to bring up Note to Self conversation
await device.clickOnByAccessibilityID('New conversation button');
await device.clickOnByAccessibilityID('New direct message');
await device.clickOnElementAll(new PlusButton(device));
await device.clickOnElementAll(new NewMessageOption(device));
await device.inputText(alice.accountID, new EnterAccountID(device));
await device.scrollDown();
await device.clickOnByAccessibilityID('Next');
await device.inputText('Creating note to self', new MessageInput(device));
await device.clickOnElementAll(new NextButton(device));
await device.inputText('Creating note to self', {
strategy: 'accessibility id',
selector: 'Message input box',
});
await device.clickOnByAccessibilityID('Send message button');
// Enable disappearing messages
await setDisappearingMessage(platform, device, [
Expand Down
4 changes: 2 additions & 2 deletions run/test/specs/disappear_after_send_off_1o1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function disappearAfterSendOff1o1(platform: SupportedPlatformsType) {
await alice1.clickOnElementAll(new DisappearingMessagesMenuOption(alice1));
await alice1.clickOnElementAll(new DisableDisappearingMessages(alice1));
await alice1.clickOnElementAll(new SetDisappearMessagesButton(alice1));
await alice1.onIOS().navigateBack();
await alice1.navigateBack();
// Check control message for turning off disappearing messages
// Check USER A'S CONTROL MESSAGE on device 1 and 3 (linked device)
const disappearingMessagesTurnedOffYou = englishStrippedStr(
Expand All @@ -76,7 +76,7 @@ async function disappearAfterSendOff1o1(platform: SupportedPlatformsType) {
await bob1.checkModalStrings(
englishStrippedStr('disappearingMessagesFollowSetting').toString(),
englishStrippedStr('disappearingMessagesFollowSettingOff').toString(),
true
false
);
await bob1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Confirm' });
// Check conversation subtitle?
Expand Down
Loading
Loading