Skip to content

Commit

Permalink
Fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelSalas committed Apr 24, 2024
1 parent c745381 commit 5363983
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export const AddContactViewSelectorsIDs = {
export const AddContactViewSelectorsText = {
EDIT_BUTTON: enContent.address_book.edit,
EDIT_CONTACT: enContent.address_book.edit_contact,
MEMO: enContent.address_book.memo,
};
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe(
await Browser.isVisible();
await Browser.tapNetworkAvatarButtonOnBrowser();
await Assertions.checkIfNotVisible(ConnectedAccountsModal.title);
await Assertions.checkIfVisible(NetworkListModal.testSwitch);
await Assertions.checkIfVisible(NetworkListModal.testNetToggle);
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ import TestHelpers from '../../helpers';
import Browser from '../../pages/Browser';
import AccountListView from '../../pages/AccountListView';
import TabBarComponent from '../../pages/TabBarComponent';
import ConnectModal from '../../pages/modals/ConnectModal';
import ConnectedAccountsModal from '../../pages/modals/ConnectedAccountsModal';
import { loginToApp } from '../../viewHelper';
import NetworkListModal from '../../pages/modals/NetworkListModal';
import FixtureBuilder from '../../fixtures/fixture-builder';
import { withFixtures } from '../../fixtures/fixture-helper';
import Assertions from '../../utils/Assertions';

const SUSHI_SWAP = 'https://app.sushi.com/swap';
const SUSHI_SWAP_SHORT_HAND_URL = 'app.sushi.com';

describe('Connecting to multiple dapps and revoking permission on one but staying connected to the other', () => {
beforeAll(async () => {
jest.setTimeout(150000);
Expand All @@ -35,17 +31,6 @@ describe('Connecting to multiple dapps and revoking permission on one but stayin
await TabBarComponent.tapBrowser();
await Browser.isVisible();

// should connect to sushi swap dapp
await Browser.tapUrlInputBox();
await Browser.navigateToURL(SUSHI_SWAP);
await Assertions.checkIfVisible(ConnectModal.container);
await ConnectModal.scrollToBottomOfModal();
await Assertions.checkIfNotVisible(ConnectModal.container);
await TabBarComponent.tapBrowser();

// should connect with multiple accounts
await Browser.tapOpenAllTabsButton();
await Browser.tapOpenNewTabButton();
await Browser.navigateToTestDApp();
await Browser.isAccountToastVisible('Account 1');
await Browser.tapNetworkAvatarButtonOnBrowserWhileAccountIsConnectedToDapp();
Expand All @@ -69,11 +54,6 @@ describe('Connecting to multiple dapps and revoking permission on one but stayin
await Assertions.checkIfVisible(NetworkListModal.networkScroll);
await NetworkListModal.swipeToDismissModal();
await Assertions.checkIfNotVisible(NetworkListModal.networkScroll);
await TestHelpers.delay(3500);
await Browser.tapOpenAllTabsButton();
await TestHelpers.tapByText(SUSHI_SWAP_SHORT_HAND_URL);
await Browser.tapNetworkAvatarButtonOnBrowserWhileAccountIsConnectedToDapp();
await Assertions.checkIfVisible(NetworkListModal.networkScroll);
},
);
});
Expand Down

0 comments on commit 5363983

Please sign in to comment.