Skip to content

Commit

Permalink
refactor: removed IE and MS Edge Legacy leftovers from test\client\le…
Browse files Browse the repository at this point in the history
…gacy-fixtures\api (DevExpress#7962)

<!--
Thank you for your contribution.

Before making a PR, please read our contributing guidelines at

https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution

We recommend creating a *draft* PR, so that you can mark it as 'ready
for review' when you are done.
-->

## Purpose
_Describe the problem you want to address or the feature you want to
implement._

## Approach
_Describe how your changes address the issue or implement the desired
functionality in as much detail as possible._

## References
_Provide a link to the existing issue(s), if any._

## Pre-Merge TODO
- [ ] Write tests for your proposed changes
- [ ] Make sure that existing tests do not fail
  • Loading branch information
Aleksey28 authored Aug 22, 2023
1 parent 22d4a57 commit 346caf6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 deletions.
10 changes: 2 additions & 8 deletions test/client/legacy-fixtures/api/click-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@ $(document).ready(function () {
};

const startNext = function () {
if (browserUtils.isIE) {
removeTestElements();
window.setTimeout(start, 30);
}
else
start();
start();
};

const runAsyncTest = function (actions, assertions, timeout) {
Expand Down Expand Up @@ -147,8 +142,7 @@ $(document).ready(function () {
});

QUnit.testDone(function () {
if (!browserUtils.isIE)
removeTestElements();
removeTestElements();

SETTINGS.ENABLE_SOURCE_INDEX = false;
currentErrorType = null;
Expand Down
3 changes: 0 additions & 3 deletions test/client/legacy-fixtures/api/drag-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const correctTestWaitingTime = function (time) {
};

$(document).ready(function () {
// NOTE: remove this after fix IE tests in iFrame
$('body').css('border', '0px');

// NOTE: prevent auto scrolling
if (browserUtils.isSafari && featureDetection.isTouchDevice) {
const $meta = $('<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, shrink-to-fit=no">');
Expand Down
9 changes: 0 additions & 9 deletions test/client/legacy-fixtures/api/press-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const hammerhead = window.getTestCafeModule('hammerhead');
const browserUtils = hammerhead.utils.browser;
const iframeSandbox = hammerhead.sandbox.iframe;

const testCafeCore = window.getTestCafeModule('testCafeCore');
Expand Down Expand Up @@ -231,10 +230,6 @@ $(document).ready(function () {
iframe.contentDocument.body.appendChild(link);
link.focus();

// NOTE: we need setTimeout to wait for focus in IE
return wait(browserUtils.isIE ? 1000 : 0);
})
.then(function () {
equal(domUtils.getActiveElement(), iframe);
equal(domUtils.getActiveElement(iframe.contentDocument), link);

Expand Down Expand Up @@ -286,10 +281,6 @@ $(document).ready(function () {
iframe.contentDocument.body.appendChild(link);
link.focus();

// NOTE: we need setTimeout to wait for focus in IE
return wait(browserUtils.isIE ? 1000 : 0);
})
.then(function () {
equal(domUtils.getActiveElement(), iframe);
equal(domUtils.getActiveElement(iframe.contentDocument), link);

Expand Down
8 changes: 1 addition & 7 deletions test/client/legacy-fixtures/api/select-test/index-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const hammerhead = window.getTestCafeModule('hammerhead');
const browserUtils = hammerhead.utils.browser;
const featureDetection = hammerhead.utils.featureDetection;

const testCafeCore = window.getTestCafeModule('testCafeCore');
Expand All @@ -21,7 +20,7 @@ const initAutomation = testCafeLegacyRunner.get('./init-automation');
initAutomation();

const correctTestWaitingTime = function (time) {
if (featureDetection.isTouchDevice || featureDetection.hasTouchPoints)
if (featureDetection.isTouchDevice)
return time * 2;

return time;
Expand Down Expand Up @@ -214,11 +213,6 @@ $(document).ready(function () {

$('body').css('height', '1500px');

//NOTE: problem with window.top bodyMargin in IE9 if test 'runAll'
//because we can't determine that element is in qunit test iframe
if (browserUtils.isIE9)
$(window.top.document).find('body').css('marginTop', '0px');

//tests
QUnit.testStart(function () {
asyncActionCallback = function () {
Expand Down

0 comments on commit 346caf6

Please sign in to comment.