From 295a13928e12a7309ba416faaa0fa8eeabf65ea7 Mon Sep 17 00:00:00 2001 From: "alexey.kamaev" Date: Fri, 19 Oct 2018 16:55:04 +0300 Subject: [PATCH] fix test --- .../fixtures/automation/regression-test.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/client/fixtures/automation/regression-test.js b/test/client/fixtures/automation/regression-test.js index a41412c6db4..db69d0d5b6e 100644 --- a/test/client/fixtures/automation/regression-test.js +++ b/test/client/fixtures/automation/regression-test.js @@ -339,33 +339,31 @@ $(document).ready(function () { }); }); - asyncTest('B237672 - TesCafe throw exception "Access is denied" after trying to get content of iframe in IE browsers', function () { - let clicked = false; + asyncTest('B237672 - TesCafe does not throw exception "Access is denied" after trying to get content of iframe', function () { + let result = false; const $iframe = $('') .width(500) .height(500) .attr('src', 'http://www.cross.domain.com') - .addClass(TEST_ELEMENT_CLASS) - .click(function () { - clicked = true; - }); + .addClass(TEST_ELEMENT_CLASS); window.QUnitGlobals.waitForIframe($iframe[0]).then(function () { try { - //NOTE: for not ie const iframeBody = $iframe[0].contentWindow.document; nativeMethods.addEventListener.call(iframeBody, 'click', function () { - clicked = true; + throw new Error(); }); + + result = true; } catch (e) { - // do nothing + result = false; } runClickAutomation($iframe[0], {}, function () { - ok(clicked, 'click was raised'); + ok(result); startNext(); }); });