Skip to content

Commit 6380b5c

Browse files
authored
Merge pull request #31 from session-foundation/android-1220
Android point release 1.22.0
2 parents e533aa7 + 4b388a7 commit 6380b5c

8 files changed

+46
-38
lines changed
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

run/test/specs/linked_device_change_username.spec.ts

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,30 +72,32 @@ async function changeUsernameLinkedAndroid(platform: SupportedPlatformsType) {
7272
await device1.deleteText(new UsernameInput(device1));
7373
await device1.inputText(newUsername, new UsernameInput(device1));
7474
await device1.clickOnElementAll(new TickButton(device1));
75-
const username = await device1.waitForTextElementToBePresent({
76-
strategy: 'accessibility id',
77-
selector: 'Display name',
78-
text: newUsername,
79-
});
80-
const changedUsername = await device1.getTextFromElement(username);
75+
const usernameEl = await device1.waitForTextElementToBePresent(new UsernameSettings(device1));
76+
const changedUsername = await device1.getTextFromElement(usernameEl);
8177
if (changedUsername === userA.userName) {
8278
throw new Error('Username change unsuccessful');
8379
}
84-
await device1.closeScreen();
85-
await device1.clickOnElementAll(new UserSettings(device1));
86-
await device2.closeScreen();
87-
await device2.clickOnElementAll(new UserSettings(device2));
88-
await Promise.all([
89-
device1.waitForTextElementToBePresent({
90-
strategy: 'accessibility id',
91-
selector: 'Display name',
92-
text: newUsername,
93-
}),
94-
device2.waitForTextElementToBePresent({
95-
strategy: 'accessibility id',
96-
selector: 'Display name',
97-
text: newUsername,
98-
}),
99-
]);
80+
// Get the initial linked username from device2
81+
const username2 = await device2.waitForTextElementToBePresent(new UsernameSettings(device2));
82+
let currentLinkedUsername = await device2.getTextFromElement(username2);
83+
84+
let currentWait = 0;
85+
const waitPerLoop = 500;
86+
const maxWait = 50000;
87+
88+
do {
89+
await sleepFor(waitPerLoop);
90+
// Close the screen and navigate back to the User Settings
91+
await device2.closeScreen();
92+
await device2.clickOnElementAll(new UserSettings(device2));
93+
currentWait += waitPerLoop;
94+
const linkedUsernameEl = await device2.waitForTextElementToBePresent(
95+
new UsernameSettings(device2)
96+
);
97+
currentLinkedUsername = await device2.getTextFromElement(linkedUsernameEl);
98+
} while (currentLinkedUsername === userA.userName && currentWait < maxWait);
99+
{
100+
console.log('Username not changed yet');
101+
}
100102
await closeApp(device1, device2);
101103
}

run/test/specs/user_actions_block_conversation_options.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ async function blockUserInConversationOptions(platform: SupportedPlatformsType)
3131
// Check modal strings
3232
await device1.checkModalStrings(
3333
englishStripped('block').toString(),
34-
englishStripped('blockDescription').withArgs({ name: userB.userName }).toString()
34+
englishStripped('blockDescription').withArgs({ name: userB.userName }).toString(),
35+
true
3536
);
3637
// Confirm block option
3738
await device1.clickOnElementAll(new BlockUserConfirmationModal(device1));

run/test/specs/user_actions_delete_contact.spec.ts renamed to run/test/specs/user_actions_delete_conversation.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { newContact } from './utils/create_contact';
77
import { linkedDevice } from './utils/link_device';
88
import { openAppMultipleDevices, SupportedPlatformsType } from './utils/open_app';
99

10-
bothPlatformsIt('Delete contact', 'high', deleteContact);
10+
bothPlatformsIt('Delete conversation', 'high', deleteConversation);
1111

12-
async function deleteContact(platform: SupportedPlatformsType) {
12+
async function deleteConversation(platform: SupportedPlatformsType) {
1313
const [device1, device2, device3] = await openAppMultipleDevices(platform, 3);
1414
const [Alice, Bob] = await Promise.all([
1515
linkedDevice(device1, device3, USERNAME.ALICE),
@@ -33,7 +33,7 @@ async function deleteContact(platform: SupportedPlatformsType) {
3333
text: Bob.userName,
3434
}),
3535
]);
36-
// Delete contact
36+
// Delete conversation
3737
await device1.onIOS().swipeLeft('Conversation list item', Bob.userName);
3838
await device1.onAndroid().longPressConversation(Bob.userName);
3939
await device1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Delete' });

run/test/specs/user_actions_share_to_session.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ async function shareToSession(platform: SupportedPlatformsType) {
3030
await device1.onIOS().swipeRightAny('Session');
3131
await device1.clickOnElementAll(new PhotoLibrary(device1));
3232
await sleepFor(2000);
33-
const testImage = await device1.doesElementExist(new ImageName(device1));
33+
const testImage = await device1.doesElementExist({
34+
...new ImageName(device1).build(),
35+
maxWait: 5000,
36+
});
3437
if (!testImage) {
3538
await device1.pushMediaToDevice(platform, fileName);
3639
}

run/test/specs/user_actions_unblock_user.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ async function unblockUser(platform: SupportedPlatformsType) {
2121
await device1.clickOnElementAll(new BlockUser(device1));
2222
await device1.checkModalStrings(
2323
englishStripped('block').toString(),
24-
englishStripped('blockDescription').withArgs({ name: userB.userName }).toString()
24+
englishStripped('blockDescription').withArgs({ name: userB.userName }).toString(),
25+
true
2526
);
2627
await device1.clickOnElementAll(new BlockUserConfirmationModal(device1));
2728
await device1.onIOS().navigateBack();
@@ -47,13 +48,13 @@ async function unblockUser(platform: SupportedPlatformsType) {
4748
await device1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Blocked banner' });
4849
await device1.checkModalStrings(
4950
englishStripped('blockUnblock').toString(),
50-
englishStripped('blockUnblockName').withArgs({ name: userB.userName }).toString()
51+
englishStripped('blockUnblockName').withArgs({ name: userB.userName }).toString(),
52+
true
5153
);
5254
await device1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Unblock' });
53-
// Blocked message should now be visible
54-
await device1.waitForTextElementToBePresent({
55+
await device1.doesElementExist({
5556
strategy: 'accessibility id',
56-
selector: 'Message body',
57-
text: blockedMessage,
57+
selector: 'Blocked banner',
58+
maxWait: 2000,
5859
});
5960
}

run/types/DeviceWrapper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ export class DeviceWrapper {
11511151
text: 'Allow',
11521152
});
11531153
await this.clickOnByAccessibilityID('Show roots');
1154-
await sleepFor(100);
1154+
await sleepFor(500);
11551155
await this.clickOnTextElementById(`android:id/title`, 'Downloads');
11561156
await sleepFor(100);
11571157
const testImage = await this.doesElementExist({
@@ -1264,6 +1264,7 @@ export class DeviceWrapper {
12641264
await sleepFor(200);
12651265
// Select video
12661266
const mediaButtons = await this.findElementsByClass('android.widget.Button');
1267+
await sleepFor(500);
12671268
const videosButton = await this.findMatchingTextInElementArray(mediaButtons, 'Videos');
12681269
if (!videosButton) {
12691270
throw new Error('videosButton was not found');

0 commit comments

Comments
 (0)