ui: update tab nav steps to use `isVisible` vs `clickable` (#14517)

* Add `isVisible` property to tab-nav page-object

* Use `IsVisible` when testing visibility of tabs
pull/14520/head
Michael Klein 2022-09-08 12:46:49 +02:00 committed by GitHub
parent e81f29f4b8
commit 3599aea1c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 20 additions and 19 deletions

View File

@ -1,4 +1,4 @@
import { is, clickable, attribute } from 'ember-cli-page-object'; import { is, clickable, attribute, isVisible } from 'ember-cli-page-object';
import ucfirst from 'consul-ui/utils/ucfirst'; import ucfirst from 'consul-ui/utils/ucfirst';
export default function(name, items, blankKey = 'all') { export default function(name, items, blankKey = 'all') {
return items.reduce(function(prev, item, i, arr) { return items.reduce(function(prev, item, i, arr) {
@ -19,6 +19,7 @@ export default function(name, items, blankKey = 'all') {
[`${key}IsSelected`]: is('.selected', `[data-test-tab="${name}_${item}"]`), [`${key}IsSelected`]: is('.selected', `[data-test-tab="${name}_${item}"]`),
[`${key}Url`]: attribute('href', `[data-test-tab="${name}_${item}"] a`), [`${key}Url`]: attribute('href', `[data-test-tab="${name}_${item}"] a`),
[key]: clickable(`[data-test-tab="${name}_${item}"] a`), [key]: clickable(`[data-test-tab="${name}_${item}"] a`),
[`${key}IsVisible`]: isVisible(`[data-test-tab="${name}_${item}"] a`),
}, },
}; };
}, {}); }, {});

View File

@ -54,10 +54,10 @@ Feature: dc / nodes / show: Show node
node: node-0 node: node-0
--- ---
And I see serviceInstancesIsSelected on the tabs And I see serviceInstancesIsSelected on the tabs
And I see healthChecks on the tabs And I see healthChecksIsVisible on the tabs
And I see serviceInstances on the tabs And I see serviceInstancesIsVisible on the tabs
And I don't see roundTripTime on the tabs And I don't see roundTripTime on the tabs
And I see lockSessions on the tabs And I see lockSessionsIsVisible on the tabs
Scenario: A node warns when deregistered whilst blocking Scenario: A node warns when deregistered whilst blocking
Given 1 node model from yaml Given 1 node model from yaml
--- ---

View File

@ -33,7 +33,7 @@ Feature: dc / services / instances / Exposed Paths
id: service-0-with-id id: service-0-with-id
--- ---
Then the url should be /dc1/services/service-0/instances/node-0/service-0-with-id/health-checks Then the url should be /dc1/services/service-0/instances/node-0/service-0-with-id/health-checks
And I see exposedPaths on the tabs And I see exposedPathsIsVisible on the tabs
When I click exposedPaths on the tabs When I click exposedPaths on the tabs

View File

@ -33,7 +33,7 @@ Feature: dc / services / instances / Upstreams
id: service-0-with-id id: service-0-with-id
--- ---
Then the url should be /dc1/services/service-0/instances/node-0/service-0-with-id/health-checks Then the url should be /dc1/services/service-0/instances/node-0/service-0-with-id/health-checks
And I see upstreams on the tabs And I see upstreamsIsVisible on the tabs
When I click upstreams on the tabs When I click upstreams on the tabs

View File

@ -15,7 +15,7 @@ Feature: dc / services / show-routing: Show Routing for Service
service: service-0 service: service-0
--- ---
And the title should be "service-0 - Consul" And the title should be "service-0 - Consul"
And I see routing on the tabs And I see routingIsVisible on the tabs
Scenario: Given connect is disabled, the Routing tab should not display or error Scenario: Given connect is disabled, the Routing tab should not display or error
Given 2 datacenter models from yaml Given 2 datacenter models from yaml
--- ---
@ -51,7 +51,7 @@ Feature: dc / services / show-routing: Show Routing for Service
dc: dc2 dc: dc2
service: service-1 service: service-1
--- ---
And I see routing on the tabs And I see routingIsVisible on the tabs
And I visit the service page for yaml And I visit the service page for yaml
--- ---
dc: dc1 dc: dc1

View File

@ -14,7 +14,7 @@ Feature: dc / services / show-topology: Show Topology tab for Service
dc: dc1 dc: dc1
service: service-0 service: service-0
--- ---
And I see topology on the tabs And I see topologyIsVisible on the tabs
Then the url should be /dc1/services/service-0/topology Then the url should be /dc1/services/service-0/topology
Scenario: Given connect is disabled, the Topology tab should not display or error Scenario: Given connect is disabled, the Topology tab should not display or error
Given 1 datacenter model with the value "dc1" Given 1 datacenter model with the value "dc1"

View File

@ -38,7 +38,7 @@ Feature: dc / services / show / intentions / index: Intentions per service
service: service-0 service: service-0
--- ---
And the title should be "service-0 - Consul" And the title should be "service-0 - Consul"
And I see intentions on the tabs And I see intentionsIsVisible on the tabs
When I click intentions on the tabs When I click intentions on the tabs
And I see intentionsIsSelected on the tabs And I see intentionsIsSelected on the tabs
Scenario: I can see intentions Scenario: I can see intentions

View File

@ -16,7 +16,7 @@ Feature: dc / services / show / services
service: terminating-gateway-1 service: terminating-gateway-1
--- ---
And the title should be "terminating-gateway-1 - Consul" And the title should be "terminating-gateway-1 - Consul"
And I see linkedServices on the tabs And I see linkedServicesIsVisible on the tabs
When I click linkedServices on the tabs When I click linkedServices on the tabs
And I see linkedServicesIsSelected on the tabs And I see linkedServicesIsSelected on the tabs
Scenario: Seeing the list of Linked Services Scenario: Seeing the list of Linked Services

View File

@ -19,7 +19,7 @@ Feature: dc / services / show / tags
dc: dc1 dc: dc1
service: service service: service
--- ---
And I see tags on the tabs And I see tagsIsVisible on the tabs
When I click tags on the tabs When I click tags on the tabs
And I see tagsIsSelected on the tabs And I see tagsIsSelected on the tabs
And I see 3 tag models on the tabs.tagsTab component And I see 3 tag models on the tabs.tagsTab component
@ -42,7 +42,7 @@ Feature: dc / services / show / tags
dc: dc1 dc: dc1
service: service service: service
--- ---
And I see tags on the tabs And I see tagsIsVisible on the tabs
When I click tags on the tabs When I click tags on the tabs
And I see tagsIsSelected on the tabs And I see tagsIsSelected on the tabs
And I see 3 tag models on the tabs.tagsTab component And I see 3 tag models on the tabs.tagsTab component

View File

@ -24,7 +24,7 @@ Feature: dc / services / show / topology / routing-config
dc: dc1 dc: dc1
service: service-0 service: service-0
--- ---
And I see topology on the tabs And I see topologyIsVisible on the tabs
Scenario: Given the Source is routing config, show Source Type Scenario: Given the Source is routing config, show Source Type
Then I see the text "Routing configuration" in "[data-test-topology-metrics-source-type]" Then I see the text "Routing configuration" in "[data-test-topology-metrics-source-type]"
Scenario: Given the Source is routing config, redirect to Routing Config page Scenario: Given the Source is routing config, redirect to Routing Config page

View File

@ -14,7 +14,7 @@ Feature: dc / services / show / topology / stats
dc: dc1 dc: dc1
service: service-0 service: service-0
--- ---
And I see topology on the tabs And I see topologyIsVisible on the tabs
And I don't see the "[data-test-topology-metrics-stats]" element And I don't see the "[data-test-topology-metrics-stats]" element
Scenario: Given metrics is enabled, the Topology tab should display metrics Scenario: Given metrics is enabled, the Topology tab should display metrics
Given 1 datacenter model with the value "dc1" Given 1 datacenter model with the value "dc1"
@ -31,7 +31,7 @@ Feature: dc / services / show / topology / stats
dc: dc1 dc: dc1
service: service-0 service: service-0
--- ---
And I see topology on the tabs And I see topologyIsVisible on the tabs
And I see the "[data-test-topology-metrics-stats]" element And I see the "[data-test-topology-metrics-stats]" element
Scenario: Given metrics is enabled, metrics stats are disabled for an ingress gateway Topology Scenario: Given metrics is enabled, metrics stats are disabled for an ingress gateway Topology
Given 1 datacenter model with the value "dc1" Given 1 datacenter model with the value "dc1"
@ -49,7 +49,7 @@ Feature: dc / services / show / topology / stats
dc: dc1 dc: dc1
service: ingress-gateway service: ingress-gateway
--- ---
And I see topology on the tabs And I see topologyIsVisible on the tabs
And I don't see the "[data-test-topology-metrics-stats]" element And I don't see the "[data-test-topology-metrics-stats]" element
And I see the "[data-test-topology-metrics-status]" element And I see the "[data-test-topology-metrics-status]" element
Scenario: Given metrics is enabled, metric stats are disabled for ingress gateway as downstream services Scenario: Given metrics is enabled, metric stats are disabled for ingress gateway as downstream services
@ -77,7 +77,7 @@ Feature: dc / services / show / topology / stats
dc: dc1 dc: dc1
service: service-0 service: service-0
--- ---
And I see topology on the tabs And I see topologyIsVisible on the tabs
And I see the "[data-test-sparkline]" element And I see the "[data-test-sparkline]" element
And I don't see the "[data-test-topology-metrics-downstream-stats]" element And I don't see the "[data-test-topology-metrics-downstream-stats]" element

View File

@ -16,7 +16,7 @@ Feature: dc / services / show / upstreams
service: ingress-gateway-1 service: ingress-gateway-1
--- ---
And the title should be "ingress-gateway-1 - Consul" And the title should be "ingress-gateway-1 - Consul"
And I see upstreams on the tabs And I see upstreamsIsVisible on the tabs
When I click upstreams on the tabs When I click upstreams on the tabs
And I see upstreamsIsSelected on the tabs And I see upstreamsIsSelected on the tabs
Scenario: Seeing the list of Upstreams Scenario: Seeing the list of Upstreams