Skip to content

Commit

Permalink
Should scroll to element overlapped by TestCafe panel(closes #3924) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKamaev authored and miherlosev committed Jun 28, 2019
1 parent c724cf8 commit 8470365
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/ui/styles.less
Expand Up @@ -182,11 +182,11 @@
visibility: hidden;
}

/* Cursor */
&.hidden .cursor {
display: none;
&.hidden {
visibility: hidden;
}

/* Cursor */
&.blind .cursor {
opacity: 0.4;
}
Expand Down
40 changes: 40 additions & 0 deletions test/functional/fixtures/regression/gh-3924/pages/index.html
@@ -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>
7 changes: 7 additions & 0 deletions test/functional/fixtures/regression/gh-3924/test.js
@@ -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');
});
});


@@ -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);
});

0 comments on commit 8470365

Please sign in to comment.