From 17ebf96755322f3519032088437395d3f52919f5 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Fri, 11 May 2018 13:47:21 +0100 Subject: [PATCH] WIP: Feature/acceptance tests --- ui-v2/.gitignore | 2 + ui-v2/GNUmakefile | 15 + .../components/tabular-collection.hbs | 2 +- .../app/templates/dc/nodes/-healthchecks.hbs | 4 +- ui-v2/app/templates/dc/nodes/-services.hbs | 5 +- ui-v2/ember-cli-build.js | 9 +- ui-v2/package.json | 12 +- .../acceptance/components/acl-filter.feature | 35 +++ .../components/catalog-filter.feature | 88 ++++++ .../acceptance/components/kv-filter.feature | 27 ++ ui-v2/tests/acceptance/dc/acls/update.feature | 38 +++ ui-v2/tests/acceptance/dc/index.feature | 8 + ui-v2/tests/acceptance/dc/kvs/update.feature | 32 ++ ui-v2/tests/acceptance/dc/list.feature | 20 ++ ui-v2/tests/acceptance/dc/nodes/index.feature | 11 + .../acceptance/dc/nodes/services.feature | 17 ++ ui-v2/tests/acceptance/dc/nodes/show.feature | 46 +++ .../acceptance/dc/services/index.feature | 11 + .../tests/acceptance/index-forwarding.feature | 6 + .../tests/acceptance/page-navigation.feature | 43 +++ .../steps/components/acl-filter-steps.js | 10 + .../steps/components/catalog-filter-steps.js | 10 + .../steps/components/kv-filter-steps.js | 10 + .../acceptance/steps/dc/acls/update-steps.js | 10 + .../tests/acceptance/steps/dc/index-steps.js | 10 + .../steps/dc/kv/index/view-kvs-steps.js | 10 + .../acceptance/steps/dc/kvs/update-steps.js | 10 + ui-v2/tests/acceptance/steps/dc/list-steps.js | 10 + .../acceptance/steps/dc/nodes/index-steps.js | 10 + .../steps/dc/nodes/index/view-nodes-steps.js | 10 + .../steps/dc/nodes/services-steps.js | 10 + .../acceptance/steps/dc/nodes/show-steps.js | 10 + .../steps/dc/services/index-steps.js | 10 + .../dc/services/index/view-services-steps.js | 10 + .../steps/index-forwarding-steps.js | 11 + .../acceptance/steps/page-navigation-steps.js | 10 + ui-v2/tests/acceptance/steps/steps.js | 2 + ui-v2/tests/helpers/api.js | 4 + ui-v2/tests/helpers/set-cookies.js | 25 ++ ui-v2/tests/helpers/type-to-url.js | 23 ++ ui-v2/tests/helpers/yadda-annotations.js | 85 ++++++ ui-v2/tests/helpers/yadda.js | 2 + ui-v2/tests/lib/page-object/visitable.js | 56 ++++ ui-v2/tests/pages/dc/acls/edit.js | 5 +- ui-v2/tests/pages/dc/kv/edit.js | 8 +- ui-v2/tests/pages/dc/kv/index.js | 6 +- ui-v2/tests/pages/dc/nodes/show.js | 8 +- ui-v2/tests/steps.js | 211 +++++++++++++ ui-v2/yarn.lock | 282 +++++++++++++++++- 49 files changed, 1285 insertions(+), 24 deletions(-) create mode 100644 ui-v2/tests/acceptance/components/acl-filter.feature create mode 100644 ui-v2/tests/acceptance/components/catalog-filter.feature create mode 100644 ui-v2/tests/acceptance/components/kv-filter.feature create mode 100644 ui-v2/tests/acceptance/dc/acls/update.feature create mode 100644 ui-v2/tests/acceptance/dc/index.feature create mode 100644 ui-v2/tests/acceptance/dc/kvs/update.feature create mode 100644 ui-v2/tests/acceptance/dc/list.feature create mode 100644 ui-v2/tests/acceptance/dc/nodes/index.feature create mode 100644 ui-v2/tests/acceptance/dc/nodes/services.feature create mode 100644 ui-v2/tests/acceptance/dc/nodes/show.feature create mode 100644 ui-v2/tests/acceptance/dc/services/index.feature create mode 100644 ui-v2/tests/acceptance/index-forwarding.feature create mode 100644 ui-v2/tests/acceptance/page-navigation.feature create mode 100644 ui-v2/tests/acceptance/steps/components/acl-filter-steps.js create mode 100644 ui-v2/tests/acceptance/steps/components/catalog-filter-steps.js create mode 100644 ui-v2/tests/acceptance/steps/components/kv-filter-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/acls/update-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/index-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/kv/index/view-kvs-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/kvs/update-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/list-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/nodes/index-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/nodes/index/view-nodes-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/nodes/services-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/nodes/show-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/services/index-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/services/index/view-services-steps.js create mode 100644 ui-v2/tests/acceptance/steps/index-forwarding-steps.js create mode 100644 ui-v2/tests/acceptance/steps/page-navigation-steps.js create mode 100644 ui-v2/tests/acceptance/steps/steps.js create mode 100644 ui-v2/tests/helpers/api.js create mode 100644 ui-v2/tests/helpers/set-cookies.js create mode 100644 ui-v2/tests/helpers/type-to-url.js create mode 100644 ui-v2/tests/helpers/yadda-annotations.js create mode 100644 ui-v2/tests/helpers/yadda.js create mode 100644 ui-v2/tests/lib/page-object/visitable.js create mode 100644 ui-v2/tests/steps.js diff --git a/ui-v2/.gitignore b/ui-v2/.gitignore index a76bc38188..8496799743 100644 --- a/ui-v2/.gitignore +++ b/ui-v2/.gitignore @@ -8,3 +8,5 @@ /yarn-error.log /testem.log +/public/consul-api-double + diff --git a/ui-v2/GNUmakefile b/ui-v2/GNUmakefile index 9b5cb8ba9b..49ac334569 100644 --- a/ui-v2/GNUmakefile +++ b/ui-v2/GNUmakefile @@ -13,3 +13,18 @@ format: yarn run format:js .PHONY: server dist lint format + +.DEFAULT_GOAL=all +.PHONY: deps test all build start +all: deps +deps: node_modules yarn.lock package.json +node_modules: + yarn +build: + yarn run build +start: + yarn run start +test: + yarn run test +test-view: + yarn run test:view diff --git a/ui-v2/app/templates/components/tabular-collection.hbs b/ui-v2/app/templates/components/tabular-collection.hbs index 5acb52bbae..313ae645fe 100644 --- a/ui-v2/app/templates/components/tabular-collection.hbs +++ b/ui-v2/app/templates/components/tabular-collection.hbs @@ -10,7 +10,7 @@ {{#ember-native-scrollable tagName='tbody' content-size=_contentSize scroll-left=_scrollLeft scroll-top=_scrollTop scrollChange=(action "scrollChange") clientSizeChange=(action "clientSizeChange")}} {{~#each _cells as |cell|~}} - + {{#yield-slot 'row'}}{{yield cell.item cell.index}}{{/yield-slot}} {{#if hasActions }} diff --git a/ui-v2/app/templates/dc/nodes/-healthchecks.hbs b/ui-v2/app/templates/dc/nodes/-healthchecks.hbs index 772989797b..d199676133 100644 --- a/ui-v2/app/templates/dc/nodes/-healthchecks.hbs +++ b/ui-v2/app/templates/dc/nodes/-healthchecks.hbs @@ -1,6 +1,6 @@ -