Collect your recipes in the RecipeJS app online.
- Install NodeJS, which includes the Node Package Manager NPM, by visiting the homepage and clicking on the install button in order to download and install the latest binary for your operating system.
- Install the DVCS (distributed version control system) Git which also has binary packages for all operating systems on its homepage. Learn Git immediately by reading at least the first three chapters of the free online Git Book
Tools local to our app (like the Karma test runner) are automatically included locally when you provision your static server with the npm install
command (see below). But as we'll see it's convenient to install the karma command-line interface globally as well:
npm install -g karma-cli
That way you don't have to execute ./node_modules/karma/bin/karma start
every time you run your tests. You can just do karma
.
And we'll install bower
, another package manager very commonly used in JavaScript projects.
npm install -g bower
And Protractor
npm install -g protractor
webdriver-manager update
Note: Selenium assumes that you have a Java runtime installed.
# Clone repo
git clone https://github.com/victorkane/recipe-js.git
cd recipe-js/
# Provision static server and development dependencies
export NODE_ENV=development
npm install
bower install
# [For versions that have a gulpfile and are not running on a server you can use browser-sync directly with your open browser and the app will come up automatically]
gulp dev-watch
# [For versions that have a gulpfile but are running on a server]
gulp dev
# Run server
node server.js
# Change to a branch lesson locally
git checkout lesson01-01
After checking out branches involving changes to the NodeJS server server.js
(for example, branch lesson04-01 involves changes to the NodeJS server dependencies due to the implementation of the RESTful API), you will need to execute a one-time npm update
to install them so the server will work. If the server is running, stop it, do the npm update
and start it up again with node server.js
.
# Install testing dependencies locally and start karma
karma start
In one terminal we start selenium:
webdriver-manager start
In another terminal we run the e2e tests:
protractor test/e2e/protractor.conf.js