bitovi / bitovi/funcunit

Dynamic iframes are considered not loaded

Open
#139 1 comment 0 reactions 0 assignees View on GitHub
bug help wanted p2
Dominant language
JavaScript
Stars
571
Forks
370
PR merge metrics
No merged PRs in 30d

Description

If I create an ``, populate it dynamically, and set it as the context for FuncUnit like this:

```
var iframe = $(document.createElement('iframe'));
iframe.contents().find('body').append(frag);
F.open(win);
```

All tests will fail because `FuncUnit.documentLoaded()` will return `false` here: https://github.com/bitovi/funcunit/blob/01f767b1e95737a7dfcae1f67a75b4d72408ba37/browser/getters.js#L509

Due to the fact that `FuncUnit.win.location.href === 'about:blank'` here: https://github.com/bitovi/funcunit/blob/92fd4b283388576922506fb76096902c8f9183bf/browser/open.js#L258-L260

To get around this I had to overwrite `FuncUnit.documentLoaded` to always return true like this:

```
F.documentLoaded = function () { return true; };
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with FuncUnit.documentLoaded() in browser/getters.js and the iframe handling in browser/open.js, especially the about:blank location check. Reproduce the dynamic iframe setup from the issue and trace why F.open(win) leaves the document unloaded; done means dynamically populated iframes are recognized as loaded without overriding documentLoaded().

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.