Fix smoke test e2e for android

This commit is contained in:
Joseph Baylon
2023-02-06 13:32:15 -08:00
committed by Elisabeth Kulzer
parent f3c578c7ae
commit 3566a4e8ce
6 changed files with 24 additions and 11 deletions

View File

@@ -3,7 +3,7 @@
import {ProfilePicture} from '@support/ui/component';
import {ChannelListScreen} from '@support/ui/screen';
import {timeouts, wait} from '@support/utils';
import {isIos, timeouts, wait} from '@support/utils';
import {expect} from 'detox';
class CreateDirectMessageScreen {
@@ -69,7 +69,10 @@ class CreateDirectMessageScreen {
await wait(timeouts.ONE_SEC);
await ChannelListScreen.openDirectMessageItem.tap();
return this.toBeVisible();
if (isIos()) {
return this.toBeVisible();
}
return null;
};
close = async () => {
@@ -78,9 +81,15 @@ class CreateDirectMessageScreen {
};
closeTutorial = async () => {
await waitFor(this.tutorialHighlight).toExist().withTimeout(timeouts.TEN_SEC);
await this.tutorialSwipeLeft.tap();
await expect(this.tutorialHighlight).not.toExist();
if (isIos()) {
await waitFor(this.tutorialHighlight).toExist().withTimeout(timeouts.TEN_SEC);
await this.tutorialSwipeLeft.tap();
await expect(this.tutorialHighlight).not.toExist();
} else {
await wait(timeouts.ONE_SEC);
await device.pressBack();
await wait(timeouts.ONE_SEC);
}
};
}

View File

@@ -39,6 +39,7 @@ class LoginScreen {
signinButtonDisabled = element(by.id(this.testID.signinButtonDisabled));
toBeVisible = async () => {
await wait(timeouts.ONE_SEC);
await waitFor(this.loginScreen).toExist().withTimeout(timeouts.TEN_SEC);
await waitFor(this.usernameInput).toBeVisible().withTimeout(timeouts.TEN_SEC);

View File

@@ -58,6 +58,7 @@ class ServerScreen {
tapConnectButton = async () => {
if (isAndroid()) {
await device.pressBack();
await wait(timeouts.ONE_SEC);
}
await this.connectButton.tap();
await wait(timeouts.ONE_SEC);

View File

@@ -87,6 +87,7 @@ class ServerListScreen {
} else {
await wait(timeouts.ONE_SEC);
await device.pressBack();
await wait(timeouts.ONE_SEC);
}
};
}

View File

@@ -22,7 +22,7 @@ import {
LoginScreen,
ServerScreen,
} from '@support/ui/screen';
import {getRandomId, isAndroid} from '@support/utils';
import {getRandomId, isAndroid, timeouts, wait} from '@support/utils';
import {expect} from 'detox';
describe('Messaging - Message Post', () => {
@@ -89,6 +89,7 @@ describe('Messaging - Message Post', () => {
// * Verify long message is posted and displays show more button (chevron down button)
if (isAndroid()) {
await device.pressBack();
await wait(timeouts.ONE_SEC);
}
const {postListPostItem, postListPostItemShowLessButton, postListPostItemShowMoreButton} = ChannelScreen.getPostListPostItem(post.id, longMessage);
await expect(postListPostItem).toBeVisible();

View File

@@ -30,7 +30,7 @@ import {
LoginScreen,
ServerScreen,
} from '@support/ui/screen';
import {getRandomId} from '@support/utils';
import {getRandomId, timeouts, wait} from '@support/utils';
import {expect} from 'detox';
describe('Smoke Test - Channels', () => {
@@ -66,6 +66,7 @@ describe('Smoke Test - Channels', () => {
const {channel} = await Channel.apiCreateChannel(siteOneUrl, {teamId: testTeam.id});
await BrowseChannelsScreen.open();
await BrowseChannelsScreen.searchInput.replaceText(channel.name);
await wait(timeouts.ONE_SEC);
await BrowseChannelsScreen.getChannelItem(channel.name).multiTap(2);
// * Verify on newly joined channel screen
@@ -106,6 +107,7 @@ describe('Smoke Test - Channels', () => {
await CreateDirectMessageScreen.open();
await CreateDirectMessageScreen.closeTutorial();
await CreateDirectMessageScreen.searchInput.replaceText(newUserDisplayName);
await wait(timeouts.ONE_SEC);
await CreateDirectMessageScreen.getUserItem(newUser.id).tap();
await CreateDirectMessageScreen.startButton.tap();
@@ -137,6 +139,7 @@ describe('Smoke Test - Channels', () => {
// # Open find channels screen, search for the channel to navigate to, and tap on the target channel item
await FindChannelsScreen.open();
await FindChannelsScreen.searchInput.replaceText(testChannel.name);
await wait(timeouts.ONE_SEC);
await FindChannelsScreen.getFilteredChannelItem(testChannel.name).tap();
// * Verify on target channel screen
@@ -146,10 +149,7 @@ describe('Smoke Test - Channels', () => {
// # Open channel info screen, open edit channel screen, edit channel info, and save changes
await ChannelInfoScreen.open();
await CreateOrEditChannelScreen.openEditChannel();
await CreateOrEditChannelScreen.headerInput.tapReturnKey();
await CreateOrEditChannelScreen.headerInput.typeText('header1');
await CreateOrEditChannelScreen.headerInput.tapReturnKey();
await CreateOrEditChannelScreen.headerInput.typeText('header2');
await CreateOrEditChannelScreen.headerInput.typeText('\nheader1\nheader2');
await CreateOrEditChannelScreen.saveButton.tap();
// * Verify on channel info screen and changes have been saved