github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/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  
    16  export default create({
    17    visit: visitable('/jobs/:id'),
    18  
    19    tabs: collection('[data-test-tab]', {
    20      id: attribute('data-test-tab'),
    21      visit: clickable('a'),
    22    }),
    23  
    24    tabFor(id) {
    25      return this.tabs.toArray().findBy('id', id);
    26    },
    27  
    28    stop: twoStepButton('[data-test-stop]'),
    29    start: twoStepButton('[data-test-start]'),
    30  
    31    execButton: {
    32      scope: '[data-test-exec-button]',
    33      isDisabled: property('disabled'),
    34      hasTooltip: hasClass('tooltip'),
    35      tooltipText: attribute('aria-label'),
    36    },
    37  
    38    stats: collection('[data-test-job-stat]', {
    39      id: attribute('data-test-job-stat'),
    40      text: text(),
    41    }),
    42  
    43    statFor(id) {
    44      return this.stats.toArray().findBy('id', id);
    45    },
    46  
    47    childrenSummary: isPresent('[data-test-job-summary] [data-test-children-status-bar]'),
    48    allocationsSummary: isPresent('[data-test-job-summary] [data-test-allocation-status-bar]'),
    49  
    50    ...allocations(),
    51  
    52    viewAllAllocations: text('[data-test-view-all-allocations]'),
    53  
    54    error: {
    55      isPresent: isPresent('[data-test-error]'),
    56      title: text('[data-test-error-title]'),
    57      message: text('[data-test-error-message]'),
    58      seekHelp: clickable('[data-test-error-message] a'),
    59    },
    60  
    61    recentAllocationsEmptyState: {
    62      headline: text('[data-test-empty-recent-allocations-headline]'),
    63    },
    64  });