github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/tests/pages/allocations/task/detail.js (about) 1 import { 2 attribute, 3 create, 4 collection, 5 clickable, 6 isPresent, 7 text, 8 visitable, 9 } from 'ember-cli-page-object'; 10 11 import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button'; 12 13 export default create({ 14 visit: visitable('/allocations/:id/:name'), 15 16 title: { 17 scope: '[data-test-title]', 18 19 proxyTag: { 20 scope: '[data-test-proxy-tag]', 21 }, 22 }, 23 24 state: text('.title [data-test-state]'), 25 startedAt: text('[data-test-started-at]'), 26 27 lifecycle: text('.pair [data-test-lifecycle]'), 28 29 restart: twoStepButton('[data-test-restart]'), 30 31 execButton: { 32 scope: '[data-test-exec-button]', 33 }, 34 35 breadcrumbs: collection('[data-test-breadcrumb]', { 36 id: attribute('data-test-breadcrumb'), 37 text: text(), 38 visit: clickable(), 39 }), 40 41 breadcrumbFor(id) { 42 return this.breadcrumbs.toArray().find(crumb => crumb.id === id); 43 }, 44 45 resourceCharts: collection('[data-test-primary-metric]', { 46 name: text('[data-test-primary-metric-title]'), 47 chartClass: attribute('class', '[data-test-percentage-chart] progress'), 48 }), 49 50 resourceEmptyMessage: text('[data-test-resource-error-headline]'), 51 52 hasPrestartTasks: isPresent('[data-test-prestart-tasks]'), 53 prestartTasks: collection('[data-test-prestart-task]', { 54 name: text('[data-test-name]'), 55 state: text('[data-test-state]'), 56 lifecycle: text('[data-test-lifecycle]'), 57 isBlocking: isPresent('.icon-is-warning'), 58 }), 59 60 hasAddresses: isPresent('[data-test-task-addresses]'), 61 addresses: collection('[data-test-task-address]', { 62 name: text('[data-test-task-address-name]'), 63 isDynamic: text('[data-test-task-address-is-dynamic]'), 64 address: text('[data-test-task-address-address]'), 65 }), 66 67 hasVolumes: isPresent('[data-test-volumes]'), 68 volumes: collection('[data-test-volume]', { 69 name: text('[data-test-volume-name]'), 70 destination: text('[data-test-volume-destination]'), 71 permissions: text('[data-test-volume-permissions]'), 72 clientSource: text('[data-test-volume-client-source]'), 73 }), 74 75 events: collection('[data-test-task-event]', { 76 time: text('[data-test-task-event-time]'), 77 type: text('[data-test-task-event-type]'), 78 message: text('[data-test-task-event-message]'), 79 }), 80 81 error: { 82 isPresent: isPresent('[data-test-error]'), 83 title: text('[data-test-error-title]'), 84 message: text('[data-test-error-message]'), 85 seekHelp: clickable('[data-test-error-message] a'), 86 }, 87 88 inlineError: { 89 isShown: isPresent('[data-test-inline-error]'), 90 title: text('[data-test-inline-error-title]'), 91 message: text('[data-test-inline-error-body]'), 92 dismiss: clickable('[data-test-inline-error-close]'), 93 }, 94 });