Single-page application for services directory page (Do it online). This page is used on Do it online page and in service centre kiosks. So, it is important to keep this in mind when testing and developing.
This project assumes that you have node.js installed and the Bower along with the Grunt.js CLI also installed. For more information about these two requirements, visit Getting started.
If you encounter any errors in setting up node, grunt or bower, try the following: Uninstall node.js and reinstall with the [latest version] (http://nodejs.org/). Run through the getting Grunt Getting started guide again.
Navigate to your repo in the Command Prompt or Terminal and run the npm install command. This will download all the necessary npm modules and then follow with downloading the bower components.
Then, in Finder (OSX) or Explorer (Win) navigate to your repo and into the cmd folder. Then, double-click the developmet.scpt (OSX) or developmet.cmd (Win) file. This will open up a command line interface and kick-off the server where you will do most of your development.
This server will do an automatic refresh in your default browser if all the linting checks pass. It is a very handy way to develop apps. Alternatively, you can just run the grunt serve command and it will also start up the server for development.
With the development server running, watch tasks are instantiated. This means that changes you make to the HTML, SASS and Javascript files are automatically detected and the checking and compilation process are run. The process of watching and compiling will rapidly increase development times and improve code consistency as well.
Once you are happy with the application and want to deploy some development files for checking, simply run the grunt build:stage task. This will compile all the files in a state that is ready to be deployed to a server for user testing.
Files need to be distributed to a series of locations in teamsite for staging.
assets/script/appsis to be sent to main/www.qld.gov.au/WORKAREA/assets/assets/script/appsassets/servicesis to be sent to main/www.qld.gov.au/WORKAREA/assets/assets/script/appsservices/is to be sent to main/www.qld.gov.au/core/WORKAREA/content/services
These files are then to be submitted to 'UAT (qld-uat.ssq.qld.gov.au) - NO STAGING (Amazon)'
To build files for production, run the grunt build:dist task. This will compile and minify the files so you can deploy them to a production server.
To date, only end-to-end testing has been added to the build. This is conducted with Webdriver and Protractor and is based on the principles of Behaviour-Driven Development and Test-Driven Development. You can read more about that in this article, Testing Your JavaScript with Jasmine. The syntax for Webdriver is very similar to Jasmine, so it is worth doing some further investigation into the concepts and methods for this framework.
Before you start writing and executing exceptions for tests, you need to run the grunt webdriver task. This will update the binaries required to run Webdriver in your repo. If you ever clone a new repo, you will have to repeat this step.
To get started with your development and testing in parallel, in Finder (OSX) or Explorer (Win) navigate to your repo and into the cmd folder. Then, double-click the testing.scpt (OSX) or testing.cmd (Win) file.
Running can be done by running grunt testing:mac (OSX) or grunt testing:win (Win). If you want to use BrowserStack, simply run grunt testing:browserstack. This can have issues with timeouts, etc so just keep trying until the connection is stable and all the tests pass. To ensure your tests pass, make sure you have run grunt serve in your development cmd window so your page has actually been compiled and rendered.
To edit or create tests, add or update files under the test/e2e folder.
You may want to update your npm modules at some stage. To do so, use the following steps in the command line interface:
npm install -g npm-check-updatesnpm-check-updates -unpm install
This will ensure you are using the most up-to-date versions.

