From 5e2e06e26dc08e734649bf810e4b3f281d490451 Mon Sep 17 00:00:00 2001 From: Cliff Pyles Date: Fri, 6 Oct 2017 15:18:17 -0400 Subject: [PATCH] chore(tests): Add visual regression tests --- .gitignore | 5 + backstop/config/index.js | 29 ++++ backstop/config/scenarios/about-modal.js | 4 + backstop/config/scenarios/accordions.js | 4 + backstop/config/scenarios/alerts.js | 4 + .../config/scenarios/application-launcher.js | 4 + backstop/config/scenarios/area-charts.js | 4 + backstop/config/scenarios/badges.js | 4 + backstop/config/scenarios/bar-charts.js | 5 + backstop/config/scenarios/basic.js | 4 + backstop/config/scenarios/blank-slate.js | 4 + .../config/scenarios/bootstrap-combobox.js | 4 + .../config/scenarios/bootstrap-datepicker.js | 4 + backstop/config/scenarios/bootstrap-select.js | 4 + backstop/config/scenarios/bootstrap-switch.js | 4 + .../config/scenarios/bootstrap-touchspin.js | 4 + .../config/scenarios/bootstrap-treeview.js | 4 + backstop/config/scenarios/breadcrumbs.js | 4 + backstop/config/scenarios/buttons.js | 4 + .../scenarios/card-view-card-variatons.js | 4 + .../scenarios/card-view-multi-select.js | 4 + .../scenarios/card-view-single-select.js | 4 + backstop/config/scenarios/cards.js | 4 + backstop/config/scenarios/code.js | 4 + backstop/config/scenarios/dashboard.js | 4 + backstop/config/scenarios/donut-charts.js | 5 + backstop/config/scenarios/dropdowns.js | 4 + backstop/config/scenarios/form.js | 4 + backstop/config/scenarios/forms.js | 4 + backstop/config/scenarios/icons.js | 4 + backstop/config/scenarios/index.js | 138 ++++++++++++++++++ backstop/config/scenarios/info-tip.js | 4 + backstop/config/scenarios/labels.js | 4 + backstop/config/scenarios/line-charts.js | 5 + backstop/config/scenarios/list-group.js | 4 + .../scenarios/list-view-compound-expansion.js | 4 + backstop/config/scenarios/list-view-rows.js | 4 + .../scenarios/list-view-simple-expansion.js | 4 + backstop/config/scenarios/list-view.js | 4 + backstop/config/scenarios/list.js | 4 + backstop/config/scenarios/login.js | 4 + backstop/config/scenarios/modals.js | 4 + backstop/config/scenarios/navbar.js | 4 + .../notification-drawer-horiztonal-nav.js | 4 + .../notification-drawer-vertical-nav.js | 4 + .../config/scenarios/pagination-card-view.js | 4 + .../config/scenarios/pagination-list-view.js | 4 + .../config/scenarios/pagination-table-view.js | 4 + backstop/config/scenarios/pagination.js | 4 + backstop/config/scenarios/panels.js | 4 + backstop/config/scenarios/pie-charts.js | 5 + backstop/config/scenarios/popovers.js | 4 + backstop/config/scenarios/progress-bars.js | 5 + backstop/config/scenarios/search.js | 4 + backstop/config/scenarios/spinner.js | 5 + backstop/config/scenarios/tab.js | 4 + .../config/scenarios/table-view-columns.js | 4 + .../config/scenarios/table-view-navbar.js | 4 + backstop/config/scenarios/table-view.js | 4 + backstop/config/scenarios/tables.js | 4 + backstop/config/scenarios/tabs.js | 4 + backstop/config/scenarios/time-picker.js | 4 + backstop/config/scenarios/toasts.js | 4 + backstop/config/scenarios/toolbar.js | 4 + backstop/config/scenarios/tooltip.js | 4 + backstop/config/scenarios/tree-view.js | 4 + backstop/config/scenarios/typography.js | 4 + backstop/config/scenarios/typography2.js | 4 + .../scenarios/utilization-bar-charts.js | 4 + backstop/config/scenarios/wizard.js | 4 + backstop/reference.js | 34 +++++ backstop/test.js | 34 +++++ .../engine_scripts/chromy/onBefore.js | 4 + .../engine_scripts/chromy/onReady.js | 6 + backstop_data/engine_scripts/onBefore.js | 4 + backstop_data/engine_scripts/onReady.js | 6 + package.json | 6 +- 77 files changed, 539 insertions(+), 1 deletion(-) create mode 100644 backstop/config/index.js create mode 100644 backstop/config/scenarios/about-modal.js create mode 100644 backstop/config/scenarios/accordions.js create mode 100644 backstop/config/scenarios/alerts.js create mode 100644 backstop/config/scenarios/application-launcher.js create mode 100644 backstop/config/scenarios/area-charts.js create mode 100644 backstop/config/scenarios/badges.js create mode 100644 backstop/config/scenarios/bar-charts.js create mode 100644 backstop/config/scenarios/basic.js create mode 100644 backstop/config/scenarios/blank-slate.js create mode 100644 backstop/config/scenarios/bootstrap-combobox.js create mode 100644 backstop/config/scenarios/bootstrap-datepicker.js create mode 100644 backstop/config/scenarios/bootstrap-select.js create mode 100644 backstop/config/scenarios/bootstrap-switch.js create mode 100644 backstop/config/scenarios/bootstrap-touchspin.js create mode 100644 backstop/config/scenarios/bootstrap-treeview.js create mode 100644 backstop/config/scenarios/breadcrumbs.js create mode 100644 backstop/config/scenarios/buttons.js create mode 100644 backstop/config/scenarios/card-view-card-variatons.js create mode 100644 backstop/config/scenarios/card-view-multi-select.js create mode 100644 backstop/config/scenarios/card-view-single-select.js create mode 100644 backstop/config/scenarios/cards.js create mode 100644 backstop/config/scenarios/code.js create mode 100644 backstop/config/scenarios/dashboard.js create mode 100644 backstop/config/scenarios/donut-charts.js create mode 100644 backstop/config/scenarios/dropdowns.js create mode 100644 backstop/config/scenarios/form.js create mode 100644 backstop/config/scenarios/forms.js create mode 100644 backstop/config/scenarios/icons.js create mode 100644 backstop/config/scenarios/index.js create mode 100644 backstop/config/scenarios/info-tip.js create mode 100644 backstop/config/scenarios/labels.js create mode 100644 backstop/config/scenarios/line-charts.js create mode 100644 backstop/config/scenarios/list-group.js create mode 100644 backstop/config/scenarios/list-view-compound-expansion.js create mode 100644 backstop/config/scenarios/list-view-rows.js create mode 100644 backstop/config/scenarios/list-view-simple-expansion.js create mode 100644 backstop/config/scenarios/list-view.js create mode 100644 backstop/config/scenarios/list.js create mode 100644 backstop/config/scenarios/login.js create mode 100644 backstop/config/scenarios/modals.js create mode 100644 backstop/config/scenarios/navbar.js create mode 100644 backstop/config/scenarios/notification-drawer-horiztonal-nav.js create mode 100644 backstop/config/scenarios/notification-drawer-vertical-nav.js create mode 100644 backstop/config/scenarios/pagination-card-view.js create mode 100644 backstop/config/scenarios/pagination-list-view.js create mode 100644 backstop/config/scenarios/pagination-table-view.js create mode 100644 backstop/config/scenarios/pagination.js create mode 100644 backstop/config/scenarios/panels.js create mode 100644 backstop/config/scenarios/pie-charts.js create mode 100644 backstop/config/scenarios/popovers.js create mode 100644 backstop/config/scenarios/progress-bars.js create mode 100644 backstop/config/scenarios/search.js create mode 100644 backstop/config/scenarios/spinner.js create mode 100644 backstop/config/scenarios/tab.js create mode 100644 backstop/config/scenarios/table-view-columns.js create mode 100644 backstop/config/scenarios/table-view-navbar.js create mode 100644 backstop/config/scenarios/table-view.js create mode 100644 backstop/config/scenarios/tables.js create mode 100644 backstop/config/scenarios/tabs.js create mode 100644 backstop/config/scenarios/time-picker.js create mode 100644 backstop/config/scenarios/toasts.js create mode 100644 backstop/config/scenarios/toolbar.js create mode 100644 backstop/config/scenarios/tooltip.js create mode 100644 backstop/config/scenarios/tree-view.js create mode 100644 backstop/config/scenarios/typography.js create mode 100644 backstop/config/scenarios/typography2.js create mode 100644 backstop/config/scenarios/utilization-bar-charts.js create mode 100644 backstop/config/scenarios/wizard.js create mode 100644 backstop/reference.js create mode 100644 backstop/test.js create mode 100644 backstop_data/engine_scripts/chromy/onBefore.js create mode 100644 backstop_data/engine_scripts/chromy/onReady.js create mode 100644 backstop_data/engine_scripts/onBefore.js create mode 100644 backstop_data/engine_scripts/onReady.js diff --git a/.gitignore b/.gitignore index 76d4577021..6cdba64e48 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,8 @@ patternfly.spec #Ignore generated dist files /dist + +#Ignore backstop regression test images and reports +/backstop_data/bitmaps_test +/backstop_data/bitmaps_reference +/backstop_data/html_report diff --git a/backstop/config/index.js b/backstop/config/index.js new file mode 100644 index 0000000000..960d11e789 --- /dev/null +++ b/backstop/config/index.js @@ -0,0 +1,29 @@ +const scenarios = require('./scenarios'); + +module.exports = { + "id": "backstop_default", + "viewports": [ + { + "label": "desktop", + "width": 1440, + "height": 900 + } + ], + "onBeforeScript": "chromy/onBefore.js", + "onReadyScript": "chromy/onReady.js", + "scenarios": scenarios, + "paths": { + "bitmaps_reference": "backstop_data/bitmaps_reference", + "bitmaps_test": "backstop_data/bitmaps_test", + "engine_scripts": "backstop_data/engine_scripts", + "html_report": "backstop_data/html_report", + "ci_report": "backstop_data/ci_report" + }, + "report": ["browser"], + "engine": "chrome", + "engineFlags": [], + "asyncCaptureLimit": 5, + "asyncCompareLimit": 25, + "debug": false, + "debugWindow": false +} diff --git a/backstop/config/scenarios/about-modal.js b/backstop/config/scenarios/about-modal.js new file mode 100644 index 0000000000..88f37e5511 --- /dev/null +++ b/backstop/config/scenarios/about-modal.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'about-modal', + url: 'http://localhost:9000/about-modal.html' +}] diff --git a/backstop/config/scenarios/accordions.js b/backstop/config/scenarios/accordions.js new file mode 100644 index 0000000000..ed0b11f7c6 --- /dev/null +++ b/backstop/config/scenarios/accordions.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'accordions', + url: 'http://localhost:9000/accordions.html' +}] diff --git a/backstop/config/scenarios/alerts.js b/backstop/config/scenarios/alerts.js new file mode 100644 index 0000000000..ca41951cab --- /dev/null +++ b/backstop/config/scenarios/alerts.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'alerts', + url: 'http://localhost:9000/alerts.html' +}] diff --git a/backstop/config/scenarios/application-launcher.js b/backstop/config/scenarios/application-launcher.js new file mode 100644 index 0000000000..d2c9df79b1 --- /dev/null +++ b/backstop/config/scenarios/application-launcher.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'application-launcher', + url: 'http://localhost:9000/application-launcher.html' +}] diff --git a/backstop/config/scenarios/area-charts.js b/backstop/config/scenarios/area-charts.js new file mode 100644 index 0000000000..e5fabee2bd --- /dev/null +++ b/backstop/config/scenarios/area-charts.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'area-charts', + url: 'http://localhost:9000/area-charts.html' +}] diff --git a/backstop/config/scenarios/badges.js b/backstop/config/scenarios/badges.js new file mode 100644 index 0000000000..826a626696 --- /dev/null +++ b/backstop/config/scenarios/badges.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'badges', + url: 'http://localhost:9000/badges.html' +}] diff --git a/backstop/config/scenarios/bar-charts.js b/backstop/config/scenarios/bar-charts.js new file mode 100644 index 0000000000..e85b2317a2 --- /dev/null +++ b/backstop/config/scenarios/bar-charts.js @@ -0,0 +1,5 @@ +// module.exports = [{ +// label: 'bar-charts', +// url: 'http://localhost:9000/bar-charts.html' +// }] +module.exports = [] diff --git a/backstop/config/scenarios/basic.js b/backstop/config/scenarios/basic.js new file mode 100644 index 0000000000..235d3ca81d --- /dev/null +++ b/backstop/config/scenarios/basic.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'basic', + url: 'http://localhost:9000/basic.html' +}] diff --git a/backstop/config/scenarios/blank-slate.js b/backstop/config/scenarios/blank-slate.js new file mode 100644 index 0000000000..1bc57bd41e --- /dev/null +++ b/backstop/config/scenarios/blank-slate.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'blank-slate', + url: 'http://localhost:9000/blank-slate.html' +}] diff --git a/backstop/config/scenarios/bootstrap-combobox.js b/backstop/config/scenarios/bootstrap-combobox.js new file mode 100644 index 0000000000..cbe2062c1a --- /dev/null +++ b/backstop/config/scenarios/bootstrap-combobox.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'bootstrap-combobox', + url: 'http://localhost:9000/bootstrap-combobox.html' +}] diff --git a/backstop/config/scenarios/bootstrap-datepicker.js b/backstop/config/scenarios/bootstrap-datepicker.js new file mode 100644 index 0000000000..a717d165e6 --- /dev/null +++ b/backstop/config/scenarios/bootstrap-datepicker.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'bootstrap-datepicker', + url: 'http://localhost:9000/bootstrap-datepicker.html' +}] diff --git a/backstop/config/scenarios/bootstrap-select.js b/backstop/config/scenarios/bootstrap-select.js new file mode 100644 index 0000000000..375a6af1fa --- /dev/null +++ b/backstop/config/scenarios/bootstrap-select.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'bootstrap-select', + url: 'http://localhost:9000/bootstrap-select.html' +}] diff --git a/backstop/config/scenarios/bootstrap-switch.js b/backstop/config/scenarios/bootstrap-switch.js new file mode 100644 index 0000000000..99b7f03097 --- /dev/null +++ b/backstop/config/scenarios/bootstrap-switch.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'bootstrap-switch', + url: 'http://localhost:9000/bootstrap-switch.html' +}] diff --git a/backstop/config/scenarios/bootstrap-touchspin.js b/backstop/config/scenarios/bootstrap-touchspin.js new file mode 100644 index 0000000000..32fb6589d0 --- /dev/null +++ b/backstop/config/scenarios/bootstrap-touchspin.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'bootstrap-touchspin', + url: 'http://localhost:9000/bootstrap-touchspin.html' +}] diff --git a/backstop/config/scenarios/bootstrap-treeview.js b/backstop/config/scenarios/bootstrap-treeview.js new file mode 100644 index 0000000000..89d7e9c7b9 --- /dev/null +++ b/backstop/config/scenarios/bootstrap-treeview.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'bootstrap-treeview', + url: 'http://localhost:9000/bootstrap-treeview.html' +}] diff --git a/backstop/config/scenarios/breadcrumbs.js b/backstop/config/scenarios/breadcrumbs.js new file mode 100644 index 0000000000..ddbada48c9 --- /dev/null +++ b/backstop/config/scenarios/breadcrumbs.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'breadcrumbs', + url: 'http://localhost:9000/breadcrumbs.html' +}] diff --git a/backstop/config/scenarios/buttons.js b/backstop/config/scenarios/buttons.js new file mode 100644 index 0000000000..5415211f1d --- /dev/null +++ b/backstop/config/scenarios/buttons.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'buttons', + url: 'http://localhost:9000/buttons.html' +}] diff --git a/backstop/config/scenarios/card-view-card-variatons.js b/backstop/config/scenarios/card-view-card-variatons.js new file mode 100644 index 0000000000..c10a290f56 --- /dev/null +++ b/backstop/config/scenarios/card-view-card-variatons.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'card-view-card-variatons', + url: 'http://localhost:9000/card-view-card-variatons.html' +}] diff --git a/backstop/config/scenarios/card-view-multi-select.js b/backstop/config/scenarios/card-view-multi-select.js new file mode 100644 index 0000000000..f7986848ba --- /dev/null +++ b/backstop/config/scenarios/card-view-multi-select.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'card-view-multi-select', + url: 'http://localhost:9000/card-view-multi-select.html' +}] diff --git a/backstop/config/scenarios/card-view-single-select.js b/backstop/config/scenarios/card-view-single-select.js new file mode 100644 index 0000000000..ec741ee93e --- /dev/null +++ b/backstop/config/scenarios/card-view-single-select.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'card-view-single-select', + url: 'http://localhost:9000/card-view-single-select.html' +}] diff --git a/backstop/config/scenarios/cards.js b/backstop/config/scenarios/cards.js new file mode 100644 index 0000000000..e32de994c7 --- /dev/null +++ b/backstop/config/scenarios/cards.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'cards', + url: 'http://localhost:9000/cards.html' +}] diff --git a/backstop/config/scenarios/code.js b/backstop/config/scenarios/code.js new file mode 100644 index 0000000000..78ec379985 --- /dev/null +++ b/backstop/config/scenarios/code.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'code', + url: 'http://localhost:9000/code.html' +}] diff --git a/backstop/config/scenarios/dashboard.js b/backstop/config/scenarios/dashboard.js new file mode 100644 index 0000000000..3f4e01fb69 --- /dev/null +++ b/backstop/config/scenarios/dashboard.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'dashboard', + url: 'http://localhost:9000/dashboard.html' +}] diff --git a/backstop/config/scenarios/donut-charts.js b/backstop/config/scenarios/donut-charts.js new file mode 100644 index 0000000000..0f35d44c20 --- /dev/null +++ b/backstop/config/scenarios/donut-charts.js @@ -0,0 +1,5 @@ +// module.exports = [{ +// label: 'donut-charts', +// url: 'http://localhost:9000/donut-charts.html' +// }] +module.exports = [] diff --git a/backstop/config/scenarios/dropdowns.js b/backstop/config/scenarios/dropdowns.js new file mode 100644 index 0000000000..368689afab --- /dev/null +++ b/backstop/config/scenarios/dropdowns.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'dropdowns', + url: 'http://localhost:9000/dropdowns.html' +}] diff --git a/backstop/config/scenarios/form.js b/backstop/config/scenarios/form.js new file mode 100644 index 0000000000..02e347aac3 --- /dev/null +++ b/backstop/config/scenarios/form.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'form', + url: 'http://localhost:9000/form.html' +}] diff --git a/backstop/config/scenarios/forms.js b/backstop/config/scenarios/forms.js new file mode 100644 index 0000000000..cee7b7dfe9 --- /dev/null +++ b/backstop/config/scenarios/forms.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'forms', + url: 'http://localhost:9000/forms.html' +}] diff --git a/backstop/config/scenarios/icons.js b/backstop/config/scenarios/icons.js new file mode 100644 index 0000000000..5d100883a0 --- /dev/null +++ b/backstop/config/scenarios/icons.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'icons', + url: 'http://localhost:9000/icons.html' +}] diff --git a/backstop/config/scenarios/index.js b/backstop/config/scenarios/index.js new file mode 100644 index 0000000000..6bc7540df1 --- /dev/null +++ b/backstop/config/scenarios/index.js @@ -0,0 +1,138 @@ +const aboutModalScenario = require('./about-modal'), + accordionsScenario = require('./accordions'), + alertsScenario = require('./alerts'), + applicationLauncherScenario = require('./application-launcher'), + badgesScenario = require('./badges'), + blankSlateScenario = require('./blank-slate'), + bootstrapComboboxScenario = require('./bootstrap-combobox'), + bootstrapDatepickerScenario = require('./bootstrap-datepicker'), + bootstrapSelectScenario = require('./bootstrap-select'), + bootstrapSwitchScenario = require('./bootstrap-switch'), + bootstrapTouchspinScenario = require('./bootstrap-touchspin'), + bootstrapTreeviewScenario = require('./bootstrap-treeview'), + breadcrumbsScenario = require('./breadcrumbs'), + buttonsScenario = require('./buttons'), + cardViewCardVariatonsScenario = require('./card-view-card-variatons'), + codeScenario = require('./code'), + dropdownsScenario = require('./dropdowns'), + formsScenario = require('./forms'), + iconsScenario = require('./icons'), + infoTipScenario = require('./info-tip'), + labelsScenario = require('./labels'), + listGroupScenario = require('./list-group'), + listScenario = require('./list'), + listViewRowsScenario = require('./list-view-rows'), + modalsScenario = require('./modals'), + navbarScenario = require('./navbar'), + paginationScenario = require('./pagination'), + panelsScenario = require('./panels'), + popoversScenario = require('./popovers'), + progressBarsScenario = require('./progress-bars'), + searchScenario = require('./search'), + spinnerScenario = require('./spinner'), + tableViewColumnsScenario = require('./table-view-columns'), + tableViewNavbarScenario = require('./table-view-navbar'), + tableViewScenario = require('./table-view'), + tablesScenario = require('./tables'), + tabsScenario = require('./tabs'), + timePickerScenario = require('./time-picker'), + toastsScenario = require('./toasts'), + toolbarScenario = require('./toolbar'), + tooltipScenario = require('./tooltip'), + typographyScenario = require('./typography'), + wizardScenario = require('./wizard'), + areaChartsScenario = require('./area-charts'), + barChartsScenario = require('./bar-charts'), + donutChartsScenario = require('./donut-charts'), + lineChartsScenario = require('./line-charts'), + pieChartsScenario = require('./pie-charts'), + utilizationBarChartsScenario = require('./utilization-bar-charts'), + basicScenario = require('./basic'), + treeViewScenario = require('./tree-view'), + cardViewMultiSelectScenario = require('./card-view-multi-select'), + cardViewSingleSelectScenario = require('./card-view-single-select'), + cardsScenario = require('./cards'), + dashboardScenario = require('./dashboard'), + formScenario = require('./form'), + listViewCompoundExpansionScenario = require('./list-view-compound-expansion'), + listViewSimpleExpansionScenario = require('./list-view-simple-expansion'), + listViewScenario = require('./list-view'), + loginScenario = require('./login'), + notificationDrawerHoriztonalNavScenario = require('./notification-drawer-horiztonal-nav'), + notificationDrawerVerticalNavScenario = require('./notification-drawer-vertical-nav'), + paginationCardViewScenario = require('./pagination-card-view'), + paginationListViewScenario = require('./pagination-list-view'), + paginationTableViewScenario = require('./pagination-table-view'), + tabScenario = require('./tab'), + typography2Scenario = require('./typography2'); + +const scenarios = [ + ...aboutModalScenario, + ...accordionsScenario, + ...alertsScenario, + ...applicationLauncherScenario, + ...badgesScenario, + ...blankSlateScenario, + ...bootstrapComboboxScenario, + ...bootstrapDatepickerScenario, + ...bootstrapSelectScenario, + ...bootstrapSwitchScenario, + ...bootstrapTouchspinScenario, + ...bootstrapTreeviewScenario, + ...breadcrumbsScenario, + ...buttonsScenario, + ...cardViewCardVariatonsScenario, + ...codeScenario, + ...dropdownsScenario, + ...formsScenario, + ...iconsScenario, + ...infoTipScenario, + ...labelsScenario, + ...listGroupScenario, + ...listScenario, + ...listViewRowsScenario, + ...modalsScenario, + ...navbarScenario, + ...paginationScenario, + ...panelsScenario, + ...popoversScenario, + ...progressBarsScenario, + ...searchScenario, + ...spinnerScenario, + ...tableViewColumnsScenario, + ...tableViewNavbarScenario, + ...tableViewScenario, + ...tablesScenario, + ...tabsScenario, + ...timePickerScenario, + ...toastsScenario, + ...toolbarScenario, + ...tooltipScenario, + ...typographyScenario, + ...wizardScenario, + ...areaChartsScenario, + ...barChartsScenario, + ...donutChartsScenario, + ...lineChartsScenario, + ...pieChartsScenario, + ...utilizationBarChartsScenario, + ...basicScenario, + ...treeViewScenario, + ...cardViewMultiSelectScenario, + ...cardViewSingleSelectScenario, + ...cardsScenario, + ...dashboardScenario, + ...formScenario, + ...listViewCompoundExpansionScenario, + ...listViewSimpleExpansionScenario, + ...listViewScenario, + ...loginScenario, + ...notificationDrawerHoriztonalNavScenario, + ...notificationDrawerVerticalNavScenario, + ...paginationCardViewScenario, + ...paginationListViewScenario, + ...paginationTableViewScenario, + ...tabScenario +]; + +module.exports = scenarios diff --git a/backstop/config/scenarios/info-tip.js b/backstop/config/scenarios/info-tip.js new file mode 100644 index 0000000000..d284f26a99 --- /dev/null +++ b/backstop/config/scenarios/info-tip.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'info-tip', + url: 'http://localhost:9000/info-tip.html' +}] diff --git a/backstop/config/scenarios/labels.js b/backstop/config/scenarios/labels.js new file mode 100644 index 0000000000..c54200fad1 --- /dev/null +++ b/backstop/config/scenarios/labels.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'labels', + url: 'http://localhost:9000/labels.html' +}] diff --git a/backstop/config/scenarios/line-charts.js b/backstop/config/scenarios/line-charts.js new file mode 100644 index 0000000000..c8b80461fd --- /dev/null +++ b/backstop/config/scenarios/line-charts.js @@ -0,0 +1,5 @@ +// module.exports = [{ +// label: 'line-charts', +// url: 'http://localhost:9000/line-charts.html' +// }] +module.exports = [] diff --git a/backstop/config/scenarios/list-group.js b/backstop/config/scenarios/list-group.js new file mode 100644 index 0000000000..d0b2dcfc9f --- /dev/null +++ b/backstop/config/scenarios/list-group.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'list-group', + url: 'http://localhost:9000/list-group.html' +}] diff --git a/backstop/config/scenarios/list-view-compound-expansion.js b/backstop/config/scenarios/list-view-compound-expansion.js new file mode 100644 index 0000000000..d12d6abec8 --- /dev/null +++ b/backstop/config/scenarios/list-view-compound-expansion.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'list-view-compound-expansion', + url: 'http://localhost:9000/list-view-compound-expansion.html' +}] diff --git a/backstop/config/scenarios/list-view-rows.js b/backstop/config/scenarios/list-view-rows.js new file mode 100644 index 0000000000..2c6c1f6f13 --- /dev/null +++ b/backstop/config/scenarios/list-view-rows.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'list-view-rows', + url: 'http://localhost:9000/list-view-rows.html' +}] diff --git a/backstop/config/scenarios/list-view-simple-expansion.js b/backstop/config/scenarios/list-view-simple-expansion.js new file mode 100644 index 0000000000..074f25507b --- /dev/null +++ b/backstop/config/scenarios/list-view-simple-expansion.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'list-view-simple-expansion', + url: 'http://localhost:9000/list-view-simple-expansion.html' +}] diff --git a/backstop/config/scenarios/list-view.js b/backstop/config/scenarios/list-view.js new file mode 100644 index 0000000000..6cbe4f67e0 --- /dev/null +++ b/backstop/config/scenarios/list-view.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'list-view', + url: 'http://localhost:9000/list-view.html' +}] diff --git a/backstop/config/scenarios/list.js b/backstop/config/scenarios/list.js new file mode 100644 index 0000000000..c48fb606ab --- /dev/null +++ b/backstop/config/scenarios/list.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'list', + url: 'http://localhost:9000/list.html' +}] diff --git a/backstop/config/scenarios/login.js b/backstop/config/scenarios/login.js new file mode 100644 index 0000000000..6204034b75 --- /dev/null +++ b/backstop/config/scenarios/login.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'login', + url: 'http://localhost:9000/login.html' +}] diff --git a/backstop/config/scenarios/modals.js b/backstop/config/scenarios/modals.js new file mode 100644 index 0000000000..b9dc325218 --- /dev/null +++ b/backstop/config/scenarios/modals.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'modals', + url: 'http://localhost:9000/modals.html' +}] diff --git a/backstop/config/scenarios/navbar.js b/backstop/config/scenarios/navbar.js new file mode 100644 index 0000000000..0cbfe13fe7 --- /dev/null +++ b/backstop/config/scenarios/navbar.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'navbar', + url: 'http://localhost:9000/navbar.html' +}] diff --git a/backstop/config/scenarios/notification-drawer-horiztonal-nav.js b/backstop/config/scenarios/notification-drawer-horiztonal-nav.js new file mode 100644 index 0000000000..807265faf8 --- /dev/null +++ b/backstop/config/scenarios/notification-drawer-horiztonal-nav.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'notification-drawer-horiztonal-nav', + url: 'http://localhost:9000/notification-drawer-horiztonal-nav.html' +}] diff --git a/backstop/config/scenarios/notification-drawer-vertical-nav.js b/backstop/config/scenarios/notification-drawer-vertical-nav.js new file mode 100644 index 0000000000..dbb5023b89 --- /dev/null +++ b/backstop/config/scenarios/notification-drawer-vertical-nav.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'notification-drawer-vertical-nav', + url: 'http://localhost:9000/notification-drawer-vertical-nav.html' +}] diff --git a/backstop/config/scenarios/pagination-card-view.js b/backstop/config/scenarios/pagination-card-view.js new file mode 100644 index 0000000000..84b74a97d9 --- /dev/null +++ b/backstop/config/scenarios/pagination-card-view.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'pagination-card-view', + url: 'http://localhost:9000/pagination-card-view.html' +}] diff --git a/backstop/config/scenarios/pagination-list-view.js b/backstop/config/scenarios/pagination-list-view.js new file mode 100644 index 0000000000..6f285643da --- /dev/null +++ b/backstop/config/scenarios/pagination-list-view.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'pagination-list-view', + url: 'http://localhost:9000/pagination-list-view.html' +}] diff --git a/backstop/config/scenarios/pagination-table-view.js b/backstop/config/scenarios/pagination-table-view.js new file mode 100644 index 0000000000..943054aeb8 --- /dev/null +++ b/backstop/config/scenarios/pagination-table-view.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'pagination-table-view', + url: 'http://localhost:9000/pagination-table-view.html' +}] diff --git a/backstop/config/scenarios/pagination.js b/backstop/config/scenarios/pagination.js new file mode 100644 index 0000000000..09107fea09 --- /dev/null +++ b/backstop/config/scenarios/pagination.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'pagination', + url: 'http://localhost:9000/pagination.html' +}] diff --git a/backstop/config/scenarios/panels.js b/backstop/config/scenarios/panels.js new file mode 100644 index 0000000000..33398c7a87 --- /dev/null +++ b/backstop/config/scenarios/panels.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'panels', + url: 'http://localhost:9000/panels.html' +}] diff --git a/backstop/config/scenarios/pie-charts.js b/backstop/config/scenarios/pie-charts.js new file mode 100644 index 0000000000..c12920611b --- /dev/null +++ b/backstop/config/scenarios/pie-charts.js @@ -0,0 +1,5 @@ +// module.exports = [{ +// label: 'pie-charts', +// url: 'http://localhost:9000/pie-charts.html' +// }] +module.exports = [] diff --git a/backstop/config/scenarios/popovers.js b/backstop/config/scenarios/popovers.js new file mode 100644 index 0000000000..60e0fbfd35 --- /dev/null +++ b/backstop/config/scenarios/popovers.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'popovers', + url: 'http://localhost:9000/popovers.html' +}] diff --git a/backstop/config/scenarios/progress-bars.js b/backstop/config/scenarios/progress-bars.js new file mode 100644 index 0000000000..05413e9d55 --- /dev/null +++ b/backstop/config/scenarios/progress-bars.js @@ -0,0 +1,5 @@ +// module.exports = [{ +// label: 'progress-bars', +// url: 'http://localhost:9000/progress-bars.html' +// }] +module.exports = [] diff --git a/backstop/config/scenarios/search.js b/backstop/config/scenarios/search.js new file mode 100644 index 0000000000..15340b54e7 --- /dev/null +++ b/backstop/config/scenarios/search.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'search', + url: 'http://localhost:9000/search.html' +}] diff --git a/backstop/config/scenarios/spinner.js b/backstop/config/scenarios/spinner.js new file mode 100644 index 0000000000..d53e108530 --- /dev/null +++ b/backstop/config/scenarios/spinner.js @@ -0,0 +1,5 @@ +// module.exports = [{ +// label: 'spinner', +// url: 'http://localhost:9000/spinner.html' +// }] +module.exports = [] diff --git a/backstop/config/scenarios/tab.js b/backstop/config/scenarios/tab.js new file mode 100644 index 0000000000..9fa05b6361 --- /dev/null +++ b/backstop/config/scenarios/tab.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'tab', + url: 'http://localhost:9000/tab.html' +}] diff --git a/backstop/config/scenarios/table-view-columns.js b/backstop/config/scenarios/table-view-columns.js new file mode 100644 index 0000000000..064ee47839 --- /dev/null +++ b/backstop/config/scenarios/table-view-columns.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'table-view-columns', + url: 'http://localhost:9000/table-view-columns.html' +}] diff --git a/backstop/config/scenarios/table-view-navbar.js b/backstop/config/scenarios/table-view-navbar.js new file mode 100644 index 0000000000..b85f9ada17 --- /dev/null +++ b/backstop/config/scenarios/table-view-navbar.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'table-view-navbar', + url: 'http://localhost:9000/table-view-navbar.html' +}] diff --git a/backstop/config/scenarios/table-view.js b/backstop/config/scenarios/table-view.js new file mode 100644 index 0000000000..7e42187ab1 --- /dev/null +++ b/backstop/config/scenarios/table-view.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'table-view', + url: 'http://localhost:9000/table-view.html' +}] diff --git a/backstop/config/scenarios/tables.js b/backstop/config/scenarios/tables.js new file mode 100644 index 0000000000..ca63cf0c67 --- /dev/null +++ b/backstop/config/scenarios/tables.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'tables', + url: 'http://localhost:9000/tables.html' +}] diff --git a/backstop/config/scenarios/tabs.js b/backstop/config/scenarios/tabs.js new file mode 100644 index 0000000000..b43f4d77de --- /dev/null +++ b/backstop/config/scenarios/tabs.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'tabs', + url: 'http://localhost:9000/tabs.html' +}] diff --git a/backstop/config/scenarios/time-picker.js b/backstop/config/scenarios/time-picker.js new file mode 100644 index 0000000000..a1b16fb413 --- /dev/null +++ b/backstop/config/scenarios/time-picker.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'time-picker', + url: 'http://localhost:9000/time-picker.html' +}] diff --git a/backstop/config/scenarios/toasts.js b/backstop/config/scenarios/toasts.js new file mode 100644 index 0000000000..2729d9bb55 --- /dev/null +++ b/backstop/config/scenarios/toasts.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'toasts', + url: 'http://localhost:9000/toasts.html' +}] diff --git a/backstop/config/scenarios/toolbar.js b/backstop/config/scenarios/toolbar.js new file mode 100644 index 0000000000..2d9ac26431 --- /dev/null +++ b/backstop/config/scenarios/toolbar.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'toolbar', + url: 'http://localhost:9000/toolbar.html' +}] diff --git a/backstop/config/scenarios/tooltip.js b/backstop/config/scenarios/tooltip.js new file mode 100644 index 0000000000..7f492d54c2 --- /dev/null +++ b/backstop/config/scenarios/tooltip.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'tooltip', + url: 'http://localhost:9000/tooltip.html' +}] diff --git a/backstop/config/scenarios/tree-view.js b/backstop/config/scenarios/tree-view.js new file mode 100644 index 0000000000..b9faabed6a --- /dev/null +++ b/backstop/config/scenarios/tree-view.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'tree-view', + url: 'http://localhost:9000/tree-view.html' +}] diff --git a/backstop/config/scenarios/typography.js b/backstop/config/scenarios/typography.js new file mode 100644 index 0000000000..48ad690d1a --- /dev/null +++ b/backstop/config/scenarios/typography.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'typography', + url: 'http://localhost:9000/typography.html' +}] diff --git a/backstop/config/scenarios/typography2.js b/backstop/config/scenarios/typography2.js new file mode 100644 index 0000000000..803a0e00f0 --- /dev/null +++ b/backstop/config/scenarios/typography2.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'typography-2', + url: 'http://localhost:9000/typography-2.html' +}] diff --git a/backstop/config/scenarios/utilization-bar-charts.js b/backstop/config/scenarios/utilization-bar-charts.js new file mode 100644 index 0000000000..b8cf98a9fa --- /dev/null +++ b/backstop/config/scenarios/utilization-bar-charts.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'utilization-bar-charts', + url: 'http://localhost:9000/utilization-bar-charts.html' +}] diff --git a/backstop/config/scenarios/wizard.js b/backstop/config/scenarios/wizard.js new file mode 100644 index 0000000000..0cd38f86b3 --- /dev/null +++ b/backstop/config/scenarios/wizard.js @@ -0,0 +1,4 @@ +module.exports = [{ + label: 'wizard', + url: 'http://localhost:9000/wizard.html' +}] diff --git a/backstop/reference.js b/backstop/reference.js new file mode 100644 index 0000000000..9919ff7836 --- /dev/null +++ b/backstop/reference.js @@ -0,0 +1,34 @@ +const path = require('path'); +const backstop = require('backstopjs'); +const config = require('./config'); + +try { + const cliArguments = process.argv.filter((current, index) => { + return index > 1; + }); + + // if arguments are passed only run the given scenarios + if (cliArguments.length) { + let scenarios = []; + + cliArguments.forEach((currentScenario) => { + let scenarioPath = path.join(__dirname, 'config', 'scenarios', `${currentScenario}.js`); + let scenario = require(scenarioPath); + + scenarios.push(...scenario); + }); + + config.scenarios = scenarios; + } + + backstop('reference', { config }) + .then(() => { + console.log('tests completed') + }) + .catch((err) => { + console.log(err); + }); + +} catch (e) { + console.log('Error: ', e.message); +} diff --git a/backstop/test.js b/backstop/test.js new file mode 100644 index 0000000000..9de184c37f --- /dev/null +++ b/backstop/test.js @@ -0,0 +1,34 @@ +const path = require('path'); +const backstop = require('backstopjs'); +const config = require('./config'); + +try { + const cliArguments = process.argv.filter((current, index) => { + return index > 1; + }); + + // if arguments are passed only run the given scenarios + if (cliArguments.length) { + let scenarios = []; + + cliArguments.forEach((currentScenario) => { + let scenarioPath = path.join(__dirname, 'config', 'scenarios', `${currentScenario}.js`); + let scenario = require(scenarioPath); + + scenarios.push(...scenario); + }); + + config.scenarios = scenarios; + } + + backstop('test', { config }) + .then(() => { + console.log('tests completed') + }) + .catch((err) => { + console.log(err); + }); + +} catch (e) { + console.log('Error: ', e.message); +} diff --git a/backstop_data/engine_scripts/chromy/onBefore.js b/backstop_data/engine_scripts/chromy/onBefore.js new file mode 100644 index 0000000000..aa67841589 --- /dev/null +++ b/backstop_data/engine_scripts/chromy/onBefore.js @@ -0,0 +1,4 @@ +module.exports = function (engine, scenario, vp) { + // This script runs before your app loads. Edit here to log-in, load cookies or set other states required for your test. + +}; diff --git a/backstop_data/engine_scripts/chromy/onReady.js b/backstop_data/engine_scripts/chromy/onReady.js new file mode 100644 index 0000000000..9188ae9429 --- /dev/null +++ b/backstop_data/engine_scripts/chromy/onReady.js @@ -0,0 +1,6 @@ +module.exports = function (engine, scenario, vp) { + engine.evaluate(function () { + // Your web-app is now loaded. Edit here to simulate user interacions or other state changes in the browser window context. + }); + +}; diff --git a/backstop_data/engine_scripts/onBefore.js b/backstop_data/engine_scripts/onBefore.js new file mode 100644 index 0000000000..aa67841589 --- /dev/null +++ b/backstop_data/engine_scripts/onBefore.js @@ -0,0 +1,4 @@ +module.exports = function (engine, scenario, vp) { + // This script runs before your app loads. Edit here to log-in, load cookies or set other states required for your test. + +}; diff --git a/backstop_data/engine_scripts/onReady.js b/backstop_data/engine_scripts/onReady.js new file mode 100644 index 0000000000..9188ae9429 --- /dev/null +++ b/backstop_data/engine_scripts/onReady.js @@ -0,0 +1,6 @@ +module.exports = function (engine, scenario, vp) { + engine.evaluate(function () { + // Your web-app is now loaded. Edit here to simulate user interacions or other state changes in the browser window context. + }); + +}; diff --git a/package.json b/package.json index 3a0d021333..71ec63980c 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "devDependencies": { "@commitlint/cli": "^3.2.0", "autoprefixer": "^6.4.0", + "backstopjs": "^3.0.26", + "chromy": "^0.5.5", "commitizen": "^2.9.6", "commitlint-config-cz": "^0.5.0", "connect-livereload": "~0.5.4", @@ -93,7 +95,9 @@ "semantic-release-pre": "semantic-release pre", "commit": "git-cz", "commitmsg": "commitlint -e", - "ncu": "ncu --semverLevel minor -p" + "ncu": "ncu --semverLevel minor -p", + "regressions:reference": "node ./backstop/reference", + "regressions:test": "node ./backstop/test" }, "description": "This reference implementation of PatternFly is based on [Bootstrap v3](http://getbootstrap.com/). Think of PatternFly as a \"skinned\" version of Bootstrap with additional components and customizations.", "repository": {