From 747f8df06bbb54f949fe34bac9af263d7b96b136 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Thu, 4 Feb 2016 13:30:55 +0100 Subject: [PATCH] Rebase remerge --- docs/visual-regression-testing.md | 33 +++++++++++++++++++++++++------ package.json | 15 +++++++++++++- 2 files changed, 41 insertions(+), 7 deletions(-) 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 d8e76da5..9b90e537 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,19 @@ "start": "node server.js", "test": "mocha", "tunnel": "node test/tunnel.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" @@ -42,7 +55,7 @@ "chai-as-promised": "^5.1.0", "colors": "^1.1.2", "dotenv": "^1.2.0", - "gemini": "^2.0.3", + "gemini": "^2.1.0", "jest-cli": "^0.4.0", "mocha": "^2.3.4", "phantomjs2": "^2.0.2",