Browse Source

Fixed line endings

obersalzberg
Uwe Oestermeier 1 year ago
parent
commit
6f7a18d6b8
1 changed files with 13 additions and 13 deletions
  1. +13
    -13
      bin/testrunner.js

+ 13
- 13
bin/testrunner.js View File

@ -1,9 +1,9 @@
/**
*
* make screenshots and log errors to
*
* make screenshots and log errors to
* console
* (c) 2019 - Leibniz-Insitut für Wissensmedien
*
*
*/
const puppeteer = require('puppeteer');
@ -24,13 +24,13 @@ function logPageEvent(event){
}
async function makeScreenshot(href){
const browser = await puppeteer.launch({args: [
'–allow-file-access-from-files',
],});
const page = await browser.newPage();
await page.setViewport({width: 1024,height : 624})
// register events
@ -53,9 +53,9 @@ async function makeScreenshot(href){
}
// image_url = image_url.replace("file:///","")
// fpath = fpath.replace("file:///","")
page.removeAllListeners()
fs.ensureDir(fpath)
await page.screenshot({path: image_url});
@ -63,10 +63,10 @@ async function makeScreenshot(href){
}
/**
*
*
* collect all navigational links in all documents
*
* */
*
* */
async function collectLinks(href,reflist)
{
@ -76,12 +76,12 @@ async function collectLinks(href,reflist)
await page.goto(href)
let hrefs = await page.$$('a.wrapper')
for (var i=0; i < hrefs.length; i++) {
let hrefValue = await hrefs[i].getProperty('href')
let linkText = await hrefValue.jsonValue();
if (!linkText.startsWith("file:"))
{
{
continue;
}
if(linkText.endsWith("#")) continue;
@ -113,4 +113,4 @@ async function collectLinks(href,reflist)
await makeScreenshot(reflist[i])
console.log(i,reflist[i])
}
})()
})()

Loading…
Cancel
Save