From ff315c95fd604c551639b0ba9dd9056ea9d94419 Mon Sep 17 00:00:00 2001 From: Kenia <19161242+kaxcode@users.noreply.github.com> Date: Tue, 28 Jan 2020 09:25:52 -0500 Subject: [PATCH] ui: Implements the ember-page-title addon to the UI (#7118) * Installs ember-page-title 5.x * Adds a page title to all template files that need one * Adds an assertion step to test the page titles --- ui-v2/app/templates/application.hbs | 2 ++ ui-v2/app/templates/dc/acls/policies/edit.hbs | 9 ++++++ .../app/templates/dc/acls/policies/index.hbs | 5 ++++ ui-v2/app/templates/dc/acls/roles/edit.hbs | 9 ++++++ ui-v2/app/templates/dc/acls/roles/index.hbs | 5 ++++ ui-v2/app/templates/dc/acls/tokens/edit.hbs | 9 ++++++ ui-v2/app/templates/dc/acls/tokens/index.hbs | 5 ++++ ui-v2/app/templates/dc/intentions/edit.hbs | 6 ++++ ui-v2/app/templates/dc/intentions/index.hbs | 1 + ui-v2/app/templates/dc/kv/edit.hbs | 5 ++++ ui-v2/app/templates/dc/kv/index.hbs | 1 + ui-v2/app/templates/dc/nodes/index.hbs | 1 + ui-v2/app/templates/dc/nodes/show.hbs | 1 + ui-v2/app/templates/dc/nspaces/edit.hbs | 5 ++++ ui-v2/app/templates/dc/nspaces/index.hbs | 1 + ui-v2/app/templates/dc/services/index.hbs | 1 + ui-v2/app/templates/dc/services/instance.hbs | 1 + ui-v2/app/templates/dc/services/show.hbs | 1 + ui-v2/app/templates/head.hbs | 1 + ui-v2/app/templates/settings.hbs | 1 + ui-v2/package.json | 1 + .../dc/acls/policies/create.feature | 14 +++++++++ .../acceptance/dc/acls/policies/index.feature | 1 + .../dc/acls/policies/update.feature | 1 + .../acceptance/dc/acls/roles/create.feature | 14 +++++++++ .../acceptance/dc/acls/roles/index.feature | 1 + .../acceptance/dc/acls/roles/update.feature | 1 + .../acceptance/dc/acls/tokens/create.feature | 14 +++++++++ .../acceptance/dc/acls/tokens/index.feature | 1 + .../acceptance/dc/acls/tokens/update.feature | 1 + .../acceptance/dc/intentions/create.feature | 2 ++ .../acceptance/dc/intentions/update.feature | 2 ++ ui-v2/tests/acceptance/dc/kvs/create.feature | 14 +++++++++ ui-v2/tests/acceptance/dc/kvs/update.feature | 2 ++ ui-v2/tests/acceptance/dc/nodes/index.feature | 1 + ui-v2/tests/acceptance/dc/nodes/show.feature | 1 + .../acceptance/dc/nspaces/create.feature | 14 +++++++++ .../tests/acceptance/dc/nspaces/index.feature | 1 + .../acceptance/dc/nspaces/update.feature | 1 + .../acceptance/dc/services/index.feature | 1 + .../dc/services/instances/show.feature | 1 + .../tests/acceptance/dc/services/show.feature | 2 ++ ui-v2/tests/acceptance/settings/show.feature | 9 ++++++ .../steps/dc/acls/policies/create-steps.js | 10 +++++++ .../steps/dc/acls/roles/create-steps.js | 10 +++++++ .../steps/dc/acls/tokens/create-steps.js | 10 +++++++ .../acceptance/steps/dc/kvs/create-steps.js | 10 +++++++ .../steps/dc/nspaces/create-steps.js | 10 +++++++ .../acceptance/steps/settings/show-steps.js | 10 +++++++ ui-v2/tests/index.html | 2 +- ui-v2/tests/pages/settings.js | 2 +- ui-v2/tests/steps/assertions/dom.js | 3 ++ ui-v2/yarn.lock | 29 +++++++++++++++++-- 53 files changed, 262 insertions(+), 4 deletions(-) create mode 100644 ui-v2/app/templates/head.hbs create mode 100644 ui-v2/tests/acceptance/dc/acls/policies/create.feature create mode 100644 ui-v2/tests/acceptance/dc/acls/roles/create.feature create mode 100644 ui-v2/tests/acceptance/dc/acls/tokens/create.feature create mode 100644 ui-v2/tests/acceptance/dc/kvs/create.feature create mode 100644 ui-v2/tests/acceptance/dc/nspaces/create.feature create mode 100644 ui-v2/tests/acceptance/settings/show.feature create mode 100644 ui-v2/tests/acceptance/steps/dc/acls/policies/create-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/acls/roles/create-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/acls/tokens/create-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/kvs/create-steps.js create mode 100644 ui-v2/tests/acceptance/steps/dc/nspaces/create-steps.js create mode 100644 ui-v2/tests/acceptance/steps/settings/show-steps.js diff --git a/ui-v2/app/templates/application.hbs b/ui-v2/app/templates/application.hbs index cb184b786a..8913170dbf 100644 --- a/ui-v2/app/templates/application.hbs +++ b/ui-v2/app/templates/application.hbs @@ -1,3 +1,5 @@ +{{head-layout}} +{{title 'Consul' separator=' - '}} {{#if (not loading)}} {{outlet}} {{else}} diff --git a/ui-v2/app/templates/dc/acls/policies/edit.hbs b/ui-v2/app/templates/dc/acls/policies/edit.hbs index eb0b599af7..903256432f 100644 --- a/ui-v2/app/templates/dc/acls/policies/edit.hbs +++ b/ui-v2/app/templates/dc/acls/policies/edit.hbs @@ -1,3 +1,12 @@ +{{#if isAuthorized }} + {{#if create }} + {{title 'New Policy'}} + {{else}} + {{title 'Edit Policy'}} + {{/if}} +{{else}} + {{title 'Access Controls'}} +{{/if}} {{#app-view class=(concat 'policy ' (if (or isAuthorized isEnabled) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/acls/policies/notifications'}} diff --git a/ui-v2/app/templates/dc/acls/policies/index.hbs b/ui-v2/app/templates/dc/acls/policies/index.hbs index 3f34079e63..3641d0f76e 100644 --- a/ui-v2/app/templates/dc/acls/policies/index.hbs +++ b/ui-v2/app/templates/dc/acls/policies/index.hbs @@ -1,3 +1,8 @@ +{{#if isAuthorized }} + {{title 'Policies'}} +{{else}} + {{title 'Access Controls'}} +{{/if}} {{#app-view class=(concat 'policy ' (if (not isAuthorized) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/acls/policies/notifications'}} diff --git a/ui-v2/app/templates/dc/acls/roles/edit.hbs b/ui-v2/app/templates/dc/acls/roles/edit.hbs index e7464738cc..090553d9cc 100644 --- a/ui-v2/app/templates/dc/acls/roles/edit.hbs +++ b/ui-v2/app/templates/dc/acls/roles/edit.hbs @@ -1,3 +1,12 @@ +{{#if isAuthorized }} + {{#if item.ID}} + {{title 'Edit Role'}} + {{else}} + {{title 'New Role'}} + {{/if}} +{{else}} + {{title 'Access Controls'}} +{{/if}} {{#app-view class=(concat 'role ' (if (or isAuthorized isEnabled) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/acls/roles/notifications'}} diff --git a/ui-v2/app/templates/dc/acls/roles/index.hbs b/ui-v2/app/templates/dc/acls/roles/index.hbs index c455b62db0..b4cf6ed390 100644 --- a/ui-v2/app/templates/dc/acls/roles/index.hbs +++ b/ui-v2/app/templates/dc/acls/roles/index.hbs @@ -1,3 +1,8 @@ +{{#if isAuthorized }} + {{title 'Roles'}} +{{else}} + {{title 'Access Controls'}} +{{/if}} {{#app-view class=(concat 'role ' (if (not isAuthorized) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/acls/roles/notifications'}} diff --git a/ui-v2/app/templates/dc/acls/tokens/edit.hbs b/ui-v2/app/templates/dc/acls/tokens/edit.hbs index 86dbfaf6d0..ea4d80b26b 100644 --- a/ui-v2/app/templates/dc/acls/tokens/edit.hbs +++ b/ui-v2/app/templates/dc/acls/tokens/edit.hbs @@ -1,3 +1,12 @@ +{{#if isAuthorized }} + {{#if create}} + {{title 'New Token'}} + {{else}} + {{title 'Edit Token'}} + {{/if}} +{{else}} + {{title 'Access Controls'}} +{{/if}} {{#app-view class=(concat 'token ' (if (or isAuthorized isEnabled) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/acls/tokens/notifications'}} diff --git a/ui-v2/app/templates/dc/acls/tokens/index.hbs b/ui-v2/app/templates/dc/acls/tokens/index.hbs index 30368466ee..72f57861c5 100644 --- a/ui-v2/app/templates/dc/acls/tokens/index.hbs +++ b/ui-v2/app/templates/dc/acls/tokens/index.hbs @@ -1,3 +1,8 @@ +{{#if isAuthorized }} + {{title 'Tokens'}} +{{else}} + {{title 'Access Controls'}} +{{/if}} {{#app-view class=(concat 'token ' (if (and isEnabled (not isAuthorized)) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} {{#block-slot name='notification' as |status type subject|}} {{partial 'dc/acls/tokens/notifications'}} diff --git a/ui-v2/app/templates/dc/intentions/edit.hbs b/ui-v2/app/templates/dc/intentions/edit.hbs index bf9f300744..a25393d077 100644 --- a/ui-v2/app/templates/dc/intentions/edit.hbs +++ b/ui-v2/app/templates/dc/intentions/edit.hbs @@ -1,3 +1,9 @@ +{{#if item.ID }} + {{title 'Edit Intention'}} +{{else}} + {{title 'New Intention'}} +{{/if}} + {{#app-view class="intention edit" loading=isLoading}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/intentions/notifications'}} diff --git a/ui-v2/app/templates/dc/intentions/index.hbs b/ui-v2/app/templates/dc/intentions/index.hbs index 461589101a..af75a6d4e0 100644 --- a/ui-v2/app/templates/dc/intentions/index.hbs +++ b/ui-v2/app/templates/dc/intentions/index.hbs @@ -1,3 +1,4 @@ +{{title 'Intentions'}} {{#app-view class="intention list"}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/intentions/notifications'}} diff --git a/ui-v2/app/templates/dc/kv/edit.hbs b/ui-v2/app/templates/dc/kv/edit.hbs index c639d663e3..52993294f5 100644 --- a/ui-v2/app/templates/dc/kv/edit.hbs +++ b/ui-v2/app/templates/dc/kv/edit.hbs @@ -1,3 +1,8 @@ +{{#if create }} + {{title 'New Key/Value'}} +{{else}} + {{title 'Edit Key/Value'}} +{{/if}} {{#app-view class="kv edit" loading=isLoading}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/kv/notifications'}} diff --git a/ui-v2/app/templates/dc/kv/index.hbs b/ui-v2/app/templates/dc/kv/index.hbs index 1ab92b8386..f5a106bfd5 100644 --- a/ui-v2/app/templates/dc/kv/index.hbs +++ b/ui-v2/app/templates/dc/kv/index.hbs @@ -1,3 +1,4 @@ +{{title 'Key/Value'}} {{#app-view class="kv list" loading=isLoading}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/kv/notifications'}} diff --git a/ui-v2/app/templates/dc/nodes/index.hbs b/ui-v2/app/templates/dc/nodes/index.hbs index 39d205af84..2ee84df0fc 100644 --- a/ui-v2/app/templates/dc/nodes/index.hbs +++ b/ui-v2/app/templates/dc/nodes/index.hbs @@ -1,3 +1,4 @@ +{{title 'Nodes'}} {{#app-view class="node list"}} {{#block-slot name='header'}}

diff --git a/ui-v2/app/templates/dc/nodes/show.hbs b/ui-v2/app/templates/dc/nodes/show.hbs index fb27c75a76..e2b69aefea 100644 --- a/ui-v2/app/templates/dc/nodes/show.hbs +++ b/ui-v2/app/templates/dc/nodes/show.hbs @@ -1,3 +1,4 @@ +{{title item.Node}} {{#app-view class="node show"}} {{#block-slot name='notification' as |status type|}} {{!TODO: Move sessions to its own folder within nodes }} diff --git a/ui-v2/app/templates/dc/nspaces/edit.hbs b/ui-v2/app/templates/dc/nspaces/edit.hbs index 2913e619ea..11b3ee5742 100644 --- a/ui-v2/app/templates/dc/nspaces/edit.hbs +++ b/ui-v2/app/templates/dc/nspaces/edit.hbs @@ -1,3 +1,8 @@ +{{#if create }} + {{title 'New Namespace'}} +{{else}} + {{title 'Edit Namespace'}} +{{/if}} {{#app-view class="nspace edit" loading=isLoading}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/nspaces/notifications'}} diff --git a/ui-v2/app/templates/dc/nspaces/index.hbs b/ui-v2/app/templates/dc/nspaces/index.hbs index 0a45624950..70afbdd835 100644 --- a/ui-v2/app/templates/dc/nspaces/index.hbs +++ b/ui-v2/app/templates/dc/nspaces/index.hbs @@ -1,3 +1,4 @@ +{{title 'Namespaces'}} {{#app-view class="nspace list" loading=isLoading}} {{#block-slot name='notification' as |status type subject|}} {{partial 'dc/nspaces/notifications'}} diff --git a/ui-v2/app/templates/dc/services/index.hbs b/ui-v2/app/templates/dc/services/index.hbs index d27a8972e5..1484086167 100644 --- a/ui-v2/app/templates/dc/services/index.hbs +++ b/ui-v2/app/templates/dc/services/index.hbs @@ -1,3 +1,4 @@ +{{title 'Services'}} {{#app-view class="service list"}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/services/notifications'}} diff --git a/ui-v2/app/templates/dc/services/instance.hbs b/ui-v2/app/templates/dc/services/instance.hbs index cf458dcb21..6b6d13fd13 100644 --- a/ui-v2/app/templates/dc/services/instance.hbs +++ b/ui-v2/app/templates/dc/services/instance.hbs @@ -1,3 +1,4 @@ +{{title item.ID}} {{#app-view class="instance show"}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/services/notifications'}} diff --git a/ui-v2/app/templates/dc/services/show.hbs b/ui-v2/app/templates/dc/services/show.hbs index 515d529fe9..123db4d878 100644 --- a/ui-v2/app/templates/dc/services/show.hbs +++ b/ui-v2/app/templates/dc/services/show.hbs @@ -1,3 +1,4 @@ +{{title item.Service.Service}} {{#app-view class="service show"}} {{#block-slot name='notification' as |status type|}} {{partial 'dc/services/notifications'}} diff --git a/ui-v2/app/templates/head.hbs b/ui-v2/app/templates/head.hbs new file mode 100644 index 0000000000..d2eda4f162 --- /dev/null +++ b/ui-v2/app/templates/head.hbs @@ -0,0 +1 @@ +{{model.title}} diff --git a/ui-v2/app/templates/settings.hbs b/ui-v2/app/templates/settings.hbs index d95da24b7d..b52a027675 100644 --- a/ui-v2/app/templates/settings.hbs +++ b/ui-v2/app/templates/settings.hbs @@ -1,3 +1,4 @@ +{{title "Settings"}} {{#hashicorp-consul id="wrapper" permissions=permissions dcs=dcs dc=dc nspaces=nspaces nspace=nspace}} {{#app-view class="settings show"}} {{#block-slot name='header'}} diff --git a/ui-v2/package.json b/ui-v2/package.json index 146da0812e..ae94300c50 100644 --- a/ui-v2/package.json +++ b/ui-v2/package.json @@ -86,6 +86,7 @@ "ember-load-initializers": "^2.0.0", "ember-math-helpers": "^2.4.0", "ember-maybe-import-regenerator": "^0.1.6", + "ember-page-title": "^5.1.0", "ember-power-select": "^3.0.3", "ember-power-select-with-create": "^0.6.0", "ember-qunit": "^4.4.1", diff --git a/ui-v2/tests/acceptance/dc/acls/policies/create.feature b/ui-v2/tests/acceptance/dc/acls/policies/create.feature new file mode 100644 index 0000000000..24cd493921 --- /dev/null +++ b/ui-v2/tests/acceptance/dc/acls/policies/create.feature @@ -0,0 +1,14 @@ +@setupApplicationTest +Feature: dc / acls / policies / create + Scenario: + Given 1 datacenter model with the value "datacenter" + When I visit the policy page for yaml + --- + dc: datacenter + --- + Then the url should be /datacenter/acls/policies/create + And the title should be "New Policy - Consul" + +@ignore + Scenario: Test we can create a ACLs Policy + Then ok diff --git a/ui-v2/tests/acceptance/dc/acls/policies/index.feature b/ui-v2/tests/acceptance/dc/acls/policies/index.feature index 103a3ec3e4..aba5280c56 100644 --- a/ui-v2/tests/acceptance/dc/acls/policies/index.feature +++ b/ui-v2/tests/acceptance/dc/acls/policies/index.feature @@ -10,6 +10,7 @@ Feature: dc / acls / policies / index: ACL Policy List --- Then the url should be /dc-1/acls/policies Then I see 3 policy models + And the title should be "Policies - Consul" Scenario: Searching the policies Given 1 datacenter model with the value "dc-1" And 3 policy models from yaml diff --git a/ui-v2/tests/acceptance/dc/acls/policies/update.feature b/ui-v2/tests/acceptance/dc/acls/policies/update.feature index 826de3b93c..22dc67d57a 100644 --- a/ui-v2/tests/acceptance/dc/acls/policies/update.feature +++ b/ui-v2/tests/acceptance/dc/acls/policies/update.feature @@ -15,6 +15,7 @@ Feature: dc / acls / policies / update: ACL Policy Update --- Then the url should be /datacenter/acls/policies/policy-id Then I see 3 token models + And the title should be "Edit Policy - Consul" Scenario: Update to [Name], [Rules], [Description] Then I fill in the policy form with yaml --- diff --git a/ui-v2/tests/acceptance/dc/acls/roles/create.feature b/ui-v2/tests/acceptance/dc/acls/roles/create.feature new file mode 100644 index 0000000000..cd46b02ec9 --- /dev/null +++ b/ui-v2/tests/acceptance/dc/acls/roles/create.feature @@ -0,0 +1,14 @@ +@setupApplicationTest +Feature: dc / acls / roles / create + Scenario: + Given 1 datacenter model with the value "datacenter" + When I visit the role page for yaml + --- + dc: datacenter + --- + Then the url should be /datacenter/acls/roles/create + And the title should be "New Role - Consul" + +@ignore + Scenario: Test we can create a ACLs role + Then ok diff --git a/ui-v2/tests/acceptance/dc/acls/roles/index.feature b/ui-v2/tests/acceptance/dc/acls/roles/index.feature index 206e4ae5e7..9df74fa052 100644 --- a/ui-v2/tests/acceptance/dc/acls/roles/index.feature +++ b/ui-v2/tests/acceptance/dc/acls/roles/index.feature @@ -10,6 +10,7 @@ Feature: dc / acls / roles / index: ACL Roles List --- Then the url should be /dc-1/acls/roles Then I see 3 role models + And the title should be "Roles - Consul" Scenario: Searching the roles Given 1 datacenter model with the value "dc-1" And 3 role models from yaml diff --git a/ui-v2/tests/acceptance/dc/acls/roles/update.feature b/ui-v2/tests/acceptance/dc/acls/roles/update.feature index 9493436212..f039b85518 100644 --- a/ui-v2/tests/acceptance/dc/acls/roles/update.feature +++ b/ui-v2/tests/acceptance/dc/acls/roles/update.feature @@ -14,6 +14,7 @@ Feature: dc / acls / roles / update: ACL Role Update --- Then the url should be /datacenter/acls/roles/role-id Then I see 3 token models + And the title should be "Edit Role - Consul" Scenario: Update to [Name], [Rules], [Description] Then I fill in the role form with yaml --- diff --git a/ui-v2/tests/acceptance/dc/acls/tokens/create.feature b/ui-v2/tests/acceptance/dc/acls/tokens/create.feature new file mode 100644 index 0000000000..a536224e12 --- /dev/null +++ b/ui-v2/tests/acceptance/dc/acls/tokens/create.feature @@ -0,0 +1,14 @@ +@setupApplicationTest +Feature: dc / acls / tokens / create + Scenario: + Given 1 datacenter model with the value "datacenter" + When I visit the token page for yaml + --- + dc: datacenter + --- + Then the url should be /datacenter/acls/tokens/create + And the title should be "New Token - Consul" + +@ignore + Scenario: Test we can create a ACLs Token + Then ok diff --git a/ui-v2/tests/acceptance/dc/acls/tokens/index.feature b/ui-v2/tests/acceptance/dc/acls/tokens/index.feature index 09c4a32c62..5645f9c473 100644 --- a/ui-v2/tests/acceptance/dc/acls/tokens/index.feature +++ b/ui-v2/tests/acceptance/dc/acls/tokens/index.feature @@ -9,6 +9,7 @@ Feature: dc / acls / tokens / index: ACL Token List dc: dc-1 --- Then the url should be /dc-1/acls/tokens + And the title should be "Tokens - Consul" Then I see 3 token models Scenario: Searching the tokens Given 1 datacenter model with the value "dc-1" diff --git a/ui-v2/tests/acceptance/dc/acls/tokens/update.feature b/ui-v2/tests/acceptance/dc/acls/tokens/update.feature index d241f4912d..44106f0f00 100644 --- a/ui-v2/tests/acceptance/dc/acls/tokens/update.feature +++ b/ui-v2/tests/acceptance/dc/acls/tokens/update.feature @@ -13,6 +13,7 @@ Feature: dc / acls / tokens / update: ACL Token Update token: key --- Then the url should be /datacenter/acls/tokens/key + And the title should be "Edit Token - Consul" Scenario: Update to [Name] Then I fill in with yaml --- diff --git a/ui-v2/tests/acceptance/dc/intentions/create.feature b/ui-v2/tests/acceptance/dc/intentions/create.feature index 2043efa65f..d4aa9a1c70 100644 --- a/ui-v2/tests/acceptance/dc/intentions/create.feature +++ b/ui-v2/tests/acceptance/dc/intentions/create.feature @@ -19,6 +19,7 @@ Feature: dc / intentions / create: Intention Create dc: datacenter --- Then the url should be /datacenter/intentions/create + And the title should be "New Intention - Consul" # Set source And I click "[data-test-source-element] .ember-power-select-trigger" And I type "web" into ".ember-power-select-search-input" @@ -39,5 +40,6 @@ Feature: dc / intentions / create: Intention Create Action: deny --- Then the url should be /datacenter/intentions + And the title should be "Intentions - Consul" And "[data-notification]" has the "notification-create" class And "[data-notification]" has the "success" class diff --git a/ui-v2/tests/acceptance/dc/intentions/update.feature b/ui-v2/tests/acceptance/dc/intentions/update.feature index 84f4d1c625..7617d4580f 100644 --- a/ui-v2/tests/acceptance/dc/intentions/update.feature +++ b/ui-v2/tests/acceptance/dc/intentions/update.feature @@ -12,6 +12,7 @@ Feature: dc / intentions / update: Intention Update intention: intention-id --- Then the url should be /datacenter/intentions/intention-id + And the title should be "Edit Intention - Consul" Scenario: Update to [Description], [Action] Then I fill in with yaml --- @@ -25,6 +26,7 @@ Feature: dc / intentions / update: Intention Update Action: [Action] --- Then the url should be /datacenter/intentions + And the title should be "Intentions - Consul" And "[data-notification]" has the "notification-update" class And "[data-notification]" has the "success" class Where: diff --git a/ui-v2/tests/acceptance/dc/kvs/create.feature b/ui-v2/tests/acceptance/dc/kvs/create.feature new file mode 100644 index 0000000000..097703c01e --- /dev/null +++ b/ui-v2/tests/acceptance/dc/kvs/create.feature @@ -0,0 +1,14 @@ +@setupApplicationTest +Feature: dc / kvs / create + Scenario: + Given 1 datacenter model with the value "datacenter" + When I visit the kv page for yaml + --- + dc: datacenter + --- + Then the url should be /datacenter/kv/create + And the title should be "New Key/Value - Consul" + +@ignore + Scenario: Test we can create a KV + Then ok diff --git a/ui-v2/tests/acceptance/dc/kvs/update.feature b/ui-v2/tests/acceptance/dc/kvs/update.feature index 706774ac77..8f9b0a0ab0 100644 --- a/ui-v2/tests/acceptance/dc/kvs/update.feature +++ b/ui-v2/tests/acceptance/dc/kvs/update.feature @@ -13,6 +13,7 @@ Feature: dc / kvs / update: KV Update kv: "[Name]" --- Then the url should be /datacenter/kv/[EncodedName]/edit + And the title should be "Edit Key/Value - Consul" # Turn the Code Editor off so we can fill the value easier And I click "[name=json]" Then I fill in with yaml @@ -52,6 +53,7 @@ Feature: dc / kvs / update: KV Update And I submit Then a PUT request was made to "/v1/kv/key?dc=datacenter&ns=@!namespace" with the body " " Then the url should be /datacenter/kv + And the title should be "Key/Value - Consul" And "[data-notification]" has the "notification-update" class And "[data-notification]" has the "success" class Scenario: Update to a key change value to '' diff --git a/ui-v2/tests/acceptance/dc/nodes/index.feature b/ui-v2/tests/acceptance/dc/nodes/index.feature index 9eb963024d..4fecaa932c 100644 --- a/ui-v2/tests/acceptance/dc/nodes/index.feature +++ b/ui-v2/tests/acceptance/dc/nodes/index.feature @@ -14,6 +14,7 @@ Feature: dc / nodes / index dc: dc-1 --- Then the url should be /dc-1/nodes + And the title should be "Nodes - Consul" Then I see 3 node models Scenario: Seeing the leader in unhealthy listing Given 3 node models from yaml diff --git a/ui-v2/tests/acceptance/dc/nodes/show.feature b/ui-v2/tests/acceptance/dc/nodes/show.feature index 2a5012e843..4105922feb 100644 --- a/ui-v2/tests/acceptance/dc/nodes/show.feature +++ b/ui-v2/tests/acceptance/dc/nodes/show.feature @@ -75,6 +75,7 @@ Feature: dc / nodes / show: Show node node: node-0 --- Then the url should be /dc1/nodes/node-0 + And the title should be "node-0 - Consul" And the url "/v1/internal/ui/node/node-0" responds with a 404 status And pause until I see the text "no longer exists" in "[data-notification]" @ignore diff --git a/ui-v2/tests/acceptance/dc/nspaces/create.feature b/ui-v2/tests/acceptance/dc/nspaces/create.feature new file mode 100644 index 0000000000..a03f66deaa --- /dev/null +++ b/ui-v2/tests/acceptance/dc/nspaces/create.feature @@ -0,0 +1,14 @@ +@setupApplicationTest +Feature: dc / acls / nspaces / create + Scenario: + Given 1 datacenter model with the value "datacenter" + When I visit the nspace page for yaml + --- + dc: datacenter + --- + Then the url should be /datacenter/namespaces/create + And the title should be "New Namespace - Consul" + +@ignore + Scenario: Test we can create a Namespace + Then ok diff --git a/ui-v2/tests/acceptance/dc/nspaces/index.feature b/ui-v2/tests/acceptance/dc/nspaces/index.feature index e3e56e821b..095baa36cd 100644 --- a/ui-v2/tests/acceptance/dc/nspaces/index.feature +++ b/ui-v2/tests/acceptance/dc/nspaces/index.feature @@ -15,6 +15,7 @@ Feature: dc / nspaces / index: Nspaces List dc: dc-1 --- Then the url should be /dc-1/namespaces + And the title should be "Namespaces - Consul" Scenario: Then I see 3 nspace models Scenario: Searching the nspaces diff --git a/ui-v2/tests/acceptance/dc/nspaces/update.feature b/ui-v2/tests/acceptance/dc/nspaces/update.feature index 1213d54823..d97915223c 100644 --- a/ui-v2/tests/acceptance/dc/nspaces/update.feature +++ b/ui-v2/tests/acceptance/dc/nspaces/update.feature @@ -14,6 +14,7 @@ Feature: dc / nspaces / update: Nspace Update namespace: namespace --- Then the url should be /datacenter/namespaces/namespace + And the title should be "Edit Namespace - Consul" Scenario: Update to [Description] Then I fill in with yaml --- diff --git a/ui-v2/tests/acceptance/dc/services/index.feature b/ui-v2/tests/acceptance/dc/services/index.feature index f921812412..d9df27df95 100644 --- a/ui-v2/tests/acceptance/dc/services/index.feature +++ b/ui-v2/tests/acceptance/dc/services/index.feature @@ -26,6 +26,7 @@ Feature: dc / services / index: List Services dc: dc-1 --- Then the url should be /dc-1/services + And the title should be "Services - Consul" Then I see 6 service models And I see externalSource on the services like yaml --- diff --git a/ui-v2/tests/acceptance/dc/services/instances/show.feature b/ui-v2/tests/acceptance/dc/services/instances/show.feature index 752db0c259..f1846223e2 100644 --- a/ui-v2/tests/acceptance/dc/services/instances/show.feature +++ b/ui-v2/tests/acceptance/dc/services/instances/show.feature @@ -81,6 +81,7 @@ Feature: dc / services / instances / show: Show Service Instance When I click metaData on the tabs And I see metaDataIsSelected on the tabs And I see 3 of the metaData object + And the title should be "service-0-with-id - Consul" Scenario: A Service instance warns when deregistered whilst blocking Given settings from yaml diff --git a/ui-v2/tests/acceptance/dc/services/show.feature b/ui-v2/tests/acceptance/dc/services/show.feature index 31ad75bc0d..4a655334d8 100644 --- a/ui-v2/tests/acceptance/dc/services/show.feature +++ b/ui-v2/tests/acceptance/dc/services/show.feature @@ -16,6 +16,8 @@ Feature: dc / services / show: Show Service service: service-0 --- Then I see externalSource like "consul" + And the title should be "service-0 - Consul" + Scenario: Given a service with an 'unsupported' external source, there is no logo Given 1 datacenter model with the value "dc1" And 1 node models diff --git a/ui-v2/tests/acceptance/settings/show.feature b/ui-v2/tests/acceptance/settings/show.feature new file mode 100644 index 0000000000..fd13061ec8 --- /dev/null +++ b/ui-v2/tests/acceptance/settings/show.feature @@ -0,0 +1,9 @@ +@setupApplicationTest +@notNamespaceable + +Feature: settings / show: Show Settings Page + Scenario: + Given 1 datacenter model with the value "datacenter" + When I visit the settings page + Then the url should be /setting + And the title should be "Settings - Consul" diff --git a/ui-v2/tests/acceptance/steps/dc/acls/policies/create-steps.js b/ui-v2/tests/acceptance/steps/dc/acls/policies/create-steps.js new file mode 100644 index 0000000000..3231912b98 --- /dev/null +++ b/ui-v2/tests/acceptance/steps/dc/acls/policies/create-steps.js @@ -0,0 +1,10 @@ +import steps from '../../../steps'; + +// step definitions that are shared between features should be moved to the +// tests/acceptance/steps/steps.js file + +export default function(assert) { + return steps(assert).then('I should find a file', function() { + assert.ok(true, this.step); + }); +} diff --git a/ui-v2/tests/acceptance/steps/dc/acls/roles/create-steps.js b/ui-v2/tests/acceptance/steps/dc/acls/roles/create-steps.js new file mode 100644 index 0000000000..3231912b98 --- /dev/null +++ b/ui-v2/tests/acceptance/steps/dc/acls/roles/create-steps.js @@ -0,0 +1,10 @@ +import steps from '../../../steps'; + +// step definitions that are shared between features should be moved to the +// tests/acceptance/steps/steps.js file + +export default function(assert) { + return steps(assert).then('I should find a file', function() { + assert.ok(true, this.step); + }); +} diff --git a/ui-v2/tests/acceptance/steps/dc/acls/tokens/create-steps.js b/ui-v2/tests/acceptance/steps/dc/acls/tokens/create-steps.js new file mode 100644 index 0000000000..3231912b98 --- /dev/null +++ b/ui-v2/tests/acceptance/steps/dc/acls/tokens/create-steps.js @@ -0,0 +1,10 @@ +import steps from '../../../steps'; + +// step definitions that are shared between features should be moved to the +// tests/acceptance/steps/steps.js file + +export default function(assert) { + return steps(assert).then('I should find a file', function() { + assert.ok(true, this.step); + }); +} diff --git a/ui-v2/tests/acceptance/steps/dc/kvs/create-steps.js b/ui-v2/tests/acceptance/steps/dc/kvs/create-steps.js new file mode 100644 index 0000000000..ba1093295f --- /dev/null +++ b/ui-v2/tests/acceptance/steps/dc/kvs/create-steps.js @@ -0,0 +1,10 @@ +import steps from '../../steps'; + +// step definitions that are shared between features should be moved to the +// tests/acceptance/steps/steps.js file + +export default function(assert) { + return steps(assert).then('I should find a file', function() { + assert.ok(true, this.step); + }); +} diff --git a/ui-v2/tests/acceptance/steps/dc/nspaces/create-steps.js b/ui-v2/tests/acceptance/steps/dc/nspaces/create-steps.js new file mode 100644 index 0000000000..ba1093295f --- /dev/null +++ b/ui-v2/tests/acceptance/steps/dc/nspaces/create-steps.js @@ -0,0 +1,10 @@ +import steps from '../../steps'; + +// step definitions that are shared between features should be moved to the +// tests/acceptance/steps/steps.js file + +export default function(assert) { + return steps(assert).then('I should find a file', function() { + assert.ok(true, this.step); + }); +} diff --git a/ui-v2/tests/acceptance/steps/settings/show-steps.js b/ui-v2/tests/acceptance/steps/settings/show-steps.js new file mode 100644 index 0000000000..3c9a76f69f --- /dev/null +++ b/ui-v2/tests/acceptance/steps/settings/show-steps.js @@ -0,0 +1,10 @@ +import steps from '../steps'; + +// step definitions that are shared between features should be moved to the +// tests/acceptance/steps/steps.js file + +export default function(assert) { + return steps(assert).then('I should find a file', function() { + assert.ok(true, this.step); + }); +} diff --git a/ui-v2/tests/index.html b/ui-v2/tests/index.html index 9fccbf2088..f841d34b91 100644 --- a/ui-v2/tests/index.html +++ b/ui-v2/tests/index.html @@ -3,7 +3,7 @@ - ConsulUi Tests + Consul {{content-for "head"}} diff --git a/ui-v2/tests/pages/settings.js b/ui-v2/tests/pages/settings.js index 6d94078808..3e858de933 100644 --- a/ui-v2/tests/pages/settings.js +++ b/ui-v2/tests/pages/settings.js @@ -1,5 +1,5 @@ export default function(visitable, submitable) { return submitable({ - visit: visitable('/settings'), + visit: visitable('/setting'), }); } diff --git a/ui-v2/tests/steps/assertions/dom.js b/ui-v2/tests/steps/assertions/dom.js index 0f0e2b1fb7..4716a2cfd5 100644 --- a/ui-v2/tests/steps/assertions/dom.js +++ b/ui-v2/tests/steps/assertions/dom.js @@ -69,5 +69,8 @@ export default function(scenario, assert, pauseUntil, find, currentURL, clipboar } const current = currentURL() || ''; assert.equal(current, url, `Expected the url to be ${url} was ${current}`); + }) + .then(['the title should be "$title"'], function(title) { + assert.equal(document.title, title, `Expected the document.title to equal "${title}"`); }); } diff --git a/ui-v2/yarn.lock b/ui-v2/yarn.lock index cde3c85eba..afcf2e7534 100644 --- a/ui-v2/yarn.lock +++ b/ui-v2/yarn.lock @@ -4428,7 +4428,7 @@ ember-cli-babel-plugin-helpers@^1.0.0, ember-cli-babel-plugin-helpers@^1.1.0: resolved "https://registry.yarnpkg.com/ember-cli-babel-plugin-helpers/-/ember-cli-babel-plugin-helpers-1.1.0.tgz#de3baedd093163b6c2461f95964888c1676325ac" integrity sha512-Zr4my8Xn+CzO0gIuFNXji0eTRml5AxZUTDQz/wsNJ5AJAtyFWCY4QtKdoELNNbiCVGt1lq5yLiwTm4scGKu6xA== -ember-cli-babel@^6.0.0, ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.0.0-beta.7, ember-cli-babel@^6.10.0, ember-cli-babel@^6.12.0, ember-cli-babel@^6.16.0, ember-cli-babel@^6.3.0, ember-cli-babel@^6.6.0, ember-cli-babel@^6.8.1, ember-cli-babel@^6.8.2, ember-cli-babel@^6.9.0, ember-cli-babel@^6.9.2: +ember-cli-babel@^6.0.0, ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.0.0-beta.7, ember-cli-babel@^6.10.0, ember-cli-babel@^6.11.0, ember-cli-babel@^6.12.0, ember-cli-babel@^6.16.0, ember-cli-babel@^6.3.0, ember-cli-babel@^6.6.0, ember-cli-babel@^6.8.1, ember-cli-babel@^6.8.2, ember-cli-babel@^6.9.0, ember-cli-babel@^6.9.2: version "6.18.0" resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-6.18.0.tgz#3f6435fd275172edeff2b634ee7b29ce74318957" integrity sha512-7ceC8joNYxY2wES16iIBlbPSxwKDBhYwC8drU3ZEvuPDMwVv1KzxCNu1fvxyFEBWhwaRNTUxSCsEVoTd9nosGA== @@ -4539,6 +4539,14 @@ ember-cli-get-component-path-option@^1.0.0: resolved "https://registry.yarnpkg.com/ember-cli-get-component-path-option/-/ember-cli-get-component-path-option-1.0.0.tgz#0d7b595559e2f9050abed804f1d8eff1b08bc771" integrity sha1-DXtZVVni+QUKvtgE8djv8bCLx3E= +ember-cli-head@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/ember-cli-head/-/ember-cli-head-0.4.1.tgz#28b7ee86439746640834b232a3b34ab1329f3cf3" + integrity sha512-MIgshw5nGil7Q/TU4SDRCsgsiA3wPC9WqOig/g1LlHTNXjR4vH7s/ddG7GTfK5Kt4ZQHJEUDXpd/lIbdBkIQ/Q== + dependencies: + ember-cli-babel "^6.11.0" + ember-cli-htmlbars "^2.0.3" + ember-cli-htmlbars-inline-precompile@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ember-cli-htmlbars-inline-precompile/-/ember-cli-htmlbars-inline-precompile-2.1.0.tgz#61b91ff1879d44ae504cadb46fb1f2604995ae08" @@ -4561,7 +4569,7 @@ ember-cli-htmlbars-inline-precompile@^3.0.0: heimdalljs-logger "^0.1.9" silent-error "^1.1.0" -ember-cli-htmlbars@^2.0.1: +ember-cli-htmlbars@^2.0.1, ember-cli-htmlbars@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/ember-cli-htmlbars/-/ember-cli-htmlbars-2.0.5.tgz#b5a105429a6bce4f7c9c97b667e3b8926e31397f" integrity sha512-3f3PAxdnQ/fhQa8XP/3z4RLRgLHxV8j4Ln75aHbRdemOCjBa048KxL9l+acRLhCulbGQCMnLiIUIC89PAzLrcA== @@ -4904,6 +4912,13 @@ ember-computed-style@^0.3.0: ember-compatibility-helpers "^1.2.0" ember-maybe-import-regenerator "^0.1.5" +ember-copy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ember-copy/-/ember-copy-1.0.0.tgz#426554ba6cf65920f31d24d0a3ca2cb1be16e4aa" + integrity sha512-aiZNAvOmdemHdvZNn0b5b/0d9g3JFpcOsrDgfhYEbfd7SzE0b69YiaVK2y3wjqfjuuiA54vOllGN4pjSzECNSw== + dependencies: + ember-cli-babel "^6.6.0" + ember-data@~3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/ember-data/-/ember-data-3.12.0.tgz#ce20c41163ce50124d12a4370641fd9b4a21c3e2" @@ -5037,6 +5052,16 @@ ember-native-dom-helpers@^0.5.3: broccoli-funnel "^1.1.0" ember-cli-babel "^6.6.0" +ember-page-title@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ember-page-title/-/ember-page-title-5.1.0.tgz#baf9fc00f95faf638f8493740a1f80daaa5007e9" + integrity sha512-Ou2kwvwlQdDxre20WUMDym54e+5r9g0lTINFiBZUavoBCOUYdBP711LbmmUIIlYblZTOb/TWadNEQZpd2DkIAg== + dependencies: + ember-cli-babel "^7.7.3" + ember-cli-head "^0.4.0" + ember-cli-htmlbars "^3.0.1" + ember-copy "^1.0.0" + ember-power-select-with-create@^0.6.0: version "0.6.2" resolved "https://registry.yarnpkg.com/ember-power-select-with-create/-/ember-power-select-with-create-0.6.2.tgz#05faf361c435f5c2c61c24e687aebddefd569897"