Files
xahau.js/test/browser/browserIntegration.ts
Mayukha Vadari f9fe5936b1 refactor: rename all test files to camelCase (#1562)
* rename files to camelCase

* fix imports

* more renames

* pull all client tests out of individual folders

* fix imports

* fix tests
2021-10-04 14:10:10 -04:00

30 lines
1.0 KiB
TypeScript

import assert from 'assert'
import puppeteer from 'puppeteer'
describe("Browser Tests", () => {
it("Integration Tests", async () => {
const browser = await puppeteer.launch({"headless": true});
try {
const page = await browser.newPage().catch();
await page.goto(`file:///${__dirname}/../localIntegrationRunner.html`);
await page.waitForFunction('document.querySelector("body").innerText.includes("submit multisigned transaction")');
const fails = await page.evaluate(() => {
return document.querySelector('.failures').textContent
})
const passes = await page.evaluate(() => {
return document.querySelector('.passes').textContent
})
assert.equal(fails, "failures: 0")
assert.notEqual(passes, "passes: 0")
} catch (err) {
console.log(err)
assert(false)
} finally {
await browser.close();
}
}).timeout(40000)
})