|
1 | 1 | const { strict: assert } = require('assert'); |
2 | | -const { convertToHexValue, withFixtures, largeDelayMs } = require('../helpers'); |
| 2 | +const { convertToHexValue, withFixtures } = require('../helpers'); |
3 | 3 | const FixtureBuilder = require('../fixture-builder'); |
4 | 4 |
|
5 | 5 | describe('Stores custom RPC history', function () { |
@@ -30,8 +30,7 @@ describe('Stores custom RPC history', function () { |
30 | 30 | const rpcUrl = `http://127.0.0.1:${port}`; |
31 | 31 | const networkName = 'Secondary Ganache Testnet'; |
32 | 32 |
|
33 | | - await driver.delay(largeDelayMs); |
34 | | - |
| 33 | + await driver.waitForElementNotPresent('.loading-overlay'); |
35 | 34 | await driver.clickElement('.network-display'); |
36 | 35 |
|
37 | 36 | await driver.clickElement({ text: 'Add network', tag: 'button' }); |
@@ -87,8 +86,7 @@ describe('Stores custom RPC history', function () { |
87 | 86 | // duplicate network |
88 | 87 | const duplicateRpcUrl = 'https://mainnet.infura.io/v3/'; |
89 | 88 |
|
90 | | - await driver.delay(largeDelayMs); |
91 | | - |
| 89 | + await driver.waitForElementNotPresent('.loading-overlay'); |
92 | 90 | await driver.clickElement('.network-display'); |
93 | 91 |
|
94 | 92 | await driver.clickElement({ text: 'Add network', tag: 'button' }); |
@@ -132,8 +130,7 @@ describe('Stores custom RPC history', function () { |
132 | 130 | const newRpcUrl = 'http://localhost:8544'; |
133 | 131 | const duplicateChainId = '1'; |
134 | 132 |
|
135 | | - await driver.delay(largeDelayMs); |
136 | | - |
| 133 | + await driver.waitForElementNotPresent('.loading-overlay'); |
137 | 134 | await driver.clickElement('.network-display'); |
138 | 135 |
|
139 | 136 | await driver.clickElement({ text: 'Add network', tag: 'button' }); |
@@ -181,8 +178,7 @@ describe('Stores custom RPC history', function () { |
181 | 178 | await driver.fill('#password', 'correct horse battery staple'); |
182 | 179 | await driver.press('#password', driver.Key.ENTER); |
183 | 180 |
|
184 | | - await driver.delay(largeDelayMs); |
185 | | - |
| 181 | + await driver.waitForElementNotPresent('.loading-overlay'); |
186 | 182 | await driver.clickElement('.network-display'); |
187 | 183 |
|
188 | 184 | await driver.clickElement({ text: 'Ethereum Mainnet', tag: 'span' }); |
@@ -221,7 +217,7 @@ describe('Stores custom RPC history', function () { |
221 | 217 | await driver.fill('#password', 'correct horse battery staple'); |
222 | 218 | await driver.press('#password', driver.Key.ENTER); |
223 | 219 |
|
224 | | - await driver.delay(largeDelayMs); |
| 220 | + await driver.waitForElementNotPresent('.loading-overlay'); |
225 | 221 | await driver.clickElement('.network-display'); |
226 | 222 |
|
227 | 223 | // only recent 3 are found and in correct order (most recent at the top) |
@@ -270,7 +266,7 @@ describe('Stores custom RPC history', function () { |
270 | 266 | await driver.fill('#password', 'correct horse battery staple'); |
271 | 267 | await driver.press('#password', driver.Key.ENTER); |
272 | 268 |
|
273 | | - await driver.delay(largeDelayMs); |
| 269 | + await driver.waitForElementNotPresent('.loading-overlay'); |
274 | 270 | await driver.clickElement('.network-display'); |
275 | 271 |
|
276 | 272 | await driver.clickElement({ text: 'Add network', tag: 'button' }); |
|
0 commit comments