github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/tests/pages/jobs/detail.js (about) 1 import { 2 attribute, 3 create, 4 collection, 5 clickable, 6 hasClass, 7 isPresent, 8 property, 9 text, 10 visitable, 11 } from 'ember-cli-page-object'; 12 13 import allocations from 'nomad-ui/tests/pages/components/allocations'; 14 import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button'; 15 import recommendationAccordion from 'nomad-ui/tests/pages/components/recommendation-accordion'; 16 17 export default create({ 18 visit: visitable('/jobs/:id'), 19 20 tabs: collection('[data-test-tab]', { 21 id: attribute('data-test-tab'), 22 visit: clickable('a'), 23 }), 24 25 tabFor(id) { 26 return this.tabs.toArray().findBy('id', id); 27 }, 28 29 recommendations: collection('[data-test-recommendation-accordion]', recommendationAccordion), 30 31 stop: twoStepButton('[data-test-stop]'), 32 start: twoStepButton('[data-test-start]'), 33 34 execButton: { 35 scope: '[data-test-exec-button]', 36 isDisabled: property('disabled'), 37 hasTooltip: hasClass('tooltip'), 38 tooltipText: attribute('aria-label'), 39 }, 40 41 stats: collection('[data-test-job-stat]', { 42 id: attribute('data-test-job-stat'), 43 text: text(), 44 }), 45 46 statFor(id) { 47 return this.stats.toArray().findBy('id', id); 48 }, 49 50 childrenSummary: isPresent('[data-test-job-summary] [data-test-children-status-bar]'), 51 allocationsSummary: isPresent('[data-test-job-summary] [data-test-allocation-status-bar]'), 52 53 ...allocations(), 54 55 viewAllAllocations: text('[data-test-view-all-allocations]'), 56 57 jobs: collection('[data-test-job-row]', { 58 id: attribute('data-test-job-row'), 59 name: text('[data-test-job-name]'), 60 link: attribute('href', '[data-test-job-name] a'), 61 submitTime: text('[data-test-job-submit-time]'), 62 status: text('[data-test-job-status]'), 63 type: text('[data-test-job-type]'), 64 priority: text('[data-test-job-priority]'), 65 taskGroups: text('[data-test-job-task-groups]'), 66 67 clickRow: clickable(), 68 clickName: clickable('[data-test-job-name] a'), 69 }), 70 71 error: { 72 isPresent: isPresent('[data-test-error]'), 73 title: text('[data-test-error-title]'), 74 message: text('[data-test-error-message]'), 75 seekHelp: clickable('[data-test-error-message] a'), 76 }, 77 78 recentAllocationsEmptyState: { 79 headline: text('[data-test-empty-recent-allocations-headline]'), 80 }, 81 });