github.com/hernad/nomad@v1.6.112/ui/tests/pages/jobs/job/task-group.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import { 7 clickable, 8 create, 9 collection, 10 fillable, 11 isPresent, 12 text, 13 visitable, 14 } from 'ember-cli-page-object'; 15 16 import allocations from 'nomad-ui/tests/pages/components/allocations'; 17 import error from 'nomad-ui/tests/pages/components/error'; 18 import pageSizeSelect from 'nomad-ui/tests/pages/components/page-size-select'; 19 import stepperInput from 'nomad-ui/tests/pages/components/stepper-input'; 20 import LifecycleChart from 'nomad-ui/tests/pages/components/lifecycle-chart'; 21 import { multiFacet } from 'nomad-ui/tests/pages/components/facet'; 22 23 export default create({ 24 pageSize: 25, 25 26 visit: visitable('/jobs/:id/:name'), 27 28 search: fillable('.search-box input'), 29 30 countStepper: stepperInput('[data-test-task-group-count-stepper]'), 31 incrementButton: { scope: '[data-test-stepper-increment]' }, 32 33 tasksCount: text('[data-test-task-group-tasks]'), 34 cpu: text('[data-test-task-group-cpu]'), 35 mem: text('[data-test-task-group-mem]'), 36 disk: text('[data-test-task-group-disk]'), 37 38 ...allocations(), 39 40 isEmpty: isPresent('[data-test-empty-allocations-list]'), 41 42 facets: { 43 status: multiFacet('[data-test-allocation-status-facet]'), 44 client: multiFacet('[data-test-allocation-client-facet]'), 45 }, 46 47 lifecycleChart: LifecycleChart, 48 49 hasVolumes: isPresent('[data-test-volumes]'), 50 volumes: collection('[data-test-volumes] [data-test-volume]', { 51 name: text('[data-test-volume-name]'), 52 type: text('[data-test-volume-type]'), 53 source: text('[data-test-volume-source]'), 54 permissions: text('[data-test-volume-permissions]'), 55 }), 56 57 hasScaleEvents: isPresent('[data-test-scale-events]'), 58 scaleEvents: collection( 59 '[data-test-scale-events] [data-test-accordion-head]', 60 { 61 error: isPresent('[data-test-error]'), 62 time: text('[data-test-time]'), 63 count: text('[data-test-count]'), 64 countIcon: { scope: '[data-test-count-icon]' }, 65 message: text('[data-test-message]'), 66 67 isToggleable: isPresent( 68 '[data-test-accordion-toggle]:not(.is-invisible)' 69 ), 70 toggle: clickable('[data-test-accordion-toggle]'), 71 } 72 ), 73 74 scaleEventBodies: collection( 75 '[data-test-scale-events] [data-test-accordion-body]', 76 { 77 meta: text(), 78 } 79 ), 80 81 hasScalingTimeline: isPresent('[data-test-scaling-timeline]'), 82 scalingAnnotations: collection( 83 '[data-test-scaling-timeline] [data-test-annotation]', 84 { 85 open: clickable('button'), 86 } 87 ), 88 89 error: error(), 90 91 emptyState: { 92 headline: text('[data-test-empty-allocations-list-headline]'), 93 }, 94 95 pageSizeSelect: pageSizeSelect(), 96 });