open-nomad/ui/tests/pages/jobs/job/deployments.js

58 lines
1.9 KiB
JavaScript
Raw Normal View History

2018-07-11 16:13:44 +00:00
import {
attribute,
clickable,
create,
collection,
isPresent,
text,
visitable,
} from 'ember-cli-page-object';
import allocations from 'nomad-ui/tests/pages/components/allocations';
import error from 'nomad-ui/tests/pages/components/error';
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]'),
progress: text('[data-test-deployment-task-group-progress-deadline]'),
2018-07-11 16:13:44 +00:00
}),
...allocations('[data-test-deployment-allocation]'),
2018-07-11 16:13:44 +00:00
hasAllocations: isPresent('[data-test-deployment-allocations]'),
}),
error: error(),
2018-07-11 16:13:44 +00:00
});