github.com/zoomfoo/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/ui/tests/pages/components/allocations.js (about) 1 import { attribute, collection, clickable, isPresent, text } from 'ember-cli-page-object'; 2 3 export default function(selector = '[data-test-allocation]') { 4 return { 5 allocations: collection(selector, { 6 id: attribute('data-test-allocation'), 7 shortId: text('[data-test-short-id]'), 8 createTime: text('[data-test-create-time]'), 9 modifyTime: text('[data-test-modify-time]'), 10 status: text('[data-test-client-status]'), 11 job: text('[data-test-job]'), 12 taskGroup: text('[data-test-task-group]'), 13 client: text('[data-test-client]'), 14 jobVersion: text('[data-test-job-version]'), 15 cpu: text('[data-test-cpu]'), 16 cpuTooltip: attribute('aria-label', '[data-test-cpu] .tooltip'), 17 mem: text('[data-test-mem]'), 18 memTooltip: attribute('aria-label', '[data-test-mem] .tooltip'), 19 rescheduled: isPresent('[data-test-indicators] [data-test-icon="reschedule"]'), 20 21 visit: clickable('[data-test-short-id] a'), 22 visitJob: clickable('[data-test-job]'), 23 visitClient: clickable('[data-test-client] a'), 24 }), 25 26 allocationFor(id) { 27 return this.allocations.toArray().find(allocation => allocation.id === id); 28 }, 29 }; 30 }