mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +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:
parent
6ee2d07706
commit
abb2532a3b
@ -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');
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user