[arquillian-issues] [JBoss JIRA] (ARQGRA-331) Graphene guards does not work when page stores reference to XMLHttpRequest before Graphene rewrites them

Lukáš Fryč (JIRA) jira-events at lists.jboss.org
Tue Sep 3 11:06:03 EDT 2013


    [ https://issues.jboss.org/browse/ARQGRA-331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801217#comment-12801217 ] 

Lukáš Fryč commented on ARQGRA-331:
-----------------------------------

The problem is that {{angular.js}} stores a reference to {{XMLHttpRequest}} object when script is loaded:
https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js#L1

When Graphene rewrites an global {{XMLHttpRequest}} object, it's too late in the process.

----

A solution would be rewriting XHR reference earlier in the process, e.g. there is an idea to drive Graphene's requests through proxy, so that we can change the page source, injecting whatever scripts needed before any other script can touch the page.
                
> Graphene guards does not work when page stores reference to XMLHttpRequest before Graphene rewrites them
> --------------------------------------------------------------------------------------------------------
>
>                 Key: ARQGRA-331
>                 URL: https://issues.jboss.org/browse/ARQGRA-331
>             Project: Arquillian Graphene
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.0.Alpha4
>            Reporter: Oliver Kišš
>            Assignee: Lukáš Fryč
>             Fix For: 2.0.0.Alpha5
>
>
> Graphene guards do not work correctly in the [AngularJS Kitchensink quickstart|https://github.com/jboss-jdf/jboss-as-quickstart/tree/master/kitchensink-angularjs].
> The registration form sends a XHR POST request on submit, but this is not recognized and clicking on the submit button with {{guardAjax(registerButton).click()}} throws an exception: "{{RequestGuardException: Request type 'XHR' was expected, but type 'NONE' was done instead}}".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the arquillian-issues mailing list