Skip to content

Commit

Permalink
test: added QR code check, take screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
beemi committed Dec 20, 2021
1 parent 004344e commit fed97e2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/e2e/02_import_wallet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ describe('Import wallet-["MAINNET","TESTNET"]', async () => {

// GET the ETHEREUM assert Address
const ethAddress = await overviewPage.GetAssertAddress(page, 'ETHEREUM')
expect(ethAddress, 'ETH address should not be null').not.equals(null)
const rskAddress = await overviewPage.GetAssertAddress(page, 'RSK')
expect(rskAddress, `ETH address ${ethAddress}& RSK address ${rskAddress} should be equal if balance is greater than 0`)
expect(rskAddress, 'RSK address should not be null').not.equals(null)
expect(rskAddress, `ETH address ${ethAddress} & RSK address ${rskAddress} should be equal if balance is greater than 0`)
.equals(ethAddress)

// Check RSK & ERC20 tokens
Expand Down
14 changes: 13 additions & 1 deletion test/pages/ReceivePage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const TestUtil = require('../utils/TestUtils')

const testUtil = new TestUtil()

const puppeteer = require('puppeteer')
const expect = require('chai').expect
const assert = require('chai').assert

Expand All @@ -23,7 +28,14 @@ class ReceivePage {
* @constructor
*/
async HasQRCodeDisplayed (page) {
await page.waitForSelector('.receive_qr', { visible: true, timeout: 60000 })
try {
await page.waitForSelector('.receive_qr', { visible: true, timeout: 120000 })
} catch (e) {
if (e instanceof puppeteer.errors.TimeoutError) {
await testUtil.takeScreenshot(page, 'QR-code-issue')
expect(e, 'Receive QR code not available').equals(null)
}
}
}

/**
Expand Down

0 comments on commit fed97e2

Please sign in to comment.