2018-07-24 02:06:41 +00:00
|
|
|
import { attribute, collection, clickable, isPresent, text } from 'ember-cli-page-object';
|
|
|
|
|
2019-04-22 23:09:56 +00:00
|
|
|
export default function(selector = '[data-test-allocation]', propKey = 'allocations') {
|
2018-07-24 02:06:41 +00:00
|
|
|
return {
|
2019-04-22 23:09:56 +00:00
|
|
|
[propKey]: collection(selector, {
|
2018-07-24 02:06:41 +00:00
|
|
|
id: attribute('data-test-allocation'),
|
|
|
|
shortId: text('[data-test-short-id]'),
|
|
|
|
createTime: text('[data-test-create-time]'),
|
|
|
|
modifyTime: text('[data-test-modify-time]'),
|
|
|
|
status: text('[data-test-client-status]'),
|
|
|
|
job: text('[data-test-job]'),
|
|
|
|
taskGroup: text('[data-test-task-group]'),
|
|
|
|
client: text('[data-test-client]'),
|
|
|
|
jobVersion: text('[data-test-job-version]'),
|
|
|
|
cpu: text('[data-test-cpu]'),
|
|
|
|
cpuTooltip: attribute('aria-label', '[data-test-cpu] .tooltip'),
|
|
|
|
mem: text('[data-test-mem]'),
|
|
|
|
memTooltip: attribute('aria-label', '[data-test-mem] .tooltip'),
|
|
|
|
rescheduled: isPresent('[data-test-indicators] [data-test-icon="reschedule"]'),
|
|
|
|
|
|
|
|
visit: clickable('[data-test-short-id] a'),
|
2019-08-08 14:26:46 +00:00
|
|
|
visitRow: clickable(),
|
2018-07-24 02:06:41 +00:00
|
|
|
visitJob: clickable('[data-test-job]'),
|
|
|
|
visitClient: clickable('[data-test-client] a'),
|
|
|
|
}),
|
|
|
|
|
|
|
|
allocationFor(id) {
|
|
|
|
return this.allocations.toArray().find(allocation => allocation.id === id);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|