2018-09-19 23:33:51 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
clickable,
|
|
|
|
create,
|
|
|
|
collection,
|
|
|
|
isPresent,
|
|
|
|
text,
|
|
|
|
visitable,
|
|
|
|
} from 'ember-cli-page-object';
|
2018-07-11 18:27:23 +00:00
|
|
|
|
2019-04-22 23:09:56 +00:00
|
|
|
import allocations from 'nomad-ui/tests/pages/components/allocations';
|
2019-05-21 00:19:24 +00:00
|
|
|
import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
|
2020-04-30 13:15:19 +00:00
|
|
|
import LifecycleChart from 'nomad-ui/tests/pages/components/lifecycle-chart';
|
2019-04-22 23:09:56 +00:00
|
|
|
|
2018-07-11 18:27:23 +00:00
|
|
|
export default create({
|
|
|
|
visit: visitable('/allocations/:id'),
|
|
|
|
|
|
|
|
title: text('[data-test-title]'),
|
|
|
|
|
2019-05-21 00:19:24 +00:00
|
|
|
stop: twoStepButton('[data-test-stop]'),
|
|
|
|
restart: twoStepButton('[data-test-restart]'),
|
|
|
|
|
2020-05-11 16:29:30 +00:00
|
|
|
execButton: {
|
|
|
|
scope: '[data-test-exec-button]',
|
|
|
|
},
|
|
|
|
|
2018-07-11 18:27:23 +00:00
|
|
|
details: {
|
|
|
|
scope: '[data-test-allocation-details]',
|
|
|
|
|
|
|
|
job: text('[data-test-job-link]'),
|
|
|
|
visitJob: clickable('[data-test-job-link]'),
|
|
|
|
|
|
|
|
client: text('[data-test-client-link]'),
|
|
|
|
visitClient: clickable('[data-test-client-link]'),
|
|
|
|
},
|
|
|
|
|
2018-09-19 23:33:51 +00:00
|
|
|
resourceCharts: collection('[data-test-primary-metric]', {
|
|
|
|
name: text('[data-test-primary-metric-title]'),
|
|
|
|
chartClass: attribute('class', '[data-test-percentage-chart] progress'),
|
|
|
|
}),
|
|
|
|
|
2018-12-11 01:28:35 +00:00
|
|
|
resourceEmptyMessage: text('[data-test-resource-error-headline]'),
|
|
|
|
|
2020-04-30 13:15:19 +00:00
|
|
|
lifecycleChart: LifecycleChart,
|
|
|
|
|
2018-07-11 18:27:23 +00:00
|
|
|
tasks: collection('[data-test-task-row]', {
|
|
|
|
name: text('[data-test-name]'),
|
|
|
|
state: text('[data-test-state]'),
|
|
|
|
message: text('[data-test-message]'),
|
|
|
|
time: text('[data-test-time]'),
|
2020-02-14 01:10:01 +00:00
|
|
|
volumes: text('[data-test-volumes]'),
|
2018-07-11 18:27:23 +00:00
|
|
|
|
2022-08-23 19:50:40 +00:00
|
|
|
hasCpuMetrics: isPresent('[data-test-cpu] .inline-chart progress'),
|
|
|
|
hasMemoryMetrics: isPresent('[data-test-mem] .inline-chart progress'),
|
2018-07-11 18:27:23 +00:00
|
|
|
hasUnhealthyDriver: isPresent('[data-test-icon="unhealthy-driver"]'),
|
2019-09-04 14:39:56 +00:00
|
|
|
hasProxyTag: isPresent('[data-test-proxy-tag]'),
|
2018-07-11 18:27:23 +00:00
|
|
|
|
|
|
|
clickLink: clickable('[data-test-name] a'),
|
|
|
|
clickRow: clickable('[data-test-name]'),
|
|
|
|
}),
|
|
|
|
|
|
|
|
firstUnhealthyTask() {
|
|
|
|
return this.tasks.toArray().findBy('hasUnhealthyDriver');
|
|
|
|
},
|
|
|
|
|
|
|
|
hasRescheduleEvents: isPresent('[data-test-reschedule-events]'),
|
|
|
|
|
2018-11-10 01:13:08 +00:00
|
|
|
isEmpty: isPresent('[data-test-empty-tasks-list]'),
|
|
|
|
|
2019-04-22 23:09:56 +00:00
|
|
|
wasPreempted: isPresent('[data-test-was-preempted]'),
|
|
|
|
preempter: {
|
|
|
|
scope: '[data-test-was-preempted]',
|
|
|
|
|
|
|
|
status: text('[data-test-allocation-status]'),
|
|
|
|
name: text('[data-test-allocation-name]'),
|
|
|
|
priority: text('[data-test-job-priority]'),
|
|
|
|
reservedCPU: text('[data-test-allocation-cpu]'),
|
|
|
|
reservedMemory: text('[data-test-allocation-memory]'),
|
|
|
|
|
|
|
|
visit: clickable('[data-test-allocation-id]'),
|
|
|
|
visitJob: clickable('[data-test-job-link]'),
|
|
|
|
visitClient: clickable('[data-test-client-link]'),
|
|
|
|
},
|
|
|
|
|
|
|
|
preempted: isPresent('[data-test-preemptions]'),
|
2021-12-28 16:08:12 +00:00
|
|
|
...allocations(
|
|
|
|
'[data-test-preemptions] [data-test-allocation]',
|
|
|
|
'preemptions'
|
|
|
|
),
|
2019-04-22 23:09:56 +00:00
|
|
|
|
2019-09-04 14:39:56 +00:00
|
|
|
ports: collection('[data-test-allocation-port]', {
|
|
|
|
name: text('[data-test-allocation-port-name]'),
|
|
|
|
address: text('[data-test-allocation-port-address]'),
|
|
|
|
to: text('[data-test-allocation-port-to]'),
|
|
|
|
}),
|
|
|
|
|
|
|
|
services: collection('[data-test-service]', {
|
|
|
|
name: text('[data-test-service-name]'),
|
|
|
|
port: text('[data-test-service-port]'),
|
|
|
|
tags: text('[data-test-service-tags]'),
|
2021-03-11 17:28:38 +00:00
|
|
|
onUpdate: text('[data-test-service-onupdate]'),
|
2019-09-04 14:39:56 +00:00
|
|
|
connect: text('[data-test-service-connect]'),
|
|
|
|
upstreams: text('[data-test-service-upstreams]'),
|
|
|
|
}),
|
|
|
|
|
2018-07-11 18:27:23 +00:00
|
|
|
error: {
|
|
|
|
isShown: isPresent('[data-test-error]'),
|
|
|
|
title: text('[data-test-error-title]'),
|
|
|
|
message: text('[data-test-error-message]'),
|
|
|
|
seekHelp: clickable('[data-test-error-message] a'),
|
|
|
|
},
|
2019-05-21 00:19:24 +00:00
|
|
|
|
|
|
|
inlineError: {
|
|
|
|
isShown: isPresent('[data-test-inline-error]'),
|
|
|
|
title: text('[data-test-inline-error-title]'),
|
|
|
|
message: text('[data-test-inline-error-body]'),
|
|
|
|
dismiss: clickable('[data-test-inline-error-close]'),
|
|
|
|
},
|
2018-07-11 18:27:23 +00:00
|
|
|
});
|