mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-11 09:54:41 +00:00
update tests
This commit is contained in:
parent
278f42d4c7
commit
8abb752520
6 changed files with 4 additions and 2 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
BIN
tests/.DS_Store
vendored
BIN
tests/.DS_Store
vendored
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
const puppeteer = require('puppeteer');
|
||||
const fs = require('fs')
|
||||
|
||||
const CRX_PATH = '../../web-extension';
|
||||
const CRX_PATH = '../web-extension';
|
||||
const REFERENCE_EBOOK_PATH = 'reference-ebook'
|
||||
const TEST_RESULT_EBOOK_PATH = 'test-result-ebook'
|
||||
const TEST_EBOOK_FILE_NAME = 'test.epub'
|
||||
|
@ -26,7 +26,7 @@ puppeteer.launch({
|
|||
|
||||
async function runLocalFullPageTests(browser) {
|
||||
|
||||
const testedFileName = 'svg' //'special-chars' // 'p2' //'p1'
|
||||
const testedFileName = 'canvas' //'svg' //'special-chars' // 'p2' //'p1'
|
||||
|
||||
const testUrl = 'file://'+__dirname+'/pages/'+testedFileName+'/page/index.html'
|
||||
const resultDownloadPath = './pages/'+testedFileName+'/' + TEST_RESULT_EBOOK_PATH
|
||||
|
|
BIN
tests/pages.zip
BIN
tests/pages.zip
Binary file not shown.
BIN
web-extension/.DS_Store
vendored
BIN
web-extension/.DS_Store
vendored
Binary file not shown.
|
@ -77,6 +77,7 @@ function extractMathMl($htmlObject) {
|
|||
});
|
||||
}
|
||||
|
||||
// tested
|
||||
function extractCanvasToImg($htmlObject) {
|
||||
$htmlObject.find('canvas').each(function (index, elem) {
|
||||
var tmpXP = getXPath(elem);
|
||||
|
@ -87,6 +88,7 @@ function extractCanvasToImg($htmlObject) {
|
|||
});
|
||||
}
|
||||
|
||||
// tested
|
||||
function extractSvgToImg($htmlObject) {
|
||||
var serializer = new XMLSerializer();
|
||||
$htmlObject.find('svg').each(function (index, elem) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue