Skip to content

Commit

Permalink
fix: temp fix non regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
salimtb committed Oct 16, 2024
1 parent ab9f10a commit dc9d760
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 49 deletions.
2 changes: 1 addition & 1 deletion e2e/pages/modals/NetworkListModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class NetworkListModal {
}

async swipeToDismissModal() {
await Gestures.swipe(this.selectNetwork, 'down', 'slow', 0.6);
await Gestures.swipe(this.selectNetwork, 'down', 'slow', 0.9);
}

async tapTestNetworkSwitch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,62 @@ import { Regression } from '../../tags';

const AccountTwoText = 'Account 2';

describe(Regression('Connecting to multiple dapps and revoking permission on one but staying connected to the other'), () => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
});
describe(
Regression(
'Connecting to multiple dapps and revoking permission on one but staying connected to the other',
),
() => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
});

it('should connect multiple accounts and revoke them', async () => {
await withFixtures(
{
dapp: true,
fixture: new FixtureBuilder()
.withPermissionControllerConnectedToTestDapp()
.build(),
restartDevice: true,
},
async () => {
//should navigate to browser
await loginToApp();
await TabBarComponent.tapBrowser();
await Assertions.checkIfVisible(Browser.browserScreenID);
it('should connect multiple accounts and revoke them', async () => {
await withFixtures(
{
dapp: true,
fixture: new FixtureBuilder()
.withPermissionControllerConnectedToTestDapp()
.build(),
restartDevice: true,
},
async () => {
//should navigate to browser
await loginToApp();
await TabBarComponent.tapBrowser();
await Assertions.checkIfVisible(Browser.browserScreenID);

//TODO: should re add connecting to an external swap step after detox has been updated
//TODO: should re add connecting to an external swap step after detox has been updated

await Browser.navigateToTestDApp();
await Browser.tapNetworkAvatarButtonOnBrowser();
await Assertions.checkIfVisible(ConnectedAccountsModal.title);
await TestHelpers.delay(2000);
await Browser.navigateToTestDApp();
await Browser.tapNetworkAvatarButtonOnBrowser();
await Assertions.checkIfVisible(ConnectedAccountsModal.title);
await TestHelpers.delay(2000);

await Assertions.checkIfNotVisible(ToastModal.notificationTitle);
await ConnectedAccountsModal.tapConnectMoreAccountsButton();
await AccountListView.tapAddAccountButton();
await AddAccountModal.tapCreateAccount();
if (device.getPlatform() === 'android') {
await Assertions.checkIfTextIsDisplayed(AccountTwoText);
}
await AccountListView.tapAccountIndex(0);
await AccountListView.tapConnectAccountsButton();
await Assertions.checkIfNotVisible(ToastModal.notificationTitle);
await ConnectedAccountsModal.tapConnectMoreAccountsButton();
await AccountListView.tapAddAccountButton();
await AddAccountModal.tapCreateAccount();
if (device.getPlatform() === 'android') {
await Assertions.checkIfTextIsDisplayed(AccountTwoText);
}
await AccountListView.tapAccountIndex(0);
await AccountListView.tapConnectAccountsButton();

// should revoke accounts
await Browser.tapNetworkAvatarButtonOnBrowser();
await ConnectedAccountsModal.tapPermissionsButton();
await TestHelpers.delay(1500);
await ConnectedAccountsModal.tapDisconnectAllButton();
await Assertions.checkIfNotVisible(ToastModal.notificationTitle);
// should revoke accounts
await Browser.tapNetworkAvatarButtonOnBrowser();
await ConnectedAccountsModal.tapPermissionsButton();
await TestHelpers.delay(1500);
await ConnectedAccountsModal.tapDisconnectAllButton();
await Assertions.checkIfNotVisible(ToastModal.notificationTitle);

await Browser.tapNetworkAvatarButtonOnBrowser();
await Assertions.checkIfNotVisible(ConnectedAccountsModal.title);
await Assertions.checkIfVisible(NetworkListModal.networkScroll);
await NetworkListModal.swipeToDismissModal();
await Assertions.checkIfNotVisible(NetworkListModal.networkScroll);
},
);
});
});
await Browser.tapNetworkAvatarButtonOnBrowser();
await Assertions.checkIfNotVisible(ConnectedAccountsModal.title);
await Assertions.checkIfVisible(NetworkListModal.networkScroll);
await NetworkListModal.swipeToDismissModal();
await Assertions.checkIfNotVisible(NetworkListModal.networkScroll);
},
);
});
},
);

0 comments on commit dc9d760

Please sign in to comment.