Merge pull request #61 from Sparticuz/feature/111
This commit is contained in:
commit
1631926197
|
|
@ -3,21 +3,21 @@
|
|||
"url": "https://example.com",
|
||||
"expected": {
|
||||
"title": "Example Domain",
|
||||
"screenshot": "02b4ebddcf15459571f775df95174eaf08b4fa45"
|
||||
"screenshot": "fdd55bf210cb00e00cadf3098055611d11293d02"
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "https://example.com",
|
||||
"expected": {
|
||||
"title": "Example Domain",
|
||||
"screenshot": "02b4ebddcf15459571f775df95174eaf08b4fa45"
|
||||
"screenshot": "fdd55bf210cb00e00cadf3098055611d11293d02"
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "https://get.webgl.org",
|
||||
"expected": {
|
||||
"remove": "logo-container",
|
||||
"screenshot": "f4577bc1eef0f4625985a439914c600dcb995e71"
|
||||
"screenshot": "7a63a9a18f32dcdad78e1e0a03364fade25c85a8"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ exports.handler = async (event, context) => {
|
|||
let browser = null;
|
||||
|
||||
try {
|
||||
const browser = await puppeteer.launch({
|
||||
browser = await puppeteer.launch({
|
||||
args: chromium.args,
|
||||
defaultViewport: chromium.defaultViewport,
|
||||
executablePath: await chromium.executablePath(),
|
||||
|
|
@ -41,7 +41,9 @@ exports.handler = async (event, context) => {
|
|||
document.getElementById(selector).remove();
|
||||
}, job.expected.remove);
|
||||
}
|
||||
ok(createHash('sha1').update((await page.screenshot()).toString('base64')).digest('hex') === job.expected.screenshot, `Screenshot assertion failed.`);
|
||||
const screenshot = await page.screenshot();
|
||||
// console.log(screenshot.toString('base64'), createHash('sha1').update(screenshot.toString('base64')).digest('hex'));
|
||||
ok(createHash('sha1').update(screenshot.toString('base64')).digest('hex') === job.expected.screenshot, `Screenshot assertion failed.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@ instance_size=c6i.12xlarge
|
|||
ansible_connection=ssh
|
||||
ansible_python_interpreter=auto_silent
|
||||
ansible_ssh_private_key_file=ansible.pem
|
||||
chromium_revision=1083080
|
||||
chromium_revision=1095492
|
||||
|
|
|
|||
BIN
bin/chromium.br
BIN
bin/chromium.br
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue