mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Add npm scripts for running visual tests
This commit is contained in:
parent
331fdb528d
commit
83b5b09b87
@ -42,21 +42,32 @@ Running Tests
|
|||||||
Run PhantomJS:
|
Run PhantomJS:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
phantomjs --webdriver=4444
|
npm run vi-phantom
|
||||||
```
|
```
|
||||||
|
|
||||||
And then run Gemini tests:
|
And then run Gemini tests:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# In root onion/
|
npm run vi-test
|
||||||
gemini test gemini/* --report html
|
|
||||||
|
# Run only main tests
|
||||||
|
npm run vi-test:main
|
||||||
|
|
||||||
|
# Run only whitelabel tests
|
||||||
|
npm run vi-test:whitelabel
|
||||||
|
|
||||||
|
# Run only specific whitelabel tests
|
||||||
|
npm run vi-test:cyland
|
||||||
```
|
```
|
||||||
|
|
||||||
If you've made changes and want them to be the new baseline (ie. it's a correct change--**make sure** to test there are no regressions first!), use
|
If you've made changes and want them to be the new baseline (ie. it's a correct change--**make sure** to test there are
|
||||||
|
no regressions first!), use
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# In root onion/
|
npm run vi-update
|
||||||
gemini update gemini/*
|
|
||||||
|
# Update just the main app for desktop and mobile
|
||||||
|
npm run vi-update -- --browser MainDesktop --browser MainMobile
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -112,6 +123,8 @@ are available.
|
|||||||
|
|
||||||
Our tests are located in `onion/gemini/`.
|
Our tests are located in `onion/gemini/`.
|
||||||
|
|
||||||
|
**It would be nice if we kept the whitelabels up to date.**
|
||||||
|
|
||||||
Some useful tips:
|
Some useful tips:
|
||||||
* The `find()` method in the callbacks is equivalent to `document.querySelector`; it will only return the first
|
* The `find()` method in the callbacks is equivalent to `document.querySelector`; it will only return the first
|
||||||
element found that matches the selector. Use pseudo classes like `nth-of-type()`, `nth-child()`, and etc. to select
|
element found that matches the selector. Use pseudo classes like `nth-of-type()`, `nth-child()`, and etc. to select
|
||||||
@ -181,3 +194,11 @@ change the environment to run against.
|
|||||||
# In root /onion folder
|
# In root /onion folder
|
||||||
phantomjs phantomjs/launch_app_and_login.js
|
phantomjs phantomjs/launch_app_and_login.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
TODO
|
||||||
|
====
|
||||||
|
|
||||||
|
* Write scripts to automate creation of test users (and modify tests to accomodate)
|
||||||
|
* Set scripts with rootUrls pointing to staging / live using environment variables
|
||||||
|
* Set up with Sauce Labs
|
||||||
|
17
package.json
17
package.json
@ -10,7 +10,20 @@
|
|||||||
"lint": "eslint ./js",
|
"lint": "eslint ./js",
|
||||||
"postinstall": "npm run build",
|
"postinstall": "npm run build",
|
||||||
"build": "gulp build --production",
|
"build": "gulp build --production",
|
||||||
"start": "node server.js"
|
"start": "node server.js",
|
||||||
|
|
||||||
|
"vi-clean": "rm -rf gemini-report",
|
||||||
|
"vi-phantom": "phantomjs --webdriver=4444",
|
||||||
|
"vi-update": "gemini update",
|
||||||
|
"vi-test": "npm run vi-clean && gemini test --reporter html --reporter vflat || true",
|
||||||
|
"vi-test:all": "npm run vi-test",
|
||||||
|
"vi-test:main": "npm run vi-test -- --browser MainDesktop --browser MainMobile",
|
||||||
|
"vi-test:whitelabel": "GEMINI_BROWSERS='CcDesktop, CcMobile, CylandDesktop, CylandMobile, IkonotvDesktop, IkonotvMobile, LumenusDesktop, LumenusMobile, 23viviDesktop, 23viviMobile' npm run vi-test",
|
||||||
|
"vi-test:cc": "npm run vi-test -- --browser CcDesktop --browser CcMobile",
|
||||||
|
"vi-test:cyland": "npm run vi-test -- --browser CylandDesktop --browser CylandMobile",
|
||||||
|
"vi-test:ikonotv": "npm run vi-test -- --browser IkonotvDesktop --browser IkonotvMobile",
|
||||||
|
"vi-test:lumenus": "npm run vi-test -- --browser LumenusDesktop --browser LumenusMobile",
|
||||||
|
"vi-test:23vivi": "npm run vi-test -- --browser 23viviDesktop --browser 23viviMobile"
|
||||||
},
|
},
|
||||||
"browser": {
|
"browser": {
|
||||||
"fineUploader": "./js/components/ascribe_uploader/vendor/s3.fine-uploader.js"
|
"fineUploader": "./js/components/ascribe_uploader/vendor/s3.fine-uploader.js"
|
||||||
@ -35,7 +48,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^3.1.11",
|
"babel-eslint": "^3.1.11",
|
||||||
"babel-jest": "^5.2.0",
|
"babel-jest": "^5.2.0",
|
||||||
"gemini": "^2.0.3",
|
"gemini": "^2.1.0",
|
||||||
"gulp-sass": "^2.1.1",
|
"gulp-sass": "^2.1.1",
|
||||||
"jest-cli": "^0.4.0",
|
"jest-cli": "^0.4.0",
|
||||||
"phantomjs2": "^2.0.2"
|
"phantomjs2": "^2.0.2"
|
||||||
|
Loading…
Reference in New Issue
Block a user