github.com/zoomfoo/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/ui/tests/pages/clients/detail.js (about)

     1  import {
     2    attribute,
     3    create,
     4    collection,
     5    clickable,
     6    hasClass,
     7    text,
     8    isPresent,
     9    visitable,
    10  } from 'ember-cli-page-object';
    11  
    12  import allocations from 'nomad-ui/tests/pages/components/allocations';
    13  
    14  export default create({
    15    visit: visitable('/clients/:id'),
    16  
    17    breadcrumbs: collection('[data-test-breadcrumb]', {
    18      id: attribute('data-test-breadcrumb'),
    19      text: text(),
    20      visit: clickable(),
    21    }),
    22  
    23    breadcrumbFor(id) {
    24      return this.breadcrumbs.toArray().find(crumb => crumb.id === id);
    25    },
    26  
    27    title: text('[data-test-title]'),
    28  
    29    statusLight: collection('[data-test-node-status]', {
    30      id: attribute('data-test-node-status'),
    31      text: text(),
    32    }),
    33  
    34    statusDefinition: text('[data-test-status-definition]'),
    35    statusDecorationClass: attribute('class', '[data-test-status-definition] .status-text'),
    36    addressDefinition: text('[data-test-address-definition]'),
    37    drainingDefinition: text('[data-test-draining]'),
    38    eligibilityDefinition: text('[data-test-eligibility]'),
    39    datacenterDefinition: text('[data-test-datacenter-definition]'),
    40  
    41    ...allocations(),
    42  
    43    attributesTable: isPresent('[data-test-attributes]'),
    44    metaTable: isPresent('[data-test-meta]'),
    45    emptyMetaMessage: isPresent('[data-test-empty-meta-message]'),
    46  
    47    metaAttributes: collection('[data-test-meta] [data-test-attributes-section]', {
    48      key: text('[data-test-key]'),
    49      value: text('[data-test-value]'),
    50    }),
    51  
    52    error: {
    53      isShown: 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    hasEvents: isPresent('[data-test-client-events]'),
    60    events: collection('[data-test-client-event]', {
    61      time: text('[data-test-client-event-time]'),
    62      subsystem: text('[data-test-client-event-subsystem]'),
    63      message: text('[data-test-client-event-message]'),
    64    }),
    65  
    66    driverHeads: collection('[data-test-driver-status] [data-test-accordion-head]', {
    67      name: text('[data-test-name]'),
    68      detected: text('[data-test-detected]'),
    69      lastUpdated: text('[data-test-last-updated]'),
    70      healthIsShown: isPresent('[data-test-health]'),
    71      health: text('[data-test-health]'),
    72      healthClass: attribute('class', '[data-test-health] .color-swatch'),
    73  
    74      toggle: clickable('[data-test-accordion-toggle]'),
    75    }),
    76  
    77    driverBodies: collection('[data-test-driver-status] [data-test-accordion-body]', {
    78      description: text('[data-test-health-description]'),
    79      descriptionIsShown: isPresent('[data-test-health-description]'),
    80      attributesAreShown: isPresent('[data-test-driver-attributes]'),
    81    }),
    82  
    83    drain: {
    84      deadline: text('[data-test-drain-deadline]'),
    85      forcedDeadline: text('[data-test-drain-forced-deadline]'),
    86      hasForcedDeadline: isPresent('[data-test-drain-forced-deadline]'),
    87      ignoreSystemJobs: text('[data-test-drain-ignore-system-jobs]'),
    88      badgeIsDangerous: hasClass('is-danger', '[data-test-drain-deadline] .badge'),
    89      badgeLabel: text('[data-test-drain-deadline] .badge'),
    90    },
    91  });