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