diff --git a/docs/visual-regression-testing.md b/docs/visual-regression-testing.md index d544b1fa..35d328f0 100644 --- a/docs/visual-regression-testing.md +++ b/docs/visual-regression-testing.md @@ -42,21 +42,32 @@ Running Tests Run PhantomJS: ```bash -phantomjs --webdriver=4444 +npm run vi-phantom ``` And then run Gemini tests: ```bash -# In root onion/ -gemini test gemini/* --report html +npm run vi-test + +# 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 -# In root onion/ -gemini update gemini/* +npm run vi-update + +# 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/`. +**It would be nice if we kept the whitelabels up to date.** + Some useful tips: * 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 @@ -181,3 +194,11 @@ change the environment to run against. # In root /onion folder 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 diff --git a/package.json b/package.json index d3e7ae41..dd8b3244 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,20 @@ "lint": "eslint ./js", "postinstall": "npm run build", "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": { "fineUploader": "./js/components/ascribe_uploader/vendor/s3.fine-uploader.js" @@ -35,7 +48,7 @@ "devDependencies": { "babel-eslint": "^3.1.11", "babel-jest": "^5.2.0", - "gemini": "^2.0.3", + "gemini": "^2.1.0", "gulp-sass": "^2.1.1", "jest-cli": "^0.4.0", "phantomjs2": "^2.0.2"