forked from DevExpress/testcafe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ef3b01
commit 43f3adf
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
test/functional/fixtures/regression/gh-5961/pages/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Testcafe screenshot sizing issue</title> | ||
<style> | ||
.test-box { | ||
width: 80px; | ||
height: 80px; | ||
margin: 8px; | ||
display: inline-block; | ||
border: 2px solid red; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
background-color: #60A96E; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="wrapper"></div> | ||
<script> | ||
var wrapper = document.getElementById("wrapper"); | ||
|
||
var myHTML = ''; | ||
|
||
for (var i = 0; i < 10; i++) { | ||
myHTML += '<div>'; | ||
for (var j = 0; j < 10; j++) { | ||
myHTML += '<div class="test-box">' + (i * 10 + j + 1) + '</div>'; | ||
} | ||
myHTML += '</div>'; | ||
} | ||
wrapper.innerHTML = myHTML | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('[Regression](GH-5961)', () => { | ||
it('Screenshot', () => { | ||
return runTests('./testcafe-fixtures/index.js', 'Take a full page screenshot'); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
test/functional/fixtures/regression/gh-5961/testcafe-fixtures/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {Selector} from "testcafe"; | ||
|
||
fixture`Getting Started` | ||
.page`../pages/index.html`; | ||
|
||
const getBrowserName = (alias) => alias.split(':').join('_'); | ||
|
||
test('Take a full page screenshot', async t => { | ||
const path = `gh-5961/${ getBrowserName(t.browser.alias) }_full-page.png`; | ||
|
||
await t.resizeWindow(2024, 768); | ||
await t.takeScreenshot({ | ||
path, | ||
fullPage: true | ||
}); | ||
}); | ||
|
||
test.page('https://advancedinstaller.com/blog/page-1.html')('Take a full page screenshot2', async t => { | ||
const path = `gh-5961/${ getBrowserName(t.browser.alias) }1_full-page.png`; | ||
await t | ||
.resizeWindow(768, 800) | ||
.click(Selector('#cookies button')) | ||
.takeScreenshot({ fullPage: true, path }); | ||
}); |