You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing a script added to the page to check if this script impacts the browser's functions.
That script that does asynchronous things, and I need to wait for the script to happen before the tests are run.
The problem is that the tests run before the script has completely finished running.
Is there any way to wait for this script to run completely before running the tests?
The solution must be dynamic to work on multiple WPT pages, how can I do it? Is it possible?
Here it is an example:
<!doctype html>
<meta charset=utf-8>
<title></title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id="testDiv" onclick="result1 = remove; result2 = this.remove;"></div>
<script src="MYSCRIPTHERE.js"></script>
<script>
var result1;
var result2;
var unscopables = [
"before",
"after",
"replaceWith",
"remove",
"prepend",
"append"
];
for (var i in unscopables) {
var name = unscopables[i];
window[name] = "Hello there";
result1 = result2 = undefined;
test(function () {
assert_true(Element.prototype[Symbol.unscopables][name]);
var div = document.querySelector('#testDiv');
div.setAttribute(
"onclick", "result1 = " + name + "; result2 = this." + name + ";");
div.dispatchEvent(new Event("click"));
assert_equals(typeof result1, "string");
assert_equals(typeof result2, "function");
}, name + "() should be unscopable");
}
</script>
Thanks! 😄
The text was updated successfully, but these errors were encountered:
I’m interested in contributing to this issue and would like to take it up. Could you please assign it to me? I’m eager to work on it and submit a PR soon.
Uh oh!
There was an error while loading. Please reload this page.
Hey,
I'm testing a script added to the page to check if this script impacts the browser's functions.
That script that does asynchronous things, and I need to wait for the script to happen before the tests are run.
The problem is that the tests run before the script has completely finished running.
Is there any way to wait for this script to run completely before running the tests?
The solution must be dynamic to work on multiple WPT pages, how can I do it? Is it possible?
Here it is an example:
Thanks! 😄
The text was updated successfully, but these errors were encountered: