sobota, 9 listopada 2013

AngularJS example MotoAds end-to-end tests

E2E (end-to-end) tests result: Application folders tree:
In previous post I showed how to write and run unit tests. Now, I will present how to test DOM manipulation or the wiring of our application. Angular Scenario Runner which simulates user interactions that will help us to do that.

Recall adverts.html code which we should know to simulate user interaction:
We should write the simple html page for running unit tests (runner.html):
When everything is ready we can start writing tests in scenarios.js.

Step 1
Navigate web browser to index.html which route to adverts.html view:
Step 2
We write first E2E test - filtering by brand and model on real data:
Step 3
We write second E2E test - filtering by country and region:
Step 4
We write third E2E test - filtering by year:
Step 5
We write fourth E2E test - sorting by year:
Step 6
We run E2E test by typing in web browser URL http://localhost:8000/test/e2e/runner.html (motoAds application must be run on the web server). In web browser we should see the same as the screenshot E2E (end-to-end) tests result.

If you want to run this example on your computer, you can download sources from GitHub.

Any comment would be highly appreciated.

Brak komentarzy: