2022-09-15 08:43:17 +00:00
|
|
|
export default function (
|
2021-05-25 15:02:38 +00:00
|
|
|
visitable,
|
|
|
|
clickable,
|
|
|
|
attribute,
|
|
|
|
isPresent,
|
|
|
|
collection,
|
|
|
|
text,
|
|
|
|
intentions,
|
|
|
|
tabs
|
|
|
|
) {
|
2020-05-19 16:18:04 +00:00
|
|
|
const page = {
|
2018-07-04 14:06:20 +00:00
|
|
|
visit: visitable('/:dc/services/:service'),
|
2020-04-21 14:21:52 +00:00
|
|
|
externalSource: attribute('data-test-external-source', '[data-test-external-source]', {
|
2020-05-07 13:57:15 +00:00
|
|
|
scope: '.title',
|
2020-04-21 14:21:52 +00:00
|
|
|
}),
|
2019-05-02 13:35:42 +00:00
|
|
|
dashboardAnchor: {
|
|
|
|
href: attribute('href', '[data-test-dashboard-anchor]'),
|
|
|
|
},
|
2020-10-27 14:25:23 +00:00
|
|
|
metricsAnchor: {
|
|
|
|
href: attribute('href', '[data-test-metrics-anchor]'),
|
|
|
|
},
|
2022-07-21 14:35:54 +00:00
|
|
|
peer: text('[data-test-peer-info] [data-test-peer-name]'),
|
2020-05-13 15:28:11 +00:00
|
|
|
tabs: tabs('tab', [
|
2020-10-23 13:45:10 +00:00
|
|
|
'topology',
|
2020-05-13 15:28:11 +00:00
|
|
|
'instances',
|
|
|
|
'linked-services',
|
|
|
|
'upstreams',
|
|
|
|
'intentions',
|
|
|
|
'routing',
|
|
|
|
'tags',
|
|
|
|
]),
|
2020-04-16 14:15:45 +00:00
|
|
|
// TODO: These need to somehow move to subpages
|
2020-04-21 14:21:52 +00:00
|
|
|
instances: collection('.consul-service-instance-list > ul > li:not(:first-child)', {
|
2020-04-16 14:15:45 +00:00
|
|
|
address: text('[data-test-address]'),
|
2022-10-11 15:59:53 +00:00
|
|
|
externalSource: attribute('data-test-external-source', '[data-test-external-source]'),
|
2021-01-12 14:53:21 +00:00
|
|
|
instance: clickable('a'),
|
2022-10-11 15:59:53 +00:00
|
|
|
nodeChecks: text('[data-test-node-health-checks]'),
|
|
|
|
nodeName: text('[data-test-node-name]'),
|
2020-04-16 14:15:45 +00:00
|
|
|
}),
|
2020-10-26 09:30:07 +00:00
|
|
|
intentionList: intentions(),
|
2020-05-19 16:18:04 +00:00
|
|
|
};
|
2021-05-25 15:02:38 +00:00
|
|
|
page.tabs.topologyTab = {
|
|
|
|
defaultAllowNotice: {
|
|
|
|
see: isPresent('[data-test-notice="default-allow"]'),
|
|
|
|
},
|
|
|
|
filteredByACLs: {
|
|
|
|
see: isPresent('[data-test-notice="filtered-by-acls"]'),
|
|
|
|
},
|
|
|
|
wildcardIntention: {
|
|
|
|
see: isPresent('[data-test-notice="wildcard-intention"]'),
|
|
|
|
},
|
|
|
|
notDefinedIntention: {
|
|
|
|
see: isPresent('[data-test-notice="not-defined-intention"]'),
|
|
|
|
},
|
2021-11-05 17:46:41 +00:00
|
|
|
noDependencies: {
|
|
|
|
see: isPresent('[data-test-notice="no-dependencies"]'),
|
|
|
|
},
|
|
|
|
aclsDisabled: {
|
|
|
|
see: isPresent('[data-test-notice="acls-disabled"]'),
|
|
|
|
},
|
2021-05-25 15:02:38 +00:00
|
|
|
};
|
2020-05-19 16:18:04 +00:00
|
|
|
page.tabs.upstreamsTab = {
|
2020-09-22 17:20:44 +00:00
|
|
|
services: collection('.consul-upstream-list > ul > li:not(:first-child)', {
|
2020-05-19 16:18:04 +00:00
|
|
|
name: text('[data-test-service-name]'),
|
|
|
|
}),
|
|
|
|
};
|
|
|
|
page.tabs.linkedServicesTab = {
|
|
|
|
services: collection('.consul-service-list > ul > li:not(:first-child)', {
|
2020-05-12 21:34:47 +00:00
|
|
|
name: text('[data-test-service-name]'),
|
|
|
|
}),
|
2018-07-04 14:06:20 +00:00
|
|
|
};
|
2021-05-07 11:07:11 +00:00
|
|
|
page.tabs.tagsTab = {
|
|
|
|
tags: collection('.tag-list dd > span', {
|
|
|
|
name: text(),
|
|
|
|
}),
|
|
|
|
};
|
2020-05-19 16:18:04 +00:00
|
|
|
return page;
|
2018-07-04 14:06:20 +00:00
|
|
|
}
|