- Clone repo
git clone git@github.com:UN-OCHA/hid_app2.git
- In the app directory
cd hid_app2
- Switch to the dev branch
git checkout dev
- Install node modules with yarn
yarn install
- Add the local url to your hosts file:
on Mac:
sudo vi /etc/hosts
Add127.0.0.1 app.hid.vm
- Run the Grunt tasks
grunt
(Note to set you local environment to use the staging api usegrunt --target="dev"
)
docker-compose up
- visit https://app.hid.vm and accept the SSL certificate exception
See https://github.com/UN-OCHA/hid-stack/blob/master/README.md
This project aims to follow the John Papa Angular 1 style guide
Unit tests are written using Jasmine and run with Karma.
Install Karma CLI
npm install -g karma-cli
Single run: grunt test
Watch for changes an re-run tests: grunt test-watch
Protractor:
npm install -g protractor
webdriver-manager
webdriver-manager update
Java Development Kit (JDK) http://www.oracle.com/technetwork/java/javase/downloads/index.html
You will need to add the environment variables to run the tests locally.
- Ask Ops to share 'HID E2E test environment vars' with you on LastPass.
- Rename e2e-tests/enviroment.example.js to environment.js
- Replace the file's content with the variables from LastPass
npm run protractor
Running a single test suite
protractor --suite="my-suite-name" src/e2e-tests/conf.js
The tests are prone to random failures on Travis. If this happens:
- manually check on staging to see if you can recreate the problem
- if you can, fix your code!
- if you can't, try re-running the tests in Travis and if possible alter the failing test to make it more robust
If the tests fail you may need to log in and reset some things required for the tests manually.
As Test E2E User:
- Unfavourite 'E2e test list - standard'
- Delete 'E2e temp list'
As Test Admin E2E User:
- Delete 'E2e temp mailchimp service' and 'E2e temp google service'
- Delete 'E2e temp' user
- Un-verify 'Test E2E user'
- Cancel pending connection with 'Test E2E user'
The styleguide and pattern library is available at https://un-ocha.github.io/styleguide/hid/
This project uses Sass
Run grunt watch
to watch for changes and rebuild the css.
Global styles, such as resets and grid styles, should be added to app/common
.
Any _*.scss file in app/common
(excluding sub-directories) will be automatically added to the CSS build.
As variables and mixins need to be imported before other Sass these are added to sub-directories in app/common
and manually imported into app/common/_setup.scss
Component specific files should be added to that component's directory, e.g. app/components/my-component/my-component.scss
.
Any _*.scss file in app/components
(including sub-directories) will be automatically added to the CSS build.