2018-07-11 19:20:48 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
create,
|
|
|
|
collection,
|
|
|
|
clickable,
|
|
|
|
isPresent,
|
|
|
|
text,
|
|
|
|
visitable,
|
|
|
|
} from 'ember-cli-page-object';
|
|
|
|
|
2019-05-21 00:19:24 +00:00
|
|
|
import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
|
|
|
|
|
2018-07-11 19:20:48 +00:00
|
|
|
export default create({
|
|
|
|
visit: visitable('/allocations/:id/:name'),
|
|
|
|
|
2019-09-04 14:39:56 +00:00
|
|
|
title: {
|
|
|
|
scope: '[data-test-title]',
|
|
|
|
|
|
|
|
proxyTag: {
|
|
|
|
scope: '[data-test-proxy-tag]',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-11 19:20:48 +00:00
|
|
|
state: text('[data-test-state]'),
|
|
|
|
startedAt: text('[data-test-started-at]'),
|
|
|
|
|
2019-05-21 00:19:24 +00:00
|
|
|
restart: twoStepButton('[data-test-restart]'),
|
|
|
|
|
2018-07-11 19:20:48 +00:00
|
|
|
breadcrumbs: collection('[data-test-breadcrumb]', {
|
|
|
|
id: attribute('data-test-breadcrumb'),
|
|
|
|
text: text(),
|
|
|
|
visit: clickable(),
|
|
|
|
}),
|
|
|
|
|
|
|
|
breadcrumbFor(id) {
|
|
|
|
return this.breadcrumbs.toArray().find(crumb => crumb.id === id);
|
|
|
|
},
|
|
|
|
|
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]'),
|
|
|
|
|
2018-07-11 19:20:48 +00:00
|
|
|
hasAddresses: isPresent('[data-test-task-addresses]'),
|
|
|
|
addresses: collection('[data-test-task-address]', {
|
|
|
|
name: text('[data-test-task-address-name]'),
|
|
|
|
isDynamic: text('[data-test-task-address-is-dynamic]'),
|
|
|
|
address: text('[data-test-task-address-address]'),
|
|
|
|
}),
|
|
|
|
|
|
|
|
events: collection('[data-test-task-event]', {
|
|
|
|
time: text('[data-test-task-event-time]'),
|
|
|
|
type: text('[data-test-task-event-type]'),
|
|
|
|
message: text('[data-test-task-event-message]'),
|
|
|
|
}),
|
|
|
|
|
|
|
|
error: {
|
|
|
|
isPresent: 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 19:20:48 +00:00
|
|
|
});
|