From 5c58735d77224608aba75c28118fcedf9965abd0 Mon Sep 17 00:00:00 2001 From: Popov Aleksey Date: Tue, 22 Aug 2023 17:34:18 +0300 Subject: [PATCH] refactor: removed IE and MS Edge Legacy leftovers from test\client\fixtures (#7960) ## 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 --- test/client/fixtures/core/array-utils-test.js | 11 +++-------- test/client/fixtures/core/dom-utils-test.js | 11 ++--------- .../fixtures/driver/script-execution-barrier-test.js | 6 +----- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/test/client/fixtures/core/array-utils-test.js b/test/client/fixtures/core/array-utils-test.js index 8978f876812..51572d4814c 100644 --- a/test/client/fixtures/core/array-utils-test.js +++ b/test/client/fixtures/core/array-utils-test.js @@ -1,6 +1,3 @@ -const hammerhead = window.getTestCafeModule('hammerhead'); -const browserUtils = hammerhead.utils.browser; - const testCafeCore = window.getTestCafeModule('testCafeCore'); const arrayUtils = testCafeCore.arrayUtils; @@ -139,11 +136,9 @@ test('isArray()', function () { test('from()', function () { deepEqual(arrayUtils.from('foo'), ['f', 'o', 'o']); - if (!browserUtils.isIE) { - deepEqual(arrayUtils.from(array, function (x) { - return x + x; - }), [2, 4, 6, 8, 10]); - } + deepEqual(arrayUtils.from(array, function (x) { + return x + x; + }), [2, 4, 6, 8, 10]); }); test('find()', function () { diff --git a/test/client/fixtures/core/dom-utils-test.js b/test/client/fixtures/core/dom-utils-test.js index 7059f62fde6..17876a8f166 100644 --- a/test/client/fixtures/core/dom-utils-test.js +++ b/test/client/fixtures/core/dom-utils-test.js @@ -1,10 +1,8 @@ -const hammerhead = window.getTestCafeModule('hammerhead'); -const browserUtils = hammerhead.utils.browser; const testCafeCore = window.getTestCafeModule('testCafeCore'); const domUtils = testCafeCore.domUtils; asyncTest('isIFrameWindowInDOM', function () { - expect(browserUtils.isIE ? 2 : 1); + expect(1); let messageCounter = 0; @@ -17,15 +15,10 @@ asyncTest('isIFrameWindowInDOM', function () { if (messageCounter === 0) { equal(event.data, 'true'); - const iFramePostMessage = iframe.contentWindow.postMessage.bind(iframe.contentWindow); - document.body.removeChild(iframe); //NOTE: In WebKit, scripts cannot be executed in a removed iframe. Therefore, the test is finished here. - if (browserUtils.isIE) - iFramePostMessage('isIFrameWindowInDOM', '*'); - else - finishTest(); + finishTest(); } else { equal(event.data, 'false'); diff --git a/test/client/fixtures/driver/script-execution-barrier-test.js b/test/client/fixtures/driver/script-execution-barrier-test.js index cb001bb1ea2..54ace04b274 100644 --- a/test/client/fixtures/driver/script-execution-barrier-test.js +++ b/test/client/fixtures/driver/script-execution-barrier-test.js @@ -87,16 +87,12 @@ $(document).ready(function () { const emitter = new ScriptExecutionEmitter(); const barrier = new ScriptExecutionBarrier(emitter); - let scriptCounter = 0; - window.stopAppending = false; window.appendCustomScript = function () { const script = document.createElement('script'); const scriptContent = encodeURIComponent('if(!window.stopAppending)window.appendCustomScript()'); - // HACK: we should request different URLs to avoid caching of response in IE 10 - script.src = '/xhr-test/' + scriptCounter + '?expectedResponse=' + scriptContent; - scriptCounter++; + script.src = '/xhr-test/50?expectedResponse=' + scriptContent; document.body.appendChild(script); };