github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/tests/pages/clients/detail.js (about) 1 import { 2 attribute, 3 create, 4 collection, 5 clickable, 6 fillable, 7 text, 8 isPresent, 9 visitable, 10 } from 'ember-cli-page-object'; 11 12 import allocations from 'nomad-ui/tests/pages/components/allocations'; 13 import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button'; 14 import notification from 'nomad-ui/tests/pages/components/notification'; 15 import toggle from 'nomad-ui/tests/pages/components/toggle'; 16 17 export default create({ 18 visit: visitable('/clients/:id'), 19 20 breadcrumbs: collection('[data-test-breadcrumb]', { 21 id: attribute('data-test-breadcrumb'), 22 text: text(), 23 visit: clickable(), 24 }), 25 26 breadcrumbFor(id) { 27 return this.breadcrumbs.toArray().find(crumb => crumb.id === id); 28 }, 29 30 title: text('[data-test-title]'), 31 clientId: text('[data-test-node-id]'), 32 33 statusLight: collection('[data-test-node-status]', { 34 id: attribute('data-test-node-status'), 35 text: text(), 36 }), 37 38 statusDefinition: text('[data-test-status-definition]'), 39 statusDecorationClass: attribute('class', '[data-test-status-definition] .status-text'), 40 addressDefinition: text('[data-test-address-definition]'), 41 datacenterDefinition: text('[data-test-datacenter-definition]'), 42 43 resourceCharts: collection('[data-test-primary-metric]', { 44 name: text('[data-test-primary-metric-title]'), 45 chartClass: attribute('class', '[data-test-percentage-chart] progress'), 46 }), 47 48 ...allocations(), 49 50 allocationFilter: { 51 preemptions: clickable('[data-test-filter-preemptions]'), 52 all: clickable('[data-test-filter-all]'), 53 preemptionsCount: text('[data-test-filter-preemptions]'), 54 allCount: text('[data-test-filter-all]'), 55 }, 56 57 attributesTable: isPresent('[data-test-attributes]'), 58 metaTable: isPresent('[data-test-meta]'), 59 emptyMetaMessage: isPresent('[data-test-empty-meta-message]'), 60 61 metaAttributes: collection('[data-test-meta] [data-test-attributes-section]', { 62 key: text('[data-test-key]'), 63 value: text('[data-test-value]'), 64 }), 65 66 error: { 67 isShown: isPresent('[data-test-error]'), 68 title: text('[data-test-error-title]'), 69 message: text('[data-test-error-message]'), 70 seekHelp: clickable('[data-test-error-message] a'), 71 }, 72 73 hasEvents: isPresent('[data-test-client-events]'), 74 events: collection('[data-test-client-event]', { 75 time: text('[data-test-client-event-time]'), 76 subsystem: text('[data-test-client-event-subsystem]'), 77 message: text('[data-test-client-event-message]'), 78 }), 79 80 hasHostVolumes: isPresent('[data-test-client-host-volumes]'), 81 hostVolumes: collection('[data-test-client-host-volume]', { 82 name: text('[data-test-name]'), 83 path: text('[data-test-path]'), 84 permissions: text('[data-test-permissions]'), 85 }), 86 87 driverHeads: collection('[data-test-driver-status] [data-test-accordion-head]', { 88 name: text('[data-test-name]'), 89 detected: text('[data-test-detected]'), 90 lastUpdated: text('[data-test-last-updated]'), 91 healthIsShown: isPresent('[data-test-health]'), 92 health: text('[data-test-health]'), 93 healthClass: attribute('class', '[data-test-health] .color-swatch'), 94 95 toggle: clickable('[data-test-accordion-toggle]'), 96 }), 97 98 driverBodies: collection('[data-test-driver-status] [data-test-accordion-body]', { 99 description: text('[data-test-health-description]'), 100 descriptionIsShown: isPresent('[data-test-health-description]'), 101 attributesAreShown: isPresent('[data-test-driver-attributes]'), 102 }), 103 104 drainDetails: { 105 scope: '[data-test-drain-details]', 106 durationIsPresent: isPresent('[data-test-duration]'), 107 duration: text('[data-test-duration]'), 108 durationTooltip: attribute('aria-label', '[data-test-duration]'), 109 durationIsShown: isPresent('[data-test-duration]'), 110 deadline: text('[data-test-deadline]'), 111 deadlineTooltip: attribute('aria-label', '[data-test-deadline]'), 112 deadlineIsShown: isPresent('[data-test-deadline]'), 113 forceDrainText: text('[data-test-force-drain-text]'), 114 drainSystemJobsText: text('[data-test-drain-system-jobs-text]'), 115 116 completeCount: text('[data-test-complete-count]'), 117 migratingCount: text('[data-test-migrating-count]'), 118 remainingCount: text('[data-test-remaining-count]'), 119 status: text('[data-test-status]'), 120 force: twoStepButton('[data-test-force]'), 121 }, 122 123 drainPopover: { 124 label: text('[data-test-drain-popover] [data-test-popover-trigger]'), 125 isOpen: isPresent('[data-test-drain-popover-form]'), 126 toggle: clickable('[data-test-drain-popover] [data-test-popover-trigger]'), 127 isDisabled: attribute('aria-disabled', '[data-test-popover-trigger]'), 128 129 deadlineToggle: toggle('[data-test-drain-deadline-toggle]'), 130 deadlineOptions: { 131 open: clickable('[data-test-drain-deadline-option-select] .ember-power-select-trigger'), 132 options: collection('.ember-power-select-option', { 133 label: text(), 134 choose: clickable(), 135 }), 136 }, 137 138 setCustomDeadline: fillable('[data-test-drain-custom-deadline]'), 139 customDeadline: attribute('value', '[data-test-drain-custom-deadline]'), 140 forceDrainToggle: toggle('[data-test-force-drain-toggle]'), 141 systemJobsToggle: toggle('[data-test-system-jobs-toggle]'), 142 143 submit: clickable('[data-test-drain-submit]'), 144 cancel: clickable('[data-test-drain-cancel]'), 145 146 setDeadline(label) { 147 this.deadlineOptions.open(); 148 this.deadlineOptions.options 149 .toArray() 150 .findBy('label', label) 151 .choose(); 152 }, 153 }, 154 155 stopDrain: twoStepButton('[data-test-drain-stop]'), 156 stopDrainIsPresent: isPresent('[data-test-drain-stop]'), 157 158 eligibilityToggle: toggle('[data-test-eligibility-toggle]'), 159 160 eligibilityError: notification('[data-test-eligibility-error]'), 161 stopDrainError: notification('[data-test-stop-drain-error]'), 162 drainError: notification('[data-test-drain-error]'), 163 drainStoppedNotification: notification('[data-test-drain-stopped-notification]'), 164 drainUpdatedNotification: notification('[data-test-drain-updated-notification]'), 165 drainCompleteNotification: notification('[data-test-drain-complete-notification]'), 166 });