The (in)complete workshop for picking up Protractor - end to end testing for AngularJs
- Follow the install instructions.
- Work through the trainging materials
- Remove old version of Typescript (only applies to machines with Visual Studio installed)
- Browse to folder: C:\Program Files (x86)\Microsoft SDKs\TypeScript
- Delete any folder with a version number < 2.0 (eg 1.0)
- Install global tooling:
- git
- git --version
- JDK
- java -version
- Keep in mind The new installation takes effect in each new command window.
- nodejs and npm
- node --version
- Visual Studio Code
- git
- fork this repo
- clone the forked repo locally
- open a cmd prompt with the current directory set to the locally cloned directory
at this command prompt install project locally:
npm run update-webdriver
- installs both npm modules and any referenced typescript definition files
The tests run against an Angular application. To start the Angular application run the following command
npm run server
Compile typescript and run tests from the command prompt
npm start
- runs the
tsc
tool using the options defined in thetsconfig.json
tsc
is configured to watch for changes to your typescript files and recompile them- runs the tests
Run tests only
npm test
Compile typescript only
npm run tsc
Compile typescript when files change
tsc run tsc:w
Compiling
The task runner has been configured to run the typescript compiler using the shortcut keys:
CTLR+SHIFT+B
This is equivalent as running tsc
at the command line
Debugging
VSC has been configured to debug the javascript files. Press the shortcut key: F5
However, you will find that before you can debug the code you will need to ensure that typescript file compiles into the javascript files. To do this:
- Compile the code (tip:
CTLR+SHIFT+B
)