Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKamaev committed Oct 19, 2018
1 parent 596d45f commit 295a139
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions test/client/fixtures/automation/regression-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $('<iframe></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();
});
});
Expand Down

0 comments on commit 295a139

Please sign in to comment.