Files
xahau.js/test/browser/browserIntegration.ts
Nathan Nichols 8b95ee5fab build: Initial linting setup (#1560)
* sets up linting config and runs `yarn lint --fix` once, so that all changes will show up correctly in future PRs.

* Note that there are still a lot of linter errors.
2021-10-04 14:10:10 -04:00

36 lines
1.1 KiB
TypeScript

import { expect, assert } from "chai";
import puppeteer from "puppeteer";
describe("Browser Tests", function () {
it("Integration Tests", async function () {
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(() => {
const element = document.querySelector(".failures");
return element == null ? null : element.textContent;
});
const passes = await page.evaluate(() => {
const element = document.querySelector(".passes");
return element == null ? null : element.textContent;
});
expect(fails).to.equal("failures: 0");
expect(passes).to.not.equal("passes: 0");
} catch (err) {
console.log(err);
assert(false);
} finally {
await browser.close();
}
}).timeout(40000);
});