github.com/hernad/nomad@v1.6.112/ui/tests/pages/components/topo-viz/node.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import { 7 attribute, 8 collection, 9 clickable, 10 hasClass, 11 isPresent, 12 text, 13 triggerable, 14 } from 'ember-cli-page-object'; 15 16 const allocationRect = { 17 select: clickable(), 18 hover: triggerable('mouseenter'), 19 mouseleave: triggerable('mouseleave'), 20 width: attribute('width', '> rect'), 21 height: attribute('height', '> rect'), 22 isActive: hasClass('is-active'), 23 isSelected: hasClass('is-selected'), 24 running: hasClass('running'), 25 failed: hasClass('failed'), 26 pending: hasClass('pending'), 27 }; 28 29 export default (scope) => ({ 30 scope, 31 32 label: text('[data-test-label]'), 33 labelIsPresent: isPresent('[data-test-label]'), 34 statusIcon: attribute('class', '[data-test-status-icon] .icon'), 35 statusIconLabel: attribute('aria-label', '[data-test-status-icon]'), 36 37 selectNode: clickable('[data-test-node-background]'), 38 nodeIsInteractive: hasClass('is-interactive', '[data-test-node-background]'), 39 nodeIsSelected: hasClass('is-selected', '[data-test-node-background]'), 40 41 memoryRects: collection('[data-test-memory-rect]', { 42 ...allocationRect, 43 id: attribute('data-test-memory-rect'), 44 }), 45 cpuRects: collection('[data-test-cpu-rect]', { 46 ...allocationRect, 47 id: attribute('data-test-cpu-rect'), 48 }), 49 50 mouseout: triggerable('mouseout', '[data-test-topo-node-svg]'), 51 52 emptyMessage: text('[data-test-empty-message]'), 53 isEmpty: hasClass('is-empty'), 54 });