Skip to content
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

[Detox]fix addressbook and browser test #4331

Merged
merged 3 commits into from
May 16, 2022
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: 4 additions & 0 deletions e2e/pages/Drawer/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export class Browser {
await TestHelpers.checkIfNotVisible(ADD_BOOKMARKS_SCREEN_ID);
}

static async isBrowserFavoriteVisible(browserFavoriteName) {
await TestHelpers.checkIfElementWithTextIsVisible(browserFavoriteName);
}

static async isBackToSafetyButtonVisible() {
await TestHelpers.checkIfElementWithTextIsVisible('Back to safety');
}
Expand Down
6 changes: 1 addition & 5 deletions e2e/pages/SendView.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ export default class SendView {
await TestHelpers.waitAndTap(NEXT_BUTTON_ID);
}
static async inputAddress(address) {
if (device.getPlatform() === 'android') {
await TestHelpers.replaceTextInField(ADDRESS_INPUT_BOX_ID, address);
} else {
await TestHelpers.typeTextAndHideKeyboard(ADDRESS_INPUT_BOX_ID, address);
}
await TestHelpers.replaceTextInField(ADDRESS_INPUT_BOX_ID, address);
}

static async tapAndLongPress() {
Expand Down
8 changes: 3 additions & 5 deletions e2e/specs/browser-tests.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,16 @@ describe('Browser Tests', () => {
await Browser.isAddBookmarkScreenNotVisible(); // Add bookmark screen should not be visible
});

it('should go back home', async () => {
it('tap on home button', async () => {
// Tap on home on bottom navbar
await Browser.tapHomeButton();
// Wait for page to load
await TestHelpers.delay(1000);
await Browser.isVisible();
});
it('should navigate to favorites', async () => {
if (device.getPlatform() === 'ios') {
await Browser.tapOptionsButton();
await Browser.tapOpenTabButton();

it('should tap on Uniswap in favorites', async () => {
if (device.getPlatform() === 'ios') {
// Tapping on favourite tap
await TestHelpers.tapAtPoint(BROWSER_SCREEN_ID, { x: 174, y: 281 });
await TestHelpers.delay(1500);
Expand Down