Skip to content

Commit 22d4a57

Browse files
authored
refactor: removed IE leftovers from test\client\legacy-fixtures (#7963)
<!-- 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
1 parent 24055ed commit 22d4a57

File tree

4 files changed

+10
-70
lines changed

4 files changed

+10
-70
lines changed

test/client/legacy-fixtures/api-actions-content-editable-test/index-test.js

+6-18
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,8 @@ $(document).ready(function () {
226226
actionsAPI.select($el[0], -11);
227227
},
228228
function () {
229-
if (browserUtils.isIE)
230-
checkSelection($el, $el[0].childNodes[0], 12, $el[0].childNodes[2], 8);
231-
else {
232-
checkSelection($el, $el[0].childNodes[2], [8, 7], $el[0].childNodes[0], 12);
233-
equal(textSelection.hasInverseSelection($el[0]), true, 'selection direction correct');
234-
}
229+
checkSelection($el, $el[0].childNodes[2], [8, 7], $el[0].childNodes[0], 12);
230+
equal(textSelection.hasInverseSelection($el[0]), true, 'selection direction correct');
235231
},
236232
correctTestWaitingTime(TEST_COMPLETE_WAITING_TIMEOUT)
237233
);
@@ -372,12 +368,8 @@ $(document).ready(function () {
372368
actionsAPI.select(node, el);
373369
},
374370
function () {
375-
if (browserUtils.isIE)
376-
checkSelection($parent, $parent[0].childNodes[1].childNodes[0], 0, $parent[0].childNodes[8], 13);
377-
else {
378-
checkSelection($parent, $parent[0].childNodes[8], [13, 9], $parent[0].childNodes[1].childNodes[0], 0);
379-
equal(textSelection.hasInverseSelection($parent[0]), true, 'selection direction correct');
380-
}
371+
checkSelection($parent, $parent[0].childNodes[8], [13, 9], $parent[0].childNodes[1].childNodes[0], 0);
372+
equal(textSelection.hasInverseSelection($parent[0]), true, 'selection direction correct');
381373
},
382374
correctTestWaitingTime(TEST_COMPLETE_WAITING_TIMEOUT)
383375
);
@@ -440,12 +432,8 @@ $(document).ready(function () {
440432
actionsAPI.select($el1, $el2);
441433
},
442434
function () {
443-
if (browserUtils.isIE)
444-
checkSelection($parent, $parent.find('del')[0].childNodes[0], 0, $parent.find('a')[1].childNodes[0], 4);
445-
else {
446-
checkSelection($parent, $parent.find('a')[1].childNodes[0], 4, $parent.find('del')[0].childNodes[0], [0, 9]);
447-
equal(textSelection.hasInverseSelection($parent[0]), true, 'selection direction correct');
448-
}
435+
checkSelection($parent, $parent.find('a')[1].childNodes[0], 4, $parent.find('del')[0].childNodes[0], [0, 9]);
436+
equal(textSelection.hasInverseSelection($parent[0]), true, 'selection direction correct');
449437
},
450438
correctTestWaitingTime(TEST_COMPLETE_WAITING_TIMEOUT)
451439
);

test/client/legacy-fixtures/regression-test.js

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const hammerhead = window.getTestCafeModule('hammerhead');
2-
const browserUtils = hammerhead.utils.browser;
31

42
const testCafeLegacyRunner = window.getTestCafeModule('testCafeLegacyRunner');
53
const getAutomations = testCafeLegacyRunner.get('./automation-storage').getAutomations;
@@ -22,18 +20,8 @@ $(document).ready(function () {
2220

2321
$(body).css('height', 1500);
2422

25-
//NOTE: problem with window.top bodyMargin in IE9 if test 'runAll'
26-
//because we can't determine that element is in qunit test iframe
27-
if (browserUtils.isIE9)
28-
$(window.top.document).find('body').css('marginTop', '0px');
29-
3023
const startNext = function () {
31-
if (browserUtils.isIE) {
32-
removeTestElements();
33-
window.setTimeout(start, 30);
34-
}
35-
else
36-
start();
24+
start();
3725
};
3826

3927
const removeTestElements = function () {
@@ -64,8 +52,7 @@ $(document).ready(function () {
6452
};
6553

6654
QUnit.testDone(function () {
67-
if (!browserUtils.isIE)
68-
removeTestElements();
55+
removeTestElements();
6956
});
7057

7158
module('regression tests');

test/client/legacy-fixtures/runner-test.js

-28
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
const hammerhead = window.getTestCafeModule('hammerhead');
2-
const hhsettings = hammerhead.settings.get();
3-
41
const testCafeLegacyRunner = window.getTestCafeModule('testCafeLegacyRunner');
5-
const COMMAND = testCafeLegacyRunner.get('../test-run/command');
62
const Runner = testCafeLegacyRunner.get('./runner');
73
const transport = testCafeLegacyRunner.get('./transport');
84
const StepIterator = testCafeLegacyRunner.get('./step-iterator');
@@ -50,30 +46,6 @@ QUnit.testDone(function () {
5046

5147
module('Regression');
5248

53-
asyncTest('T204773 - TestCafe - The assertion in last step with inIFrame wrapper works incorrect in IE browser', function () {
54-
hhsettings.serviceMsgUrl = '/ping/500';
55-
56-
let assertionFailedMessageTime = null;
57-
58-
transport.asyncServiceMsg = function (msg) {
59-
if (msg.cmd === COMMAND.assertionFailed)
60-
assertionFailedMessageTime = Date.now();
61-
62-
if (msg.cmd === COMMAND.done)
63-
ok(Date.now() - assertionFailedMessageTime >= 500);
64-
65-
savedAsyncServiceMsg.apply(transport, arguments);
66-
};
67-
68-
testRunner._onAssertionFailed({ err: { message: 'err' } });
69-
70-
testRunner._onTestComplete({
71-
callback: function () {
72-
start();
73-
},
74-
});
75-
});
76-
7749
asyncTest('Test iterator should not call Transport.fail twice (without screenshots)', function () {
7850
let transportFailCount = 0;
7951

test/client/legacy-fixtures/select-element-test.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const hammerhead = window.getTestCafeModule('hammerhead');
2-
const browserUtils = hammerhead.utils.browser;
32
const featureDetection = hammerhead.utils.featureDetection;
43

54
const testCafeLegacyRunner = window.getTestCafeModule('testCafeLegacyRunner');
@@ -75,21 +74,15 @@ $(document).ready(function () {
7574
$('body').css('height', 1500);
7675

7776
const startNext = function () {
78-
if (browserUtils.isIE) {
79-
removeTestElements();
80-
window.setTimeout(start, 30);
81-
}
82-
else
83-
start();
77+
start();
8478
};
8579

8680
const removeTestElements = function () {
8781
$('.' + TEST_ELEMENT_CLASS).remove();
8882
};
8983

9084
QUnit.testDone(function () {
91-
if (!browserUtils.isIE)
92-
removeTestElements();
85+
removeTestElements();
9386

9487
SETTINGS.ENABLE_SOURCE_INDEX = false;
9588
});

0 commit comments

Comments
 (0)