Skip to content

updating tests to match new android test tags #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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 2 additions & 5 deletions run/test/specs/community_tests_join.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { testCommunityLink, testCommunityName } from '../../constants/community';
import { bothPlatformsIt } from '../../types/sessionIt';
import { ConversationItem } from './locators/home';
import { open_Alice2 } from './state_builder';
import { joinCommunity } from './utils/join_community';
import { SupportedPlatformsType, closeApp } from './utils/open_app';
Expand All @@ -21,10 +22,6 @@ async function joinCommunityTest(platform: SupportedPlatformsType) {
await alice1.onIOS().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
20 changes: 7 additions & 13 deletions run/test/specs/disappearing_call.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { bothPlatformsItSeparate } from '../../types/sessionIt';
import { DISAPPEARING_TIMES } from '../../types/testing';
import { CallButton } from './locators/conversation';
import { ContinueButton } from './locators/global';
import { open_Alice1_Bob1_friends } from './state_builder';
import { sleepFor } from './utils';
import { SupportedPlatformsType, closeApp } from './utils/open_app';
Expand Down Expand Up @@ -31,8 +33,7 @@ async function disappearingCallMessage1o1Ios(platform: SupportedPlatformsType) {
focusFriendsConvo: true,
});
await setDisappearingMessage(platform, alice1, ['1:1', timerType, time], bob1);
// await alice1.navigateBack();
await alice1.clickOnByAccessibilityID('Call');
await alice1.clickOnElementAll(new CallButton(alice1));
// Enabled voice calls in privacy settings
await alice1.waitForTextElementToBePresent({
strategy: 'accessibility id',
Expand All @@ -46,7 +47,7 @@ async function disappearingCallMessage1o1Ios(platform: SupportedPlatformsType) {
strategy: 'accessibility id',
selector: 'Allow voice and video calls',
});
await alice1.clickOnByAccessibilityID('Continue');
await alice1.clickOnElementAll(new ContinueButton(alice1));
// Navigate back to conversation
await sleepFor(500);
await alice1.clickOnByAccessibilityID('Close button');
Expand All @@ -62,7 +63,7 @@ async function disappearingCallMessage1o1Ios(platform: SupportedPlatformsType) {
await sleepFor(500, true);
await bob1.clickOnByAccessibilityID('Close button');
// Make call on device 1 (alice)
await alice1.clickOnByAccessibilityID('Call');
await alice1.clickOnElementAll(new CallButton(alice1));
// Answer call on device 2
await bob1.clickOnByAccessibilityID('Answer call');
// Wait 30 seconds
Expand Down Expand Up @@ -98,15 +99,12 @@ async function disappearingCallMessage1o1Android(platform: SupportedPlatformsTyp
focusFriendsConvo: true,
});
await setDisappearingMessage(platform, alice1, ['1:1', timerType, time], bob1);

// await alice1.navigateBack();
await alice1.clickOnByAccessibilityID('Call');
await alice1.clickOnElementAll(new CallButton(alice1));
// Enabled voice calls in privacy settings
await alice1.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Settings',
});

// Scroll to bottom of page to voice and video calls
await sleepFor(1000);
await alice1.scrollDown();
Expand All @@ -115,7 +113,6 @@ async function disappearingCallMessage1o1Android(platform: SupportedPlatformsTyp
selector: 'android:id/summary',
text: 'Enables voice and video calls to and from other users.',
});

await alice1.click(voicePermissions.ELEMENT);
// Toggle voice settings on
// Click enable on exposure IP address warning
Expand All @@ -128,7 +125,6 @@ async function disappearingCallMessage1o1Android(platform: SupportedPlatformsTyp
await alice1.clickOnElementById(
'com.android.permissioncontroller:id/permission_allow_foreground_only_button'
);

await alice1.navigateBack();
// Enable voice calls on device 2 for User B
await bob1.clickOnByAccessibilityID('Call');
Expand All @@ -138,7 +134,6 @@ async function disappearingCallMessage1o1Android(platform: SupportedPlatformsTyp
selector: 'Settings',
text: 'Settings',
});

await bob1.clickOnElementAll({
strategy: 'accessibility id',
selector: 'Settings',
Expand All @@ -151,7 +146,6 @@ async function disappearingCallMessage1o1Android(platform: SupportedPlatformsTyp
selector: 'android:id/summary',
text: 'Enables voice and video calls to and from other users.',
});

await bob1.click(voicePermissions2.ELEMENT);
// Toggle voice settings on
// Click enable on exposure IP address warning
Expand All @@ -166,7 +160,7 @@ async function disappearingCallMessage1o1Android(platform: SupportedPlatformsTyp
);
await bob1.navigateBack();
// Make call on device 1 (alice)
await alice1.clickOnByAccessibilityID('Call');
await alice1.clickOnElementAll(new CallButton(alice1));
// Answer call on device 2
await bob1.clickOnByAccessibilityID('Answer call');
// Wait 5 seconds
Expand Down
13 changes: 3 additions & 10 deletions run/test/specs/group_message_long_text.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { bothPlatformsItSeparate } from '../../types/sessionIt';
import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder';
import { SupportedPlatformsType, closeApp } from './utils/open_app';
import { OutgoingMessageStatusSent } from './locators/conversation';
import { ConversationItem } from './locators/home';

bothPlatformsItSeparate({
title: 'Send long message to group',
Expand Down Expand Up @@ -95,23 +96,15 @@ async function sendLongMessageGroupAndroid(platform: SupportedPlatformsType) {
const replyMessage = await bob1.sendMessage(`${alice.userName} message reply`);
// Go out and back into the group to see the last message
await alice1.navigateBack();
await alice1.clickOnElementAll({
strategy: 'accessibility id',
selector: 'Conversation list item',
text: testGroupName,
});
await alice1.clickOnElementAll(new ConversationItem(alice1, testGroupName));
await alice1.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Message body',
text: replyMessage,
});
// Go out and back into the group to see the last message
await charlie1.navigateBack();
await charlie1.clickOnElementAll({
strategy: 'accessibility id',
selector: 'Conversation list item',
text: testGroupName,
});
await charlie1.clickOnElementAll(new ConversationItem(charlie1, testGroupName));
await charlie1.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Message body',
Expand Down
7 changes: 2 additions & 5 deletions run/test/specs/group_tests_add_contact.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { EditGroup, InviteContactsButton, InviteContactsMenuItem } from './locat
import { ConversationSettings } from './locators/conversation';
import { Contact } from './locators/global';
import { InviteContactConfirm } from './locators/groups';
import { ConversationItem } from './locators/home';
import { open_Alice1_Bob1_Charlie1_Unknown1 } from './state_builder';
import { sleepFor } from './utils';
import { newUser } from './utils/create_account';
Expand Down Expand Up @@ -33,11 +34,7 @@ async function addContactToGroup(platform: SupportedPlatformsType) {
// Exit to conversation list
await alice1.navigateBack();
// Select group conversation in list
await alice1.clickOnElementAll({
strategy: 'accessibility id',
selector: 'Conversation list item',
text: group.groupName,
});
await alice1.clickOnElementAll(new ConversationItem(alice1, testGroupName));
// Click more options
await alice1.clickOnElementAll(new ConversationSettings(alice1));
// Select edit group
Expand Down
9 changes: 4 additions & 5 deletions run/test/specs/group_tests_leave_group.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { englishStrippedStr } from '../../localizer/englishStrippedStr';
import { bothPlatformsIt } from '../../types/sessionIt';
import { ConversationSettings } from './locators/conversation';
import { LeaveGroupButton } from './locators/groups';
import { LeaveGroupButton, LeaveGroupConfirm } from './locators/groups';
import { ConversationItem } from './locators/home';
import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder';
import { sleepFor } from './utils/index';
import { SupportedPlatformsType, closeApp } from './utils/open_app';
Expand All @@ -28,7 +29,7 @@ async function leaveGroup(platform: SupportedPlatformsType) {
await sleepFor(1000);
await charlie1.clickOnElementAll(new LeaveGroupButton(charlie1));
// Modal with Leave/Cancel
await charlie1.clickOnByAccessibilityID('Leave');
await charlie1.clickOnElementAll(new LeaveGroupConfirm(charlie1));
// Check for control message
const groupMemberLeft = englishStrippedStr('groupMemberLeft')
.withArgs({ name: charlie.userName })
Expand All @@ -37,9 +38,7 @@ async function leaveGroup(platform: SupportedPlatformsType) {
await bob1.waitForControlMessageToBePresent(groupMemberLeft);
// Check device 3 that group has disappeared
await charlie1.hasElementBeenDeleted({
strategy: 'accessibility id',
selector: 'Conversation list item',
text: testGroupName,
...new ConversationItem(charlie1, testGroupName).build(),
maxWait: 5000,
});
await closeApp(alice1, bob1, charlie1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { englishStrippedStr } from '../../../localizer/englishStrippedStr';
import { bothPlatformsIt } from '../../../types/sessionIt';
import {
AccountRestoreButton,
ContinueButton,
ErrorMessage,
SeedPhraseInput,
} from '../locators/onboarding';
import { AccountRestoreButton, ErrorMessage, SeedPhraseInput } from '../locators/onboarding';
import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app';
import { ContinueButton } from '../locators/global';

bothPlatformsIt({
title: 'Onboarding incorrect seed',
Expand Down
8 changes: 2 additions & 6 deletions run/test/specs/input_validations/onboarding_long_name.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { englishStrippedStr } from '../../../localizer/englishStrippedStr';
import { bothPlatformsIt } from '../../../types/sessionIt';
import {
ContinueButton,
CreateAccountButton,
DisplayNameInput,
ErrorMessage,
} from '../locators/onboarding';
import { CreateAccountButton, DisplayNameInput, ErrorMessage } from '../locators/onboarding';
import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app';
import { ContinueButton } from '../locators/global';

bothPlatformsIt({
title: 'Onboarding long name',
Expand Down
8 changes: 2 additions & 6 deletions run/test/specs/input_validations/onboarding_no_name.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { englishStrippedStr } from '../../../localizer/englishStrippedStr';
import { bothPlatformsIt } from '../../../types/sessionIt';
import {
ContinueButton,
CreateAccountButton,
DisplayNameInput,
ErrorMessage,
} from '../locators/onboarding';
import { CreateAccountButton, DisplayNameInput, ErrorMessage } from '../locators/onboarding';
import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app';
import { ContinueButton } from '../locators/global';

bothPlatformsIt({
title: 'Onboarding no name',
Expand Down
8 changes: 2 additions & 6 deletions run/test/specs/input_validations/onboarding_no_seed.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { englishStrippedStr } from '../../../localizer/englishStrippedStr';
import { bothPlatformsIt } from '../../../types/sessionIt';
import {
AccountRestoreButton,
ContinueButton,
ErrorMessage,
SeedPhraseInput,
} from '../locators/onboarding';
import { AccountRestoreButton, ErrorMessage, SeedPhraseInput } from '../locators/onboarding';
import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app';
import { ContinueButton } from '../locators/global';

bothPlatformsIt({
title: 'Onboarding no seed',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { englishStrippedStr } from '../../../localizer/englishStrippedStr';
import { bothPlatformsIt } from '../../../types/sessionIt';
import {
AccountRestoreButton,
ContinueButton,
ErrorMessage,
SeedPhraseInput,
} from '../locators/onboarding';
import { AccountRestoreButton, ErrorMessage, SeedPhraseInput } from '../locators/onboarding';
import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app';
import { ContinueButton } from '../locators/global';

bothPlatformsIt({
title: 'Onboarding wrong seed',
Expand Down
13 changes: 5 additions & 8 deletions run/test/specs/linked_device_block_user.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { englishStrippedStr } from '../../localizer/englishStrippedStr';
import { bothPlatformsIt } from '../../types/sessionIt';
import { BlockedContactsSettings, BlockUser, BlockUserConfirmationModal } from './locators';
import { ConversationSettings } from './locators/conversation';
import { UserSettings } from './locators/settings';
import { ConversationItem } from './locators/home';
import { ConversationsMenuItem, UserSettings } from './locators/settings';
import { open_Alice2_Bob1_friends } from './state_builder';
import { sleepFor } from './utils';
import { closeApp, SupportedPlatformsType } from './utils/open_app';
Expand Down Expand Up @@ -44,11 +45,7 @@ async function blockUserInConversationOptions(platform: SupportedPlatformsType)
});
if (blockedStatus) {
// Check linked device for blocked status (if shown on alice1)
await alice2.onAndroid().clickOnElementAll({
strategy: 'accessibility id',
selector: 'Conversation list item',
text: `${bob.userName}`,
});
await alice2.onAndroid().clickOnElementAll(new ConversationItem(alice2, bob.userName));
await alice2.onAndroid().waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Blocked banner',
Expand All @@ -64,8 +61,8 @@ async function blockUserInConversationOptions(platform: SupportedPlatformsType)
alice2.clickOnElementAll(new UserSettings(alice2)),
]);
await Promise.all([
alice1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Conversations' }),
alice2.clickOnElementAll({ strategy: 'accessibility id', selector: 'Conversations' }),
alice1.clickOnElementAll(new ConversationsMenuItem(alice1)),
alice2.clickOnElementAll(new ConversationsMenuItem(alice2)),
]);
await Promise.all([
alice1.clickOnElementAll(new BlockedContactsSettings(alice1)),
Expand Down
23 changes: 7 additions & 16 deletions run/test/specs/linked_device_create_group.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { englishStrippedStr } from '../../localizer/englishStrippedStr';
import { bothPlatformsItSeparate } from '../../types/sessionIt';
import { USERNAME } from '../../types/testing';
import { EditGroup, EditGroupName } from './locators';
import { ConversationSettings } from './locators/conversation';
import { ConversationHeaderName, ConversationSettings } from './locators/conversation';
import { EditGroupNameInput } from './locators/groups';
import { ConversationItem } from './locators/home';
import { SaveNameChangeButton } from './locators/settings';
import { sleepFor } from './utils';
import { newUser } from './utils/create_account';
Expand Down Expand Up @@ -35,11 +36,7 @@ async function linkedGroupiOS(platform: SupportedPlatformsType) {
// Note we keep this createGroup here as we want it to **indeed** use the UI to create the group
await createGroup(platform, device1, alice, device3, bob, device4, charlie, testGroupName);
// Test that group has loaded on linked device
await device2.clickOnElementAll({
strategy: 'accessibility id',
selector: 'Conversation list item',
text: testGroupName,
});
await device2.clickOnElementAll(new ConversationItem(device2, testGroupName));
// Change group name in device 1
// Click on settings/more info
await device1.clickOnElementAll(new ConversationSettings(device1));
Expand Down Expand Up @@ -69,11 +66,9 @@ async function linkedGroupiOS(platform: SupportedPlatformsType) {
// Wait 5 seconds for name to update
await sleepFor(5000);
// Check linked device for name change (conversation header name)
await device2.waitForTextElementToBePresent({
strategy: 'accessibility id',
selector: 'Conversation header name',
text: newGroupName,
});
await device2.waitForTextElementToBePresent(
new ConversationHeaderName(device2).build(newGroupName)
);
await Promise.all([
device2.waitForControlMessageToBePresent(groupNameNew),
device3.waitForControlMessageToBePresent(groupNameNew),
Expand All @@ -96,11 +91,7 @@ async function linkedGroupAndroid(platform: SupportedPlatformsType) {
// Note we keep this createGroup here as we want it to **indeed** use the UI to create the group
await createGroup(platform, device1, alice, device3, bob, device4, charlie, testGroupName);
// Test that group has loaded on linked device
await device2.clickOnElementAll({
strategy: 'accessibility id',
selector: 'Conversation list item',
text: testGroupName,
});
await device2.clickOnElementAll(new ConversationItem(device2, testGroupName));
// Click on settings or three dots
await device1.clickOnElementAll(new ConversationSettings(device1));
// Click on Edit group option
Expand Down
Loading
Loading