![]() You should see Selenium start and a browser window will pop up allowing you to see all the tests running. Now you are ready to run your tests! Run grunt e2e-test in your command line. Register a new grunt task that connects to the server and runs protractor. Grunt.loadNpmTasks('grunt-contrib-connect') set the location of the application files To configure the connect task, give a port number and hostname. Npm install grunt-contrib-connect -save-dev In the example project, we are connecting to a server at pointing Selenium to this location. If you have not set up a server, you can use the grunt-contrib-connect plugin to start a running web server. If you already have a web server, you do not need to install this plugin-though it can be helpful for local development and you will not have the additional step of starting your server. }} OPTIONAL: SET UP A WEB SERVER WITH GRUNT-CONTRIB-CONNECTĪs I mentioned in the previous post, your app needs to be running on some sort of web server where Selenium can point to run tests against. Additional arguments that are passed to the webdriver command Set to true if you would like to use the Protractor command line debugging tool ![]() Do you want the output to use fun colors? ![]() Location of your protractor config file I explain how to set up grunt-watch in the next section. Another called continuous will be used with grunt-watch to keep the build alive and re-run tests when changes are made. One target called e2e will stop the build if a test fails. Npm install grunt-protractor-runner -save-devĬonfigure this plugin in your Gruntfile.js. Also install the grunt-protractor-runner plugin. To run your E2E tests with Grunt, you will need to have Grunt installed. In this final post, I will explain how to set up Grunt and Protractor to execute your E2E tests as part of a build process.īe sure to check out the example app for a full, working implementation. Part Four: Configure Protractor to run your end-to-end (E2E) tests. Parts One, Two, and Three: Configure Karma for unit testing and automate the execution of the unit tests using Grunt as part of a build process. Here’s a quick summary of the ground we have covered: This is the final post in my series about testing AngularJS apps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |