Commit f88af9d5 authored by Fred Chasen's avatar Fred Chasen

Fix roman numeral test script url

parent 3fe2ce97
......@@ -8,7 +8,7 @@
Reset counter page
</title>
<script src="http://localhost:9090/dist/paged.polyfill.js"></script>
<script src="../../../dist/paged.polyfill.js"></script>
<style>
:root{
......
const TIMEOUT = 10000;
describe('issue-74', async () => {
describe('roman-numerals', async () => {
let page;
let rendered;
beforeAll(async () => {
page = await loadPage('issues/issue-74/issue-74.html')
page = await loadPage('issues/roman-numerals/roman-numerals.html')
return page.rendered;
}, TIMEOUT)
......@@ -18,7 +18,7 @@ describe('issue-74', async () => {
let pages = await page.$$eval(".pagedjs_page", (r) => {
return r.length;
});
console.log("pages", pages)
expect(pages).toEqual(5);
})
......
......@@ -45,15 +45,26 @@ class PuppeteerEnvironment extends NodeEnvironment {
async loadPage(path) {
let page = await this.global.browser.newPage();
page.addListener('pageerror', this.handleError);
page.addListener('error', this.handleError);
let renderedResolve, renderedReject;
page.rendered = new Promise(function(resolve, reject) {
renderedResolve = resolve;
renderedReject = reject;
});
page.addListener('pageerror', (error) => {
this.handleError(error);
renderedReject(error);
});
page.addListener('error', (error) => {
this.handleError(error);
renderedReject(error);
});
// await page.exposeFunction('PuppeteerLogger', (msg, counter) => {
// console.log(msg, counter);
// });
await page.exposeFunction('onPagesRendered', (msg, width, height, orientation) => {
renderedResolve(msg, width, height, orientation);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment