1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 11:28:51 +01:00

[e2e]Add e2e test for deleting custom network (#17254)

* add test for deleting added custom network

* update code because of failing on firefox browser

* changing steps for adding custom network

* chage code for custom network
This commit is contained in:
dzfjz 2023-01-27 17:50:08 +01:00 committed by GitHub
parent 6ee2d07706
commit abb2532a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,4 +147,55 @@ describe('Custom network', function () {
},
);
});
it('Add a custom network and then delete that same network', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder()
.withPreferencesController({
frequentRpcListDetail: [
{
rpcUrl: networkURL,
chainId: chainID,
ticker: currencySYMBOL,
nickname: networkNAME,
rpcPrefs: {},
},
],
})
.build(),
ganacheOptions,
title: this.test.title,
},
async ({ driver }) => {
await driver.navigate();
await driver.fill('#password', 'correct horse battery staple');
await driver.press('#password', driver.Key.ENTER);
await driver.clickElement('.account-menu__icon');
await driver.clickElement({ text: 'Settings', tag: 'div' });
await driver.clickElement({ text: 'Networks', tag: 'div' });
const arbitrumNetwork = await driver.clickElement({
text: `Arbitrum One`,
tag: 'div',
});
await driver.clickElement({
tag: 'button',
text: 'Delete',
});
await driver.findElement('.modal-container__footer');
// should be deleted from the modal shown again to complete deletion custom network
await driver.clickElement({
tag: 'button',
text: 'Delete',
});
// it checks if custom network is delete
const existNetwork = await driver.isElementPresent(arbitrumNetwork);
assert.equal(existNetwork, false, 'Network is not deleted');
},
);
});
});