open-nomad/ui/tests/pages/jobs/job/deployments.js
2018-08-06 11:02:21 -07:00

55 lines
1.8 KiB
JavaScript

import {
attribute,
clickable,
create,
collection,
isPresent,
text,
visitable,
} from 'ember-cli-page-object';
import allocations from 'nomad-ui/tests/pages/components/allocations';
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]'),
}),
...allocations('[data-test-deployment-allocation]'),
hasAllocations: isPresent('[data-test-deployment-allocations]'),
}),
});