1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Remove timeouts without effect (#18342)

This commit is contained in:
seaona 2023-03-28 14:59:41 +02:00 committed by GitHub
parent 0f1b86a037
commit d4f04815c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 60 additions and 111 deletions

View File

@ -346,13 +346,10 @@ describe('MetaMask', function () {
});
it('finds the transaction in the transactions list', async function () {
await driver.waitForSelector(
{
await driver.waitForSelector({
css: '.transaction-list__completed-transactions .transaction-list-item__primary-currency',
text: '-1 TST',
},
{ timeout: 10000 },
);
});
await driver.waitForSelector({
css: '.list-item__heading',
@ -380,13 +377,10 @@ describe('MetaMask', function () {
await driver.delay(largeDelayMs);
await driver.findElements('.transaction-list__pending-transactions');
await driver.waitForSelector(
{
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
text: '-1.5 TST',
},
{ timeout: 10000 },
);
});
await driver.clickElement('.transaction-list-item__primary-currency');
await driver.delay(regularDelayMs);

View File

@ -59,7 +59,6 @@ describe('ERC721 NFTs testdapp interaction', function () {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
// Verify transaction
@ -130,7 +129,6 @@ describe('ERC721 NFTs testdapp interaction', function () {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
// Verify transaction
@ -202,7 +200,6 @@ describe('ERC721 NFTs testdapp interaction', function () {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
// Verify transaction
@ -277,7 +274,6 @@ describe('ERC721 NFTs testdapp interaction', function () {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
// Verify transaction

View File

@ -63,13 +63,10 @@ describe('Address Book', function () {
return confirmedTxes.length === 1;
}, 10000);
await driver.waitForSelector(
{
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
text: '-2 ETH',
},
{ timeout: 10000 },
);
});
},
);
});

View File

@ -34,14 +34,14 @@ describe('Clear account activity', function () {
// Check send transaction and receive transaction history are all displayed
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
{ css: '.list-item__title', text: 'Send' },
{ timeout: 10000 },
);
await driver.waitForSelector(
{ css: '.list-item__title', text: 'Receive' },
{ timeout: 10000 },
);
await driver.waitForSelector({
css: '.list-item__title',
text: 'Send',
});
await driver.waitForSelector({
css: '.list-item__title',
text: 'Receive',
});
// Clear activity and nonce data
await driver.clickElement('.account-menu__icon');

View File

@ -63,15 +63,11 @@ describe('Deploy contract and call contract methods', function () {
await driver.clickElement({ text: 'Activity', tag: 'button' });
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
await driver.waitForSelector(
{
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
text: '-4 ETH',
},
{ timeout: 10000 },
);
});
// calls and confirms a contract method where ETH is received
await driver.switchToWindow(dapp);
@ -87,26 +83,19 @@ describe('Deploy contract and call contract methods', function () {
await driver.switchToWindow(extension);
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(2)',
{ timeout: 10000 },
);
await driver.waitForSelector(
{
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
text: '-0 ETH',
},
{ timeout: 10000 },
);
});
// renders the correct ETH balance
await driver.switchToWindow(extension);
const balance = await ganacheServer.getBalance();
const balanceElement = await driver.waitForSelector(
{
const balanceElement = await driver.waitForSelector({
css: '[data-testid="eth-overview__primary-currency"]',
text: balance,
},
{ timeout: 10000 },
);
});
assert.equal(`${balance}\nETH`, await balanceElement.getText());
},
);

View File

@ -71,7 +71,6 @@ describe('Failing contract interaction ', function () {
await driver.clickElement({ text: 'Activity', tag: 'button' });
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
// display the transaction status
@ -157,7 +156,6 @@ describe('Failing contract interaction on non-EIP1559 network', function () {
await driver.clickElement({ text: 'Activity', tag: 'button' });
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
// display the transaction status

View File

@ -267,13 +267,10 @@ describe('MetaMask Import UI', function () {
await driver.clickElement({ text: 'Remove', tag: 'button' });
// Wait until selected account switches away from removed account to first account
await driver.waitForSelector(
{
await driver.waitForSelector({
css: '.selected-account__name',
text: 'Account 1',
},
{ timeout: 10000 },
);
});
await driver.delay(regularDelayMs);
await driver.clickElement('.account-menu__icon');

View File

@ -163,13 +163,10 @@ describe('MetaMask Responsive UI', function () {
return confirmedTxes.length === 1;
}, 10000);
await driver.waitForSelector(
{
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
text: '-1 ETH',
},
{ timeout: 10000 },
);
});
},
);
});

View File

@ -136,13 +136,10 @@ describe('Navigate transactions', function () {
const windowHandles = await driver.getAllWindowHandles();
const extension = windowHandles[0];
await driver.switchToWindow(extension);
navigationElement = await driver.waitForSelector(
{
navigationElement = await driver.waitForSelector({
css: '.confirm-page-container-navigation',
text: '2 of 5',
},
{ timeout: 10000 },
);
});
navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('2 of 5'),
@ -169,13 +166,10 @@ describe('Navigate transactions', function () {
// reject transaction
await driver.clickElement({ text: 'Reject', tag: 'button' });
const navigationElement = await driver.waitForSelector(
{
const navigationElement = await driver.waitForSelector({
css: '.confirm-page-container-navigation',
text: '1 of 3',
},
{ timeout: 10000 },
);
});
const navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('1 of 3'),
@ -202,13 +196,10 @@ describe('Navigate transactions', function () {
// confirm transaction
await driver.clickElement({ text: 'Confirm', tag: 'button' });
const navigationElement = await driver.waitForSelector(
{
const navigationElement = await driver.waitForSelector({
css: '.confirm-page-container-navigation',
text: '1 of 3',
},
{ timeout: 10000 },
);
});
const navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('1 of 3'),

View File

@ -57,13 +57,10 @@ describe('Personal sign', function () {
const verifySigUtil = await driver.findElement(
'#personalSignVerifySigUtilResult',
);
const verifyECRecover = await driver.waitForSelector(
{
const verifyECRecover = await driver.waitForSelector({
css: '#personalSignVerifyECRecoverResult',
text: publicAddress,
},
{ timeout: 10000 },
);
});
assert.equal(await verifySigUtil.getText(), publicAddress);
assert.equal(await verifyECRecover.getText(), publicAddress);
},

View File

@ -196,13 +196,10 @@ describe('Send ETH from inside MetaMask using advanced gas modal', function () {
return confirmedTxes.length === 1;
}, 10000);
await driver.waitForSelector(
{
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
text: '-1 ETH',
},
{ timeout: 10000 },
);
});
},
);
});
@ -275,7 +272,6 @@ describe('Send ETH from dapp using advanced gas controls', function () {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
@ -345,7 +341,6 @@ describe('Send ETH from dapp using advanced gas controls', function () {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',

View File

@ -168,7 +168,6 @@ describe('Send ERC20 to a 40 character hexadecimal address', function () {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
const sendTransactionListItem = await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
@ -234,7 +233,6 @@ describe('Send ERC20 to a 40 character hexadecimal address', function () {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
{ timeout: 10000 },
);
const sendTransactionListItem = await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',