github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/ui/tests/pages/allocations/task/detail.js (about)

     1  import {
     2    attribute,
     3    create,
     4    collection,
     5    clickable,
     6    isPresent,
     7    text,
     8    visitable,
     9  } from 'ember-cli-page-object';
    10  
    11  import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
    12  
    13  export default create({
    14    visit: visitable('/allocations/:id/:name'),
    15  
    16    title: text('[data-test-title]'),
    17    state: text('[data-test-state]'),
    18    startedAt: text('[data-test-started-at]'),
    19  
    20    restart: twoStepButton('[data-test-restart]'),
    21  
    22    breadcrumbs: collection('[data-test-breadcrumb]', {
    23      id: attribute('data-test-breadcrumb'),
    24      text: text(),
    25      visit: clickable(),
    26    }),
    27  
    28    breadcrumbFor(id) {
    29      return this.breadcrumbs.toArray().find(crumb => crumb.id === id);
    30    },
    31  
    32    resourceCharts: collection('[data-test-primary-metric]', {
    33      name: text('[data-test-primary-metric-title]'),
    34      chartClass: attribute('class', '[data-test-percentage-chart] progress'),
    35    }),
    36  
    37    resourceEmptyMessage: text('[data-test-resource-error-headline]'),
    38  
    39    hasAddresses: isPresent('[data-test-task-addresses]'),
    40    addresses: collection('[data-test-task-address]', {
    41      name: text('[data-test-task-address-name]'),
    42      isDynamic: text('[data-test-task-address-is-dynamic]'),
    43      address: text('[data-test-task-address-address]'),
    44    }),
    45  
    46    events: collection('[data-test-task-event]', {
    47      time: text('[data-test-task-event-time]'),
    48      type: text('[data-test-task-event-type]'),
    49      message: text('[data-test-task-event-message]'),
    50    }),
    51  
    52    error: {
    53      isPresent: isPresent('[data-test-error]'),
    54      title: text('[data-test-error-title]'),
    55      message: text('[data-test-error-message]'),
    56      seekHelp: clickable('[data-test-error-message] a'),
    57    },
    58  
    59    inlineError: {
    60      isShown: isPresent('[data-test-inline-error]'),
    61      title: text('[data-test-inline-error-title]'),
    62      message: text('[data-test-inline-error-body]'),
    63      dismiss: clickable('[data-test-inline-error-close]'),
    64    },
    65  });