Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1411 load extrascripts in Classic Test Runner #1411

Conversation

jakub-g
Copy link
Collaborator

@jakub-g jakub-g commented Feb 13, 2015

This PR adds the possibility to load in the Classic Test Runner
the extrascripts exposed in attester's config, when CTR is run
in isolated mode.

Previously, the extrascripts were injected by attester only to CTR's
index page, but CTR had no possibility to propagate those scripts
into the iframe when tests were run with #runIsolated=true in the URL.

This commit needs attester/attester#121
integrated in attester in order for it to properly expose before
and after extrascripts.


The other 2 commits are just minor visual improvements

@jakub-g jakub-g force-pushed the ClassicTestRunner-isolated-extrascripts branch from dc956e5 to 66a9333 Compare February 13, 2015 12:14
jakub-g added a commit to jakub-g/ariatemplates that referenced this pull request Feb 13, 2015
This commit adds the possibility to load in the Classic Test Runner
the extrascripts exposed in attester's config, when CTR is run
in isolated mode.

Previously, the extrascripts were injected by attester only to CTR's
index page, but CTR had no possibility to propagate those scripts
into the iframe when tests were run with `#runIsolated=true` in the URL.

This commit needs attester/attester#121
integrated in attester in order for it to properly expose `before`
and `after` extrascripts.
jakub-g added a commit to jakub-g/ariatemplates that referenced this pull request Feb 13, 2015
…unner

This commit makes an iframe used to run the test in Classic Test Runner
in isolated mode semi-transparent, in order to easily follow the progress
of the test suite, which happens in background.
@jakub-g jakub-g force-pushed the ClassicTestRunner-isolated-extrascripts branch from 3522e5a to 6104aab Compare February 13, 2015 14:32
jakub-g added a commit to jakub-g/ariatemplates that referenced this pull request Feb 13, 2015
…ated mode

This commit adds the possibility to load in the Classic Test Runner
the extrascripts exposed in attester's config, when CTR is run
in isolated mode.

Previously, the extrascripts were injected by attester only to CTR's
index page, but CTR had no possibility to propagate those scripts
into the iframe when tests were run with `#runIsolated=true` in the URL.

This commit needs attester/attester#121
integrated in attester in order for it to properly expose `before`
and `after` extrascripts.
jakub-g added a commit to jakub-g/ariatemplates that referenced this pull request Feb 13, 2015
This commit makes an iframe used to run the test in Classic Test Runner
in isolated mode semi-transparent, in order to easily follow the progress
of the test suite, which happens in background.
jakub-g added a commit to jakub-g/ariatemplates that referenced this pull request Feb 13, 2015
@jakub-g jakub-g force-pushed the ClassicTestRunner-isolated-extrascripts branch from c33bc68 to 862baad Compare March 9, 2015 11:01
@jakub-g
Copy link
Collaborator Author

jakub-g commented Mar 9, 2015

@divdavem I added a new commit removing force and just not storing scripts in array if they don't come from the main document. What do you think about it now?

It's a bit artificial to do it IMO but at least it doesn't break compat.

I don't think it will be useful to store them per each document, I don't think it's really useful at all to do it, it should be developer's responsibility to not load things twice, but let's leave the original behavior for the main document.

_injectExtraScriptsIntoFrame : function (subWindow, whereToInsert, callback) {
var document = Aria.$window.document;
var subDocument = subWindow.document;
var scripts = document.querySelectorAll('script') || document.scripts;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

querySelectorAll is not supported by IE7, whereas document.scripts is not supported by Firefox < 9.
See https://developer.mozilla.org/en-US/docs/Web/API/Document/scripts and https://developer.mozilla.org/en/docs/Web/API/Document/querySelectorAll

I would reverse the order so that the line works in all browsers (including IE7):

var scripts = document.scripts || document.querySelectorAll('script');

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, rather than using querySelectorAll which is generic for all CSS selectors, you should probably use getElementsByTagName.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@jakub-g jakub-g force-pushed the ClassicTestRunner-isolated-extrascripts branch from 862baad to 748b672 Compare March 19, 2015 14:16
jakub-g added a commit to jakub-g/ariatemplates that referenced this pull request Mar 19, 2015
…ated mode

This commit adds the possibility to load in the Classic Test Runner
the extrascripts exposed in attester's config, when CTR is run
in isolated mode.

Previously, the extrascripts were injected by attester only to CTR's
index page, but CTR had no possibility to propagate those scripts
into the iframe when tests were run with `#runIsolated=true` in the URL.

This commit needs attester/attester#121
integrated in attester in order for it to properly expose `before`
and `after` extrascripts.
jakub-g added a commit to jakub-g/ariatemplates that referenced this pull request Mar 19, 2015
This commit makes an iframe used to run the test in Classic Test Runner
in isolated mode semi-transparent, in order to easily follow the progress
of the test suite, which happens in background.
jakub-g added a commit to jakub-g/ariatemplates that referenced this pull request Mar 19, 2015
This commit makes an iframe used to run the test in Classic Test Runner
in isolated mode semi-transparent, in order to easily follow the progress
of the test suite, which happens in background.
…ated mode

This commit adds the possibility to load in the Classic Test Runner
the extrascripts exposed in attester's config, when CTR is run
in isolated mode.

Previously, the extrascripts were injected by attester only to CTR's
index page, but CTR had no possibility to propagate those scripts
into the iframe when tests were run with `#runIsolated=true` in the URL.

This commit needs attester/attester#121
integrated in attester in order for it to properly expose `before`
and `after` extrascripts.
@jakub-g jakub-g force-pushed the ClassicTestRunner-isolated-extrascripts branch from 748b672 to 5a5a780 Compare March 19, 2015 14:18
@jakub-g
Copy link
Collaborator Author

jakub-g commented Mar 19, 2015

@divdavem
I fixed the querySelectorAll issue & rebased (I also reorder the commits)
Build failure is due to MapManagerTest random failure

@divdavem
Copy link
Member

@jakub-g Thank you.
🆗 5a5a780 (and its 4 parent commits) is fine for me.

@jakub-g jakub-g closed this in dffd2ad Mar 20, 2015
jakub-g added a commit that referenced this pull request Mar 20, 2015
This commit adds the possibility to load in the Classic Test Runner
the extrascripts exposed in attester's config, when CTR is run
in isolated mode.

Previously, the extrascripts were injected by attester only to CTR's
index page, but CTR had no possibility to propagate those scripts
into the iframe when tests were run with `#runIsolated=true` in the URL.

This commit needs attester/attester#121
integrated in attester (to be released in attester 2.2.0)
in order for it to properly expose `before` and `after` extrascripts.

Close #1411
@jakub-g jakub-g added this to the 1.7.5 milestone Mar 20, 2015
@jakub-g jakub-g deleted the ClassicTestRunner-isolated-extrascripts branch March 20, 2015 14:47
@jakub-g
Copy link
Collaborator Author

jakub-g commented Mar 20, 2015

@divdavem thank you for the review!

jakub-g added a commit that referenced this pull request May 5, 2015
This commit makes an iframe used to run the test in Classic Test Runner
in isolated mode semi-transparent, in order to easily follow the progress
of the test suite, which happens in background.

(cherry picked from commit dffd2ad)
jakub-g added a commit that referenced this pull request May 5, 2015
jakub-g added a commit that referenced this pull request May 5, 2015
This commit adds the possibility to load in the Classic Test Runner
the extrascripts exposed in attester's config, when CTR is run
in isolated mode.

Previously, the extrascripts were injected by attester only to CTR's
index page, but CTR had no possibility to propagate those scripts
into the iframe when tests were run with `#runIsolated=true` in the URL.

This commit needs attester/attester#121
integrated in attester (to be released in attester 2.2.0)
in order for it to properly expose `before` and `after` extrascripts.

Close #1411

(cherry picked from commit b3ee82d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants