Skip to content
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
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.
46 changes: 24 additions & 22 deletions run/test/specs/linked_device_change_username.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,30 +72,32 @@ async function changeUsernameLinkedAndroid(platform: SupportedPlatformsType) {
await device1.deleteText(new UsernameInput(device1));
await device1.inputText(newUsername, new UsernameInput(device1));
await device1.clickOnElementAll(new TickButton(device1));
const username = await device1.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Display name',
text: newUsername,
});
const changedUsername = await device1.getTextFromElement(username);
const usernameEl = await device1.waitForTextElementToBePresent(new UsernameSettings(device1));
const changedUsername = await device1.getTextFromElement(usernameEl);
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(new UsernameSettings(device2));
let currentLinkedUsername = await device2.getTextFromElement(username2);

let currentWait = 0;
const waitPerLoop = 500;
const maxWait = 50000;

do {
await sleepFor(waitPerLoop);
// Close the screen and navigate back to the User Settings
await device2.closeScreen();
await device2.clickOnElementAll(new UserSettings(device2));
currentWait += waitPerLoop;
const linkedUsernameEl = await device2.waitForTextElementToBePresent(
new UsernameSettings(device2)
);
currentLinkedUsername = await device2.getTextFromElement(linkedUsernameEl);
} while (currentLinkedUsername === userA.userName && currentWait < maxWait);
{
console.log('Username not changed yet');
}
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { newContact } from './utils/create_contact';
import { linkedDevice } from './utils/link_device';
import { openAppMultipleDevices, SupportedPlatformsType } from './utils/open_app';

bothPlatformsIt('Delete contact', 'high', deleteContact);
bothPlatformsIt('Delete conversation', 'high', deleteConversation);

async function deleteContact(platform: SupportedPlatformsType) {
async function deleteConversation(platform: SupportedPlatformsType) {
const [device1, device2, device3] = await openAppMultipleDevices(platform, 3);
const [Alice, Bob] = await Promise.all([
linkedDevice(device1, device3, USERNAME.ALICE),
Expand All @@ -33,7 +33,7 @@ async function deleteContact(platform: SupportedPlatformsType) {
text: Bob.userName,
}),
]);
// Delete contact
// Delete conversation
await device1.onIOS().swipeLeft('Conversation list item', Bob.userName);
await device1.onAndroid().longPressConversation(Bob.userName);
await device1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Delete' });
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
Loading