This project acts as a container for all individual uqlibrary applications.
The current master build can be viewed here.
Run these commands in your Terminal to get a local server working.
npm install -g bower gulp-cli nightwatch web-component-tester
npm install
bower install
-
Follow the Polymer style guide-lines
-
Run
gulp serve
to run a local environment -
Refer to directions here for post-dev steps to make sure that changes from child components make it to this repo.
-
IMPORTANT! Before each change, update our saucelab operating system versions for nightwatch and wct by using the saucelabs configurator so we are testing against recent versions (browser versions are mostly automatic). Also check the latest ESR version for firefox (Browser versions are mostly automatic). (ESR versions are deployed in our Standard Environment across the Libraries).
- Follow requirements from uqlibrary-pages
- Clone uqlibrary-starter-kit
- Make sure the element contains the paper-toolbar
- Make sure the element has a "standAlone" attribute and a "_toggleDrawerPanel" function
- When the App is ready, tag a release, eg
git tag -a v1.0.0 -m 'First release'
- In uqlibrary-mylibrary, bower install the element (eg.
bower install uqlibrary/uqlibrary-starter-kit#v1.0.0
)- (Note that
bower_components subfolders
are no longer used and bower components are build into the parent directory, above each project)
- (Note that
- Add the element in
app/elements/elements.html
- Add a section containing the element in
app/index.html
- Add a menu item in uqlibrary-api (applications HTML)
- Add a route via PageJS in
app/elements/routing.html
Obviously, update bower to include your changes:
bower update
To get the complete test package, run the test setup script:
./bin/test-setup.sh
(This will produce a long set of dated 'starting' and 'finishing' lines.)
gulp test:local
(You should see over 50 tests run and 1 or 2 minutes of run time - a fast response time means no tests were run)
cp wct.conf.js.default wct.conf.js
gulp test:remote
When you run this command, you may get the error:
"Missing Sauce credentials. Did you forget to set SAUCE_USERNAME and/or SAUCE_ACCESS_KEY?"
To set these fields:
-
Note the values for SAUCE_USERNAME and for SAUCE_ACCESS_KEY
-
export these as local variables on your box, eq:
$ export SAUCE_ACCESS_KEY='XXX'
then run the gulp test:remote
command again
Nightwatch is also run on Codeship for deployment testing. No gulp interface provided.
You can also run them locally:
- Run Selenium server. Selenium is required to run tests locally Selenium Installer
java -jar selenium-server-standalone-{VERSION}.jar
or brew install selenium-server-standalone
then selenium-server -port 4444
- start server (will start server and project will be accessible at http://localhost:5001)
gulp serve:dist
- start testing
cd bin/local
./nightwatch.js
(You will need to use more than one tab as gulp serve continues running.)
You can also restrict to one browser:
./nightwatch.js --env chrome
- Add dev-app.library.uq.edu.au to your /etc/hosts or equivalent file
- Comment out the cookies which control mock data in demo.html (or create a new file)
- Run the gulp task
gulp demo
- If you still have the mock cookies in your browser, delete them via your browser.
- Use the Masquerading function at https://www.library.uq.edu.au/mylibrary/ to masquerade as another user to view library as this user
- Return to your demo page and you should be getting live data.
- Make sure MyLibrary functions properly when using
gulp serve:dist
- Before committing to master, run
gulp test
- Any commits to master are automatically deployed to app.library
- To deploy a feature branch create a deployment pipe line in codeship, feature branch will be deployed to:
https://app.library.uq.edu.au/[feature branch]/mylibrary/index.html
- Any commits to production will go live on the main UQ Library website (http://www.library.uq.edu.au/mylibrary)
- The canarytest branch is used in a weekly job started from AWS as repo-periodic-test-mylibrary in Scheduled Tasks that checks that our sites work in future browsers. See
bin/codeship-test.sh
- Scheduled Tasks: in Amazon, go to ECS > Clusters > Default > Scheduled Tasks tab which may be here and note task
repo-periodic-test-mylibrary
. - This can be run manually from the Tasks tab - (put in repo-periodic-test-mylibrary as the Name and I think you have to click open Advanced Options so you can add the same extra parameter as the scheduled task?)
Setup Commands:
jdk_switcher use oraclejdk8
chmod a+x -R bin/*
bin/codeship-setup.sh
bin/test-setup.sh
3 Test Pipelines:
Unit tests:
export PIPE_NUM=1
bin/codeship-testing.sh
Test Commands:
export PIPE_NUM=3
bin/codeship-testing.sh
Nightwatch:
export PIPE_NUM=2
bin/codeship-testing.sh