Testing Web Applications Using DRT

I am trying to use DRT to run acceptance tests.

Since this is an acceptance test, I need to change the location to open the tested page. But of course, after I did this, my test script disappeared.

I tried to use iFrames as a workaround, but Dart does not provide any means to get the contents of the iFrame. This means that you can load the tested page in an iframe, but you cannot get its html.

I checked all DRT tests in the Dart repository: http://code.google.com/p/dart/source/browse/#svn%2Fbranches%2Fbleeding_edge%2Fdart%2Ftests%2Fhtml

but it seems that not one of them changes location.

Can I use DRT to run acceptance tests? Is there a workaround that I haven't thought about?

+1
source share
1 answer

We did not come up with a good trick (redirect or iframes) to download the application when it is written, and run the test code on top of it. Instead, you can copy the entry point into the application and include the test code there, and then run the modified application directly in DRT.

Here is an example from the web-ui codebase test that does this. This test launches the TodoMVC application and interacts with it:

https://github.com/dart-lang/web-ui/blob/master/test/data/input/todomvc_listorder_test.html

All we did was copy the html source application, add the tag 'testing.js' script and replace the dart script tag with the test code. It would be possible to create a script that automates what we do manually today, but we did not.

+2
source

Source: https://habr.com/ru/post/1486001/


All Articles