mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
Run Integration Tests in Browser (#1468)
* ci: Adds github actions testing for webpacked integration test
This commit is contained in:
30
test/browser/browser-integration-test.ts
Normal file
30
test/browser/browser-integration-test.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
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)
|
||||
})
|
||||
Reference in New Issue
Block a user