Skip to content

Commit 5ec06e9

Browse files
committed
test: fix Unstoppable test with AVAX send
test: added LiFi and DeBridge provider names to hop tests
1 parent 10eea12 commit 5ec06e9

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ $ export SEED_WORDS={testNet import wallet 12 words}
5555
5656
Ex: export SEED_WORDS="test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12"
5757
58-
$ npm run test:testNetNetwork
58+
$ npm run test:mainnet:prodagent:release
5959
```
6060

61+
Run single test locally, update the [.mocharc.yml](.mocharc.yml) values ``parallel: false jobs: 1`` and add ``.only`` to the test you want to run.
62+
6163
### Releases
6264

6365
Release to Chrome Store

test/e2e/hop_tests/hop_swaps.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe('SWAP feature["MAINNET"]', async () => {
8181
expect(
8282
await page.$eval('#selectedQuote_provider', (el) => el.textContent),
8383
'ARBETH->PWETH,Hop swap Provider!!'
84-
).oneOf(['Hop'])
84+
).oneOf(['Hop', 'LiFi'])
8585

8686
//Click swap types
8787
await page.click('#swap_types_option')
@@ -191,7 +191,7 @@ describe('SWAP feature["MAINNET"]', async () => {
191191
expect(
192192
await page.$eval('#selectedQuote_provider', (el) => el.textContent),
193193
'USDC->PUSDC,Hop swap Provider!!'
194-
).oneOf(['Hop'])
194+
).oneOf(['Hop','DeBridge','LiFi'])
195195

196196
//Click swap types
197197
await page.click('#swap_types_option')

test/e2e/send_transaction.spec.js

+14-5
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,13 @@ describe('SEND feature', async () => {
273273
'Available balance and Max send amount are equal for ethereum'
274274
).contains(sendAmount)
275275
})
276-
it('Unstoppable Domains Send [PULL_REQUEST_TEST]', async () => {
277-
const assetName = 'ETH'
276+
it('Unstoppable Domains Send from AVAX to shaista.blockchain [PULL_REQUEST_TEST]', async () => {
277+
const assetName = 'AVAX'
278278
const coinsToSend = '0.00001'
279-
const domainName = 'shaista.blockchain'
279+
const domainDetails = {
280+
name: 'shaista.blockchain',
281+
address: '0xaDa3...3023'
282+
}
280283

281284
await overviewPage.SelectAssetFromOverview(page, assetName)
282285
console.log('Selected asset from overview')
@@ -289,11 +292,17 @@ describe('SEND feature', async () => {
289292
// Enter send amount (or) coins
290293
await sendPage.EnterSendAmount(page, coinsToSend)
291294
// Send address
292-
await sendPage.EnterSendToAddress(page, domainName)
295+
await sendPage.EnterSendToAddress(page, domainDetails.name)
293296
// Click Send Review Button
294297
await page.waitForSelector('#send_review_button', { visible: true})
298+
const isReviewButtonDisabled = await page.$eval('#send_review_button', (el) => el.disabled)
299+
expect(isReviewButtonDisabled, 'Send Review button should be enabled').to.be.false
300+
console.log('Send review button is enabled so clicking it')
295301
try {
296302
await page.click('#send_review_button', { clickCount: 5 })
303+
const confirmAddress = await page.$eval('#confirm-address', (el) => el.innerText)
304+
expect(confirmAddress).contains(domainDetails.address)
305+
console.log('Confirm address is correct')
297306
await page.waitForSelector('#send_button_confirm', { visible: true, timeout: 60000 })
298307
} catch (e) {
299308
if (e instanceof puppeteer.errors.TimeoutError) {
@@ -338,6 +347,6 @@ describe('SEND feature', async () => {
338347
// validate domain name in transaction details
339348
await page.waitForSelector('#transaction_details_send_to_link', { visible: true })
340349
const sedToDetails = await page.$eval('#transaction_details_send_to_link', el => el.textContent)
341-
expect(sedToDetails,'Send to transaction details should have unstoppabledomain name').contain(domainName)
350+
expect(sedToDetails,'Send to transaction details should have unstoppabledomain name').contain("shai")
342351
})
343352
})

test/pages/OverviewPage.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,17 @@ class OverviewPage {
198198
}
199199

200200
case 'AVAX': {
201-
const eth = await page.waitForSelector('#AVALANCHE', {
201+
const avalanche = await page.waitForSelector('#AVALANCHE', {
202202
timeout: elementVisibleTimeout,
203203
visible: true
204204
})
205-
await eth.click()
205+
await avalanche.click()
206206
await page.waitForSelector(`#${assetName}`, {
207207
timeout: elementVisibleTimeout,
208208
visible: true
209209
})
210210
await page.click(`#${assetName}`)
211+
console.log('AVAX asset has been selected')
211212
break
212213
}
213214

0 commit comments

Comments
 (0)