mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: fix pdf tests (#11822)
This commit is contained in:
parent
75c9e117f1
commit
6514accb26
@ -955,12 +955,6 @@
|
||||
"parameters": ["webDriverBiDi"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.pdf can print to PDF without accessible tags",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["webDriverBiDi"],
|
||||
"expectations": ["SKIP"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.pdf should respect timeout",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
@ -3100,12 +3094,6 @@
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.pdf can print to PDF without accessible tags",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"expectations": ["SKIP"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.removeExposedFunction should work",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
|
@ -20,7 +20,7 @@ describe('Page.pdf', () => {
|
||||
const outputFileAccessible =
|
||||
__dirname + '/../../assets/output-accessible.pdf';
|
||||
await page.goto(server.PREFIX + '/pdf.html');
|
||||
await page.pdf({path: outputFile});
|
||||
await page.pdf({path: outputFile, tagged: false});
|
||||
await page.pdf({path: outputFileAccessible, tagged: true});
|
||||
try {
|
||||
const [base, tagged] = await Promise.all([
|
||||
|
@ -1940,25 +1940,6 @@ describe('Page', function () {
|
||||
}
|
||||
});
|
||||
|
||||
it('can print to PDF without accessible tags', async () => {
|
||||
const {page, server} = await getTestState();
|
||||
|
||||
const outputFile = __dirname + '/../assets/output.pdf';
|
||||
const outputFileAccessible =
|
||||
__dirname + '/../assets/output-accessible.pdf';
|
||||
await page.goto(server.PREFIX + '/pdf.html');
|
||||
await page.pdf({path: outputFile});
|
||||
await page.pdf({path: outputFileAccessible, tagged: false});
|
||||
try {
|
||||
expect(fs.readFileSync(outputFileAccessible).byteLength).toBeLessThan(
|
||||
fs.readFileSync(outputFile).byteLength
|
||||
);
|
||||
} finally {
|
||||
fs.unlinkSync(outputFileAccessible);
|
||||
fs.unlinkSync(outputFile);
|
||||
}
|
||||
});
|
||||
|
||||
it('can print to PDF and stream the result', async () => {
|
||||
const {page} = await getTestState();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user