AngularJS client for DeviceHub.
NodeJS >=9.10 (recommended 10.16.1) with npm required.
git clone https://github.com/eReuse/DeviceHubClient.git
npm install
. This installs
both npm and bower dependencies.
# DeviceHub
cd ../../
rm -rf node_modules && npm install
DH_ENV
environment variable to select desired
environment to build the package). After a while it generates an inner
folder called dist
containing the built website.
# DeviceHub
rm -rf dist; export DH_ENV=e4; npm run-script build-prod
Execute npm run-script build
for auto-building when there
are changes in code, and npm run-script build-prod
for building
a compressed version of the website suitable to use in production
environments. build-dev
and build
generate sourcemaps.
To run the unit tests, execute npm run-script test
. This will run the tests once. You can
keep a daemon open which will re-run the tests once it detects a change in the code. For that
execute node ./node_modules/gulp/bin/gulp.js unit-test
.
To run the E2E tests you will require access to a DeviceHub, so your DeviceHubClient will need to be configured to connect to a DeviceHub. Moreover, this DeviceHub will need to have populated the database with the dummy values.
node ./node_modules/gulp/bin/gulp.js run-selenium
. This will install and run
Selenium, which is a server specialized in E2E tests.node ./node_modules/protractor/bin/protractor protractor.conf.js
in another terminal.
This will open a Chrome window and run the tests there. I recommend not putting something
above the Chrome window or minimizing it, as it can break the tests.Note that you can ease the execution of the tests using a good IDE, like WebStorm. See how to configure Protractor and Gulp in WebStorm.