github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/ui/tests/pages/allocations/detail.js (about) 1 import { 2 attribute, 3 clickable, 4 create, 5 collection, 6 isPresent, 7 text, 8 visitable, 9 } from 'ember-cli-page-object'; 10 11 import allocations from 'nomad-ui/tests/pages/components/allocations'; 12 import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button'; 13 14 export default create({ 15 visit: visitable('/allocations/:id'), 16 17 title: text('[data-test-title]'), 18 19 stop: twoStepButton('[data-test-stop]'), 20 restart: twoStepButton('[data-test-restart]'), 21 22 details: { 23 scope: '[data-test-allocation-details]', 24 25 job: text('[data-test-job-link]'), 26 visitJob: clickable('[data-test-job-link]'), 27 28 client: text('[data-test-client-link]'), 29 visitClient: clickable('[data-test-client-link]'), 30 }, 31 32 resourceCharts: collection('[data-test-primary-metric]', { 33 name: text('[data-test-primary-metric-title]'), 34 chartClass: attribute('class', '[data-test-percentage-chart] progress'), 35 }), 36 37 resourceEmptyMessage: text('[data-test-resource-error-headline]'), 38 39 tasks: collection('[data-test-task-row]', { 40 name: text('[data-test-name]'), 41 state: text('[data-test-state]'), 42 message: text('[data-test-message]'), 43 time: text('[data-test-time]'), 44 ports: text('[data-test-ports]'), 45 46 hasUnhealthyDriver: isPresent('[data-test-icon="unhealthy-driver"]'), 47 48 clickLink: clickable('[data-test-name] a'), 49 clickRow: clickable('[data-test-name]'), 50 }), 51 52 firstUnhealthyTask() { 53 return this.tasks.toArray().findBy('hasUnhealthyDriver'); 54 }, 55 56 hasRescheduleEvents: isPresent('[data-test-reschedule-events]'), 57 58 isEmpty: isPresent('[data-test-empty-tasks-list]'), 59 60 wasPreempted: isPresent('[data-test-was-preempted]'), 61 preempter: { 62 scope: '[data-test-was-preempted]', 63 64 status: text('[data-test-allocation-status]'), 65 name: text('[data-test-allocation-name]'), 66 priority: text('[data-test-job-priority]'), 67 reservedCPU: text('[data-test-allocation-cpu]'), 68 reservedMemory: text('[data-test-allocation-memory]'), 69 70 visit: clickable('[data-test-allocation-id]'), 71 visitJob: clickable('[data-test-job-link]'), 72 visitClient: clickable('[data-test-client-link]'), 73 }, 74 75 preempted: isPresent('[data-test-preemptions]'), 76 ...allocations('[data-test-preemptions] [data-test-allocation]', 'preemptions'), 77 78 error: { 79 isShown: isPresent('[data-test-error]'), 80 title: text('[data-test-error-title]'), 81 message: text('[data-test-error-message]'), 82 seekHelp: clickable('[data-test-error-message] a'), 83 }, 84 85 inlineError: { 86 isShown: isPresent('[data-test-inline-error]'), 87 title: text('[data-test-inline-error-title]'), 88 message: text('[data-test-inline-error-body]'), 89 dismiss: clickable('[data-test-inline-error-close]'), 90 }, 91 });