Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions run/screenshots/android/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/android/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.
60 changes: 43 additions & 17 deletions run/test/specs/linked_device_change_username.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,53 @@ async function changeUsernameLinkedAndroid(platform: SupportedPlatformsType) {
const username = await device1.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Display name',
text: newUsername,
});
const changedUsername = await device1.getTextFromElement(username);
if (changedUsername === userA.userName) {
throw new Error('Username change unsuccessful');
}
await device1.closeScreen();
await device1.clickOnElementAll(new UserSettings(device1));
await device2.closeScreen();
await device2.clickOnElementAll(new UserSettings(device2));
await Promise.all([
device1.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Display name',
text: newUsername,
}),
device2.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Display name',
text: newUsername,
}),
]);
// Get the initial linked username from device2
const username2 = await device2.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Display name',
});
let currentLinkedUsername = await device2.getTextFromElement(username2);

// If the linked username still equals the original, then enter a loop to try again.
if (currentLinkedUsername === userA.userName) {
let currentWait = 0;
const waitPerLoop = 500;
const maxWait = 50000;

while (currentWait < maxWait) {
// Wait before trying again
await sleepFor(waitPerLoop);

// Close the screen and navigate back to the User Settings
await device2.closeScreen();
await device2.clickOnElementAll(new UserSettings(device2));

currentWait += waitPerLoop;

// Retrieve the updated username
const linkedUsernameEl = await device2.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Display name',
});
currentLinkedUsername = await device2.getTextFromElement(linkedUsernameEl);
// If the linked username now matches the changed username, break out.
if (currentLinkedUsername === changedUsername) {
console.log('Username change successful');
break;
}
}

// After looping, if the linked username still equals the original, then fail.
if (currentLinkedUsername === userA.userName) {
throw new Error('Username change unsuccessful');
}
} else {
console.log('Username change successful');
}
await closeApp(device1, device2);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ async function blockUserInConversationOptions(platform: SupportedPlatformsType)
// Check modal strings
await device1.checkModalStrings(
englishStripped('block').toString(),
englishStripped('blockDescription').withArgs({ name: userB.userName }).toString()
englishStripped('blockDescription').withArgs({ name: userB.userName }).toString(),
true
);
// Confirm block option
await device1.clickOnElementAll(new BlockUserConfirmationModal(device1));
Expand Down
5 changes: 4 additions & 1 deletion run/test/specs/user_actions_share_to_session.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ async function shareToSession(platform: SupportedPlatformsType) {
await device1.onIOS().swipeRightAny('Session');
await device1.clickOnElementAll(new PhotoLibrary(device1));
await sleepFor(2000);
const testImage = await device1.doesElementExist(new ImageName(device1));
const testImage = await device1.doesElementExist({
...new ImageName(device1).build(),
maxWait: 5000,
});
if (!testImage) {
await device1.pushMediaToDevice(platform, fileName);
}
Expand Down
13 changes: 7 additions & 6 deletions run/test/specs/user_actions_unblock_user.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ async function unblockUser(platform: SupportedPlatformsType) {
await device1.clickOnElementAll(new BlockUser(device1));
await device1.checkModalStrings(
englishStripped('block').toString(),
englishStripped('blockDescription').withArgs({ name: userB.userName }).toString()
englishStripped('blockDescription').withArgs({ name: userB.userName }).toString(),
true
);
await device1.clickOnElementAll(new BlockUserConfirmationModal(device1));
await device1.onIOS().navigateBack();
Expand All @@ -47,13 +48,13 @@ async function unblockUser(platform: SupportedPlatformsType) {
await device1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Blocked banner' });
await device1.checkModalStrings(
englishStripped('blockUnblock').toString(),
englishStripped('blockUnblockName').withArgs({ name: userB.userName }).toString()
englishStripped('blockUnblockName').withArgs({ name: userB.userName }).toString(),
true
);
await device1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Unblock' });
// Blocked message should now be visible
await device1.waitForTextElementToBePresent({
await device1.doesElementExist({
strategy: 'accessibility id',
selector: 'Message body',
text: blockedMessage,
selector: 'Blocked banner',
maxWait: 2000,
});
}
3 changes: 2 additions & 1 deletion run/types/DeviceWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ export class DeviceWrapper {
text: 'Allow',
});
await this.clickOnByAccessibilityID('Show roots');
await sleepFor(100);
await sleepFor(500);
await this.clickOnTextElementById(`android:id/title`, 'Downloads');
await sleepFor(100);
const testImage = await this.doesElementExist({
Expand Down Expand Up @@ -1254,6 +1254,7 @@ export class DeviceWrapper {
await sleepFor(200);
// Select video
const mediaButtons = await this.findElementsByClass('android.widget.Button');
await sleepFor(500);
const videosButton = await this.findMatchingTextInElementArray(mediaButtons, 'Videos');
if (!videosButton) {
throw new Error('videosButton was not found');
Expand Down