This repo defines the automated tests suites for UofC. The git url is: https://github.com/webxmedia-ca/UofC
Run npm install
to install the packages (assuming the package.json
exists).
Optionally, you can run npm update
to update your npm packages if required.
- the tests can be run by using an
npm run
command within the scripts section of package.json - the usage is
npm run <script name> -- --env=### --appName=*** --browserStack=????
- where
###
can bedev
,tst
,preprd
orprd
- where
***
can beucLaw
or something else available within the*.config.json
file >appsUrls
section - where
###
can betrue
orfalse
- where
For e.g. to run the 'create pages' script in TST we'd use next:
- to run the test locally in chrome:
npm run testName -- --env=tst --appName=ucLaw --browserStack=false
npm run testName -- --env=tst --appName=ucLaw --browserClient=chrome --browserStack=false
- to run the test on BrowserStack using the
*.config.json
file'sbrowserStack
parameters as environment's settings:npm run generic:ValidateInternalMenuAsSiteAdmin -- --env=tst --appName=ucLaw --browserStack=true
npm run testName -- --env=tst --appName=ucLaw --browserStack=true --browserStackArgs=Windows,7,Chrome,70.0,1024x768
-
npm run testName
- usage:
npm run generic:ValidateInternalMenuAsSiteAdmin
- required, this is the npm command to run the test, required the test name as well
- usage:
-
--env
- usage:
--env=tst
- required, this tells the framework in what environment the test should be run
- only 3 options are available:
tst
,preprd
&prd
- if needed to be changed, then the
tst.config.json
,preprd.config.json
&prd.config.json
files need to be renamed to something else, e,g.:newValue.config.json
> now the usage becomes--env=newValue
- usage:
-
--appName
- usage:
--appName=ucLaw
- required, tells the framework what the application's url is
- usage:
-
--browserClient
- usage:
--browserClient=chrome
- optional, see the first and second example above
- when this is not declare the default browser is set to chrome
- thw 'chrome' parameter in the example above was used because the framework handles chrome driver only
- IE or FF was not implemented because all the tests are meant to be run on BrowserStack
- can be extended to handle other browsers but not needed for now (will have use the
browserClient
argument when extended)
- usage:
-
--browserStack
- usage:
--browserStack=true
- required, can be true or false
- will run the tests in BrowserStack or locally (locally in chrome - as default)
- usage:
-
--browserStackArgs
- usage:
--browserStackArgs=Windows,7,Chrome,70.0,1024x768
- optional, see the 2nd & 3rd examples above
- when this argument is not declared then the used defaults are located in the
*.config.json
file
- usage:
-
--username
&--password
- used if you want to run as a non-default user
######NOTES: for more details about the command line arguments please see package.json
("scripts": section) & harness.js
files
There are 3 grunt tasks in this repo:
grunt
: runs a line of code count and jshintgrunt jshint
: runs jshint alone.grunt deploy
: runs sloc, jshint and deploys to git while incrementing the semantic versioning number