E2E testing an application with iframes

894 views
Skip to first unread message

Scott Mathson

unread,
Mar 14, 2013, 9:54:47 PM3/14/13
to ang...@googlegroups.com
I'm trying to do E2E testing on an application that is made up of multiple iframes, each with it's own Angular application. The different applications communicate with each other through a custom event bridge that we've written and there are certain scenarios that we'd like to be able to test that require interaction between the applications, so we can't just E2E test each application independently from the others.

AFAIK, there isn't a way to write a selector by itself to drill down into a specific iframe (something like 'iframe#pane1 input.email'), and so the way of doing this with jQuery is: $(iframe#pane1).contents().find('input.email). I was thinking about trying to add a custom dsl statement to ngScenario that works like using() to scope any chained selectors to a specific iframe (something like useframe('pane1').input('email') ), but I'm having trouble figuring out how I'd write that as another angular.scenario.dsl statement. Any ideas?

Has anyone successfully been able to do something like this with angular's E2E tests?

Elliott Sprehn

unread,
Mar 21, 2013, 2:24:30 PM3/21/13
to ang...@googlegroups.com
I don't think this is going to work because the scenario runner is waiting for Angular to tell it that the current $digest cycle and pending XHRs are complete before going to the next step, but your apps are in iframes so the runner wouldn't wait at all since it can't see into the frames.

You'd need some deeper changes in the runner to make it work.


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ramesh Kumar

unread,
Feb 5, 2014, 1:27:33 AM2/5/14
to ang...@googlegroups.com
Hello Scott Mathson
I had a same problem. Do you found the solution for the above issue ?

Scott Mathson

unread,
Feb 6, 2014, 2:23:27 PM2/6/14
to ang...@googlegroups.com
Hi Ramesh,

No, we never did. As Elliott pointed out, the way the scenario runner works will prohibit this from being possible. We are currently just testing each frame in isolation.

We plan on following the Angular team's lead and moving to Protractor (https://github.com/angular/protractor/) for our E2E tests in the near future and we'll re-evaluate the possibility of writing tests at the top level and drilling into specific iframes when we do. Since Protractor is built on top of Webdriver, it looks like this should be possible: http://stackoverflow.com/questions/20425909/protractor-testing-angular-app-in-an-iframe

Hope that helps.


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/rhjH4kTlv48/unsubscribe.

To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.

To post to this group, send email to ang...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Scott Mathson

Ramesh Kumar

unread,
Feb 6, 2014, 11:36:18 PM2/6/14
to ang...@googlegroups.com
Hello Scott Mathson,

ok thanks for information. Yes angular team moving to "Protractor". but I am mid of the generate E2E Testcase with "karma-ng-scenario", New screen Developed with IFrame , I am trying to find the element inside the Iframe .it's notpossible in ng-scenario.

do you have idea to solve this issues ? please share with me

Thanks in advanced
Ramehs kumar


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.

Scott Mathson

unread,
Feb 7, 2014, 4:20:16 PM2/7/14
to ang...@googlegroups.com
Sorry, like you said, it's not possible using ng-scenario. My suggestion would be to move to Protractor if it's important enough for your tests.

Ramesh Kumar

unread,
Feb 9, 2014, 11:35:58 PM2/9/14
to ang...@googlegroups.com
ok thanks
Reply all
Reply to author
Forward
0 new messages