Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: typeText should work with the DX Lookup search field #6236

Merged
merged 1 commit into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/functional/fixtures/regression/gh-4472/pages/index.html
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>gh-4472</title>
</head>
<body>
<div id="targetInputWrapper">
<input type="text" id="targetInput" tabindex="0"></input>
</div>
<script>
var input = document.getElementById('targetInput');
var div = document.getElementById('targetInputWrapper');

input.onclick = function () {
div.focus();
};
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions test/functional/fixtures/regression/gh-4472/test.js
@@ -0,0 +1,5 @@
describe('[Regression](GH-4472)', function () {
it('Input should not lose focus after the focus method was called on a not focusable element', function () {
return runTests('testcafe-fixtures/index.js');
});
});
@@ -0,0 +1,11 @@
import { Selector } from 'testcafe';

fixture `GH-4472`
.page `http://localhost:3000/fixtures/regression/gh-4472/pages/index.html`;

test(`Should not lose the focus on input`, async t => {
const input = Selector('#targetInput');

await t.typeText(input, 'text');
await t.expect(input.value).eql('text');
});