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.
Should scroll to element overlapped by TestCafe panel(closes DevExpre…
- Loading branch information
1 parent
6083a38
commit e54fbaa
Showing
4 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
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
40 changes: 40 additions & 0 deletions
40
test/functional/fixtures/regression/gh-3924/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,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>gh-3924</title> | ||
<style> | ||
button { | ||
margin-bottom: 5000px; | ||
} | ||
|
||
#footer { | ||
position: fixed; | ||
bottom: 0; | ||
height: 100px; | ||
background-color: red; | ||
opacity: 0.5; | ||
left: 0; | ||
right: 0; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="footer"></div> | ||
<button onclick="onClick()">Click me</button> | ||
|
||
<script> | ||
window.clicked = false; | ||
|
||
function onClick () { | ||
window.clicked = true; | ||
} | ||
|
||
var button = document.querySelector('button'); | ||
|
||
button.addEventListener('click', onClick); | ||
|
||
button.style.marginTop = document.documentElement.clientHeight - button.clientHeight - 20 + 'px'; | ||
</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,7 @@ | ||
describe('[Regression](GH-3924) - Should scroll to element overlapped by TestCafe panel', function () { | ||
it('Should scroll to element overlapped by TestCafe panel', function () { | ||
return runTests('testcafe-fixtures/index.js'); | ||
}); | ||
}); | ||
|
||
|
16 changes: 16 additions & 0 deletions
16
test/functional/fixtures/regression/gh-3924/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,16 @@ | ||
import { ClientFunction } from 'testcafe'; | ||
|
||
fixture `GH-3924 - Scroll to element overlapped by TestCafe panel` | ||
.page`http://localhost:3000/fixtures/regression/gh-3924/pages/index.html`; | ||
|
||
const getClicked = ClientFunction(() => { | ||
return window.clicked; | ||
}); | ||
|
||
test(`Click button`, async t => { | ||
await t.click('button'); | ||
|
||
const clicked = await getClicked(); | ||
|
||
await t.expect(clicked).eql(true); | ||
}); |