2018-07-11 16:13:44 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
clickable,
|
|
|
|
create,
|
|
|
|
collection,
|
|
|
|
isPresent,
|
|
|
|
text,
|
|
|
|
visitable,
|
|
|
|
} from 'ember-cli-page-object';
|
|
|
|
|
2018-07-24 02:06:41 +00:00
|
|
|
import allocations from 'nomad-ui/tests/pages/components/allocations';
|
2018-11-06 00:06:08 +00:00
|
|
|
import error from 'nomad-ui/tests/pages/components/error';
|
2018-07-24 02:06:41 +00:00
|
|
|
|
2018-07-11 16:13:44 +00:00
|
|
|
export default create({
|
|
|
|
visit: visitable('/jobs/:id/deployments'),
|
|
|
|
|
|
|
|
deployments: collection('[data-test-deployment]', {
|
|
|
|
text: text(),
|
|
|
|
status: text('[data-test-deployment-status]'),
|
|
|
|
statusClass: attribute('class', '[data-test-deployment-status]'),
|
|
|
|
version: text('[data-test-deployment-version]'),
|
|
|
|
submitTime: text('[data-test-deployment-submit-time]'),
|
|
|
|
promotionIsRequired: isPresent('[data-test-promotion-required]'),
|
|
|
|
|
|
|
|
toggle: clickable('[data-test-deployment-toggle-details]'),
|
|
|
|
|
|
|
|
hasDetails: isPresent('[data-test-deployment-details]'),
|
|
|
|
|
|
|
|
metrics: collection('[data-test-deployment-metric]', {
|
|
|
|
id: attribute('data-test-deployment-metric'),
|
|
|
|
text: text(),
|
|
|
|
}),
|
|
|
|
|
|
|
|
metricFor(id) {
|
|
|
|
return this.metrics.toArray().findBy('id', id);
|
|
|
|
},
|
|
|
|
|
|
|
|
notification: text('[data-test-deployment-notification]'),
|
|
|
|
|
|
|
|
hasTaskGroups: isPresent('[data-test-deployment-task-groups]'),
|
|
|
|
taskGroups: collection('[data-test-deployment-task-group]', {
|
|
|
|
name: text('[data-test-deployment-task-group-name]'),
|
|
|
|
promotion: text('[data-test-deployment-task-group-promotion]'),
|
|
|
|
autoRevert: text('[data-test-deployment-task-group-auto-revert]'),
|
|
|
|
canaries: text('[data-test-deployment-task-group-canaries]'),
|
|
|
|
allocs: text('[data-test-deployment-task-group-allocs]'),
|
|
|
|
healthy: text('[data-test-deployment-task-group-healthy]'),
|
|
|
|
unhealthy: text('[data-test-deployment-task-group-unhealthy]'),
|
2018-07-17 20:28:29 +00:00
|
|
|
progress: text('[data-test-deployment-task-group-progress-deadline]'),
|
2018-07-11 16:13:44 +00:00
|
|
|
}),
|
|
|
|
|
2018-07-24 02:06:41 +00:00
|
|
|
...allocations('[data-test-deployment-allocation]'),
|
2018-07-11 16:13:44 +00:00
|
|
|
hasAllocations: isPresent('[data-test-deployment-allocations]'),
|
|
|
|
}),
|
2018-11-06 00:06:08 +00:00
|
|
|
|
|
|
|
error: error(),
|
2018-07-11 16:13:44 +00:00
|
|
|
});
|