Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Builder visual #791

Merged
merged 44 commits into from
Jun 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8777f46
Add start of visual tests
Blackbaud-PatrickOFriel Jun 2, 2017
e17e1e2
Merge branch 'ng4-upgrade' into builder-visual
Blackbaud-PatrickOFriel Jun 2, 2017
3cd2cc8
continue working on skyux builder visual tests
Blackbaud-PatrickOFriel Jun 2, 2017
755c4fb
more work on getting builder visual tests to work
Blackbaud-PatrickOFriel Jun 2, 2017
113046d
More work around visual tests
Blackbaud-PatrickOFriel Jun 5, 2017
27e71a1
fix package name typo
Blackbaud-PatrickOFriel Jun 5, 2017
08a1e4c
Update import paths for visual test spa
Blackbaud-PatrickOFriel Jun 5, 2017
904f759
Add normalize-scss to package.json
Blackbaud-PatrickOFriel Jun 5, 2017
7d8a3e8
Fix moment import to work with rollup
Blackbaud-PatrickOFriel Jun 5, 2017
5e6cd8d
fix tile strangeness
Blackbaud-PatrickOFriel Jun 5, 2017
06b075b
start scripts for visual test setup
Blackbaud-PatrickOFriel Jun 5, 2017
6070f63
Continue protractor work
Blackbaud-PatrickOFriel Jun 5, 2017
23ee530
start of visual test command
Blackbaud-PatrickOFriel Jun 5, 2017
83dde6c
duplicate a bit of work to get protractor ready to go
Blackbaud-PatrickOFriel Jun 6, 2017
398ad23
Get protractor to go to a page
Blackbaud-PatrickOFriel Jun 6, 2017
ee11773
Add first pass at image comparison
Blackbaud-PatrickOFriel Jun 6, 2017
25917f1
Continue pixdiff work
Blackbaud-PatrickOFriel Jun 7, 2017
cca1170
Work on thresholds
Blackbaud-PatrickOFriel Jun 7, 2017
b5b1c99
Screenshots working with alert visual test
Blackbaud-PatrickOFriel Jun 7, 2017
f079a93
Add wrapper function for visual tests
Blackbaud-PatrickOFriel Jun 7, 2017
7e8f70e
Add checkAccessibility
Blackbaud-PatrickOFriel Jun 8, 2017
d4989d4
Break out local visual test conf file
Blackbaud-PatrickOFriel Jun 8, 2017
f391163
Add content for ci visual tests
Blackbaud-PatrickOFriel Jun 8, 2017
1c14250
Allow visual tests to change config based on command line
Blackbaud-PatrickOFriel Jun 8, 2017
b382eda
Browserstack tests working
Blackbaud-PatrickOFriel Jun 8, 2017
c6064bd
fix browserstack local visual tests
Blackbaud-PatrickOFriel Jun 8, 2017
02a2d60
Add avatar visual test
Blackbaud-PatrickOFriel Jun 9, 2017
92e23b8
Add button visual test
Blackbaud-PatrickOFriel Jun 9, 2017
f19ccb4
Add visual tests for card, checkbox, and chevron
Blackbaud-PatrickOFriel Jun 9, 2017
80feefd
Add datepicker, definition list, and dropdown visual tests
Blackbaud-PatrickOFriel Jun 9, 2017
427f5fe
Add error, file drop, and filter visual tests
Blackbaud-PatrickOFriel Jun 9, 2017
afb9c0d
Add visual tests for grid, key-info, label, list-secondary-actions, l…
Blackbaud-PatrickOFriel Jun 9, 2017
a32242a
add visual tests for navbar
Blackbaud-PatrickOFriel Jun 9, 2017
94c347f
Add page summary visual tests
Blackbaud-PatrickOFriel Jun 10, 2017
f83b295
Add visual tests for paging, radio, repeater
Blackbaud-PatrickOFriel Jun 10, 2017
a37c63a
Add visual tests for search, sort, tabs
Blackbaud-PatrickOFriel Jun 10, 2017
d6755cf
Add visual tests for text-expand, text-expand-repeater, tiles
Blackbaud-PatrickOFriel Jun 10, 2017
dc7a366
Finsih visual tests
Blackbaud-PatrickOFriel Jun 10, 2017
71f2737
Updated visual tests
Blackbaud-PatrickOFriel Jun 12, 2017
a7bb0b1
Update ci tests
Blackbaud-PatrickOFriel Jun 12, 2017
10897b6
Merge branch 'master' into builder-visual
Blackbaud-PatrickOFriel Jun 12, 2017
72da1d9
fix package.json conflict
Blackbaud-PatrickOFriel Jun 12, 2017
2672490
update other visual test scripts
Blackbaud-PatrickOFriel Jun 13, 2017
21ef69b
Merge branch 'ng4-upgrade' into builder-visual
Blackbaud-PatrickOFriel Jun 13, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,10 @@ browserstack.err
/skyux-spa-visual-tests/dist/
/skyux-spa-visual-tests/node_modules/
browserstack-binary/BrowserStackLocal

skyux-spa-visual-tests/dist
skyux-spa-visual-tests/node_modules
skyux-spa-visual-tests/screenshots-baseline-local
skyux-spa-visual-tests/screenshots-diff-local
skyux-spa-visual-tests/screenshots-created-local

5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ before_install:
- chmod +x ./scripts/visual-baseline.sh
- chmod +x ./scripts/visual-failures.sh

after_install:

- sudo cp .node_modules/@blackbaud/skyux-builder/ssl/skyux-ca.crt /usr/local/share/ca-certificates/skyux-ca.crt
- sudo update-ca-certificates

script: ./scripts/travis-script.sh
after_script: ./scripts/travis-after-script.sh
after_success:
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ci": "npm run lint && npm run test:ci && npm run build",
"build": "npm run clean:srctemp && node config/utils/stage-ts.js && cd .srctemp && ../node_modules/.bin/ngc && cd ../ && npm run compile:sass && cd config/rollup && ../../node_modules/.bin/rollup -c rollup.config.js && ../../node_modules/.bin/rollup -c rollup.min.config.js && npm run clean:srctemp",
"clean": "rimraf -- dist",
"clean:full": "npm cache clean && rimraf -- node_modules doc coverage dist .srctemp webdriver-screenshotslocal webdriver-screenshotslocal-diffs",
"clean:full": "npm cache clean && rimraf -- node_modules doc coverage dist .srctemp webdriver-screenshotslocal webdriver-screenshotslocal-diffs skyux-spa-visual-tests/node_modules/ skyux-spa-visual-tests/dist/",
"clean:releases": "rimraf -- releases",
"clean:srctemp": "rimraf -- .srctemp",
"compile:sass": "./node_modules/node-sass/bin/node-sass src/scss/sky.scss dist/css/sky.css",
Expand All @@ -23,10 +23,10 @@
"test:unit": "npm run test:unit:base -- config/karma/local.karma.conf.js",
"test:unit:ci": "npm run test:unit:base -- config/karma/ci.karma.conf.js",
"test:unit:base": "node --max-old-space-size=4096 node_modules/karma/bin/karma start",
"test:visual": "npm run test:visual:base -- config/wdio/local.wdio.conf.js",
"test:visual:ci": "./scripts/browserstack-local-start.sh && npm run test:visual:base -- config/wdio/ci.wdio.conf.js",
"test:visual:local-browserstack": "./scripts/browserstack-local-start.sh && npm run test:visual:base -- config/wdio/local-browserstack.wdio.conf.js",
"test:visual:base": "./node_modules/.bin/wdio",
"test:visual": "npm run test:visual:base && npm run test-visual:local",
"test:visual:ci": "npm run test:visual:base && npm run test-visual:ci",
"test:visual:local-browserstack": "npm run test:visual:base && npm run test-visual:local-browserstack",
"test:visual:base": "cd skyux-spa-visual-tests && npm run build-visual",
"postversion": "git push && git push --tags",
"prebuild": "npm run clean",
"pretest": "npm run lint",
Expand Down
2 changes: 1 addition & 1 deletion scripts/visual-baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ "$TRAVIS_PULL_REQUEST" == "false" && ! $TRAVIS_BRANCH =~ $SAVAGE_BRANCH ]]
git config --global user.name "Blackbaud Sky Build User"
git clone --quiet --branch=$TRAVIS_BRANCH https://${GH_TOKEN}@github.com/blackbaud/skyux2.git skyux2 > /dev/null

cp -rf webdriver-screenshots/ skyux2/
cp -rf skyux-spa-visual-tests/screenshots-baseline/ skyux2/
cd skyux2

if [ -z "$(git ls-files --others --exclude-standard)" ]; then
Expand Down
6 changes: 3 additions & 3 deletions scripts/visual-failures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ if [[ "$(ls -A webdriver-screenshots-diffs)" ]]; then
fi
git checkout -b $branch

cp -rf ../webdriver-screenshots-screen created-screenshots/
cp -rf ../skyux-spa-visual-tests/screenshots-created/ created-screenshots/

mkdir -p failures

cp -rf ../webdriver-screenshots-diffs/ failures/
cp -rf ../skyux-spa-visual-tests/screenshots-diff/ failures/

mkdir -p all

cp -rf ../webdriver-screenshots/ all/
cp -rf ../skyux-spa-visual-tests/screenshots-baseline/ all/

git add -A
if [ -z "$(git status --porcelain)" ]; then
Expand Down
9 changes: 9 additions & 0 deletions skyux-spa-visual-tests/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
26 changes: 26 additions & 0 deletions skyux-spa-visual-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*

# Coverage directory used by tools like istanbul
coverage

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# SKY UX temp directory
.skyuxtmp

# SKY UX build directory
dist

# OS specific files
.DS_Store
13 changes: 13 additions & 0 deletions skyux-spa-visual-tests/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"esversion": 6,
"curly": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"noarg": true,
"nonbsp": true,
"nonew": true,
"strict": true,
"undef": true,
"unused": true
}
28 changes: 28 additions & 0 deletions skyux-spa-visual-tests/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug SKY UX",
"type": "node2",
"request": "launch",
"program": "${workspaceRoot}/../skyux-cli/bin/skyux.js",
"stopOnEntry": false,
"args": ["build"],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"console": "integratedTerminal",
"sourceMaps": false,
"outFiles": []
}
]
}
7 changes: 7 additions & 0 deletions skyux-spa-visual-tests/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Place your settings in this file to overwrite default and user settings.
{
// Columns at which to show vertical rulers
"editor.rulers": [100],

"typescript.tsdk": "node_modules/typescript/lib"
}
2 changes: 2 additions & 0 deletions skyux-spa-visual-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# skyux-template
Template for SKY UX applications created by the SKY UX CLI
98 changes: 98 additions & 0 deletions skyux-spa-visual-tests/config/ci.visual.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*jshint jasmine: true, node: true */
/* global browser */
'use strict';

let builderUtils = require('@blackbaud/skyux-builder/utils/host-utils');

const SpecReporter = require('jasmine-spec-reporter').SpecReporter;

var config = require('./shared.visual.conf.js');

var browserstack = require('browserstack-local');

require('./utils/fast-selenium.js');

config.onPrepare = function () {
jasmine.getEnv().addReporter(new SpecReporter());
const PixDiff = require('pix-diff');
browser.pixDiff = new PixDiff(
{
basePath: 'screenshots-baseline/',
diffPath: 'screenshots-diff/',
baseline: true,
width: 1000,
height: 800
}
);

browser.skyVisualTestOptions = {
createdPath: 'screenshots-created/',
createdPathDiff: 'screenshots-created-diff/'
};

var destination = builderUtils.resolve(
'/',
browser.params.localUrl,
JSON.parse(browser.params.chunks),
JSON.parse(browser.params.skyPagesConfig)
);

return browser.get(destination);
};

config.capabilities = {
'browserName': 'chrome',
'chromeOptions': {
'args': ['--disable-extensions --ignore-certificate-errors']
},
'browserstack.user': process.env.BROWSER_STACK_USERNAME,
'browserstack.key': process.env.BROWSER_STACK_ACCESS_KEY,
browser_version: '57',
'browserstack.local': 'true',
'browserstack.debug': 'true',
os: 'OS X',
os_version: 'El Capitan',
browserDisconnectTimeout: 3e5,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 3e5,
captureTimeout: 3e5,
build: 'skyux2-mac-chrome-webdriver-' + process.env.TRAVIS_BUILD_NUMBER,
resolution: '1280x960',
name: 'SKYUX2BROWSERSTACKCI',
'browserstack.localIdentifier': 'SKYUX2BROWSERSTACKCI',
'acceptSslCerts': true
};

config.seleniumAddress = 'http://hub-cloud.browserstack.com/wd/hub';

config.beforeLaunch = function () {
require('ts-node').register({ ignore: false });
console.log('Connecting local');
return new Promise(function (resolve, reject){
exports.bs_local = new browserstack.Local();
exports.bs_local.start(
{
'key': process.env.BROWSER_STACK_ACCESS_KEY,
onlyAutomate: true,
forceLocal: true,
force: true,
localIdentifier: 'SKYUX2BROWSERSTACKCI'
}, function (error) {
if (error) {
return reject(error);
}

console.log('Connected. Now testing...');
resolve();
});
});
};

// Code to stop browserstack local after end of test
config.afterLaunch = function () {
return new Promise(function (resolve) {
exports.bs_local.stop(resolve);
});
};

exports.config = config;
102 changes: 102 additions & 0 deletions skyux-spa-visual-tests/config/local-browserstack.visual.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*jshint jasmine: true, node: true */
/* global browser */
'use strict';

let builderUtils = require('@blackbaud/skyux-builder/utils/host-utils');

const SpecReporter = require('jasmine-spec-reporter').SpecReporter;

var config = require('./shared.visual.conf.js');

var browserstack = require('browserstack-local');

require('./utils/fast-selenium.js');

var timestamp = new Date().toString();

config.onPrepare = function () {
jasmine.getEnv().addReporter(new SpecReporter());
const PixDiff = require('pix-diff');
browser.pixDiff = new PixDiff(
{
basePath: 'screenshots-baseline-local/',
diffPath: 'screenshots-diff-local/',
baseline: true,
width: 1000,
height: 600
}
);

browser.skyVisualTestOptions = {
createdPath: 'screenshots-created-local/',
createdPathDiff: 'screenshots-created-diff-local/'
};

var destination = builderUtils.resolve(
'/',
browser.params.localUrl,
JSON.parse(browser.params.chunks),
JSON.parse(browser.params.skyPagesConfig)
);

return browser.get(destination);

};

config.capabilities = {
'browserName': 'chrome',
'chromeOptions': {
'args': ['--disable-extensions --ignore-certificate-errors']
},
'browserstack.user': process.env.BROWSER_STACK_USERNAME,
'browserstack.key': process.env.BROWSER_STACK_ACCESS_KEY,
browser_version: '57',
'browserstack.local': 'true',
'browserstack.debug': 'false',
os: 'OS X',
os_version: 'El Capitan',
browserDisconnectTimeout: 3e5,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 3e5,
captureTimeout: 3e5,
build: 'skyux2-mac-chrome-webdriver-local-' + timestamp,
resolution: '1280x960',
name: 'SKYUX2BROWSERSTACKLOCAL',
'browserstack.localIdentifier': 'SKYUX2BROWSERSTACKLOCAL',
'acceptSslCerts': true,
'browserstack.video': 'false'
};

config.seleniumAddress = 'http://hub-cloud.browserstack.com/wd/hub';

config.beforeLaunch = function () {
require('ts-node').register({ ignore: false });
console.log('Connecting local');
return new Promise(function (resolve, reject) {
exports.bs_local = new browserstack.Local();
exports.bs_local.start(
{
'key': process.env.BROWSER_STACK_ACCESS_KEY,
onlyAutomate: true,
forceLocal: true,
force: true,
localIdentifier: 'SKYUX2BROWSERSTACKLOCAL'
}, function (error) {
if (error) {
return reject(error);
}

console.log('Connected. Now testing...');
resolve();
});
});
};

// Code to stop browserstack local after end of test
config.afterLaunch = function () {
return new Promise(function (resolve) {
exports.bs_local.stop(resolve);
});
};

exports.config = config;
Loading