Skip to content

Commit

Permalink
test: fix pdf tests (#11822)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Feb 2, 2024
1 parent 75c9e11 commit 6514acc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
12 changes: 0 additions & 12 deletions test/TestExpectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion test/src/cdp/pdf.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
19 changes: 0 additions & 19 deletions test/src/page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 6514acc

Please sign in to comment.