github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/ui/tests/pages/clients/detail.js (about) 1 import { 2 attribute, 3 create, 4 collection, 5 clickable, 6 hasClass, 7 text, 8 isPresent, 9 visitable, 10 } from 'ember-cli-page-object'; 11 12 import allocations from 'nomad-ui/tests/pages/components/allocations'; 13 14 export default create({ 15 visit: visitable('/clients/:id'), 16 17 breadcrumbs: collection('[data-test-breadcrumb]', { 18 id: attribute('data-test-breadcrumb'), 19 text: text(), 20 visit: clickable(), 21 }), 22 23 breadcrumbFor(id) { 24 return this.breadcrumbs.toArray().find(crumb => crumb.id === id); 25 }, 26 27 title: text('[data-test-title]'), 28 29 statusLight: collection('[data-test-node-status]', { 30 id: attribute('data-test-node-status'), 31 text: text(), 32 }), 33 34 statusDefinition: text('[data-test-status-definition]'), 35 statusDecorationClass: attribute('class', '[data-test-status-definition] .status-text'), 36 addressDefinition: text('[data-test-address-definition]'), 37 drainingDefinition: text('[data-test-draining]'), 38 eligibilityDefinition: text('[data-test-eligibility]'), 39 datacenterDefinition: text('[data-test-datacenter-definition]'), 40 41 resourceCharts: collection('[data-test-primary-metric]', { 42 name: text('[data-test-primary-metric-title]'), 43 chartClass: attribute('class', '[data-test-percentage-chart] progress'), 44 }), 45 46 ...allocations(), 47 48 allocationFilter: { 49 preemptions: clickable('[data-test-filter-preemptions]'), 50 all: clickable('[data-test-filter-all]'), 51 preemptionsCount: text('[data-test-filter-preemptions]'), 52 allCount: text('[data-test-filter-all]'), 53 }, 54 55 attributesTable: isPresent('[data-test-attributes]'), 56 metaTable: isPresent('[data-test-meta]'), 57 emptyMetaMessage: isPresent('[data-test-empty-meta-message]'), 58 59 metaAttributes: collection('[data-test-meta] [data-test-attributes-section]', { 60 key: text('[data-test-key]'), 61 value: text('[data-test-value]'), 62 }), 63 64 error: { 65 isShown: isPresent('[data-test-error]'), 66 title: text('[data-test-error-title]'), 67 message: text('[data-test-error-message]'), 68 seekHelp: clickable('[data-test-error-message] a'), 69 }, 70 71 hasEvents: isPresent('[data-test-client-events]'), 72 events: collection('[data-test-client-event]', { 73 time: text('[data-test-client-event-time]'), 74 subsystem: text('[data-test-client-event-subsystem]'), 75 message: text('[data-test-client-event-message]'), 76 }), 77 78 driverHeads: collection('[data-test-driver-status] [data-test-accordion-head]', { 79 name: text('[data-test-name]'), 80 detected: text('[data-test-detected]'), 81 lastUpdated: text('[data-test-last-updated]'), 82 healthIsShown: isPresent('[data-test-health]'), 83 health: text('[data-test-health]'), 84 healthClass: attribute('class', '[data-test-health] .color-swatch'), 85 86 toggle: clickable('[data-test-accordion-toggle]'), 87 }), 88 89 driverBodies: collection('[data-test-driver-status] [data-test-accordion-body]', { 90 description: text('[data-test-health-description]'), 91 descriptionIsShown: isPresent('[data-test-health-description]'), 92 attributesAreShown: isPresent('[data-test-driver-attributes]'), 93 }), 94 95 drain: { 96 deadline: text('[data-test-drain-deadline]'), 97 forcedDeadline: text('[data-test-drain-forced-deadline]'), 98 hasForcedDeadline: isPresent('[data-test-drain-forced-deadline]'), 99 ignoreSystemJobs: text('[data-test-drain-ignore-system-jobs]'), 100 badgeIsDangerous: hasClass('is-danger', '[data-test-drain-deadline] .badge'), 101 badgeLabel: text('[data-test-drain-deadline] .badge'), 102 }, 103 });