github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/tests/pages/allocations/detail.js (about)

     1  import {
     2    attribute,
     3    clickable,
     4    create,
     5    collection,
     6    isPresent,
     7    text,
     8    visitable,
     9  } from 'ember-cli-page-object';
    10  
    11  import allocations from 'nomad-ui/tests/pages/components/allocations';
    12  import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
    13  import LifecycleChart from 'nomad-ui/tests/pages/components/lifecycle-chart';
    14  
    15  export default create({
    16    visit: visitable('/allocations/:id'),
    17  
    18    title: text('[data-test-title]'),
    19  
    20    stop: twoStepButton('[data-test-stop]'),
    21    restart: twoStepButton('[data-test-restart]'),
    22  
    23    execButton: {
    24      scope: '[data-test-exec-button]',
    25    },
    26  
    27    details: {
    28      scope: '[data-test-allocation-details]',
    29  
    30      job: text('[data-test-job-link]'),
    31      visitJob: clickable('[data-test-job-link]'),
    32  
    33      client: text('[data-test-client-link]'),
    34      visitClient: clickable('[data-test-client-link]'),
    35    },
    36  
    37    resourceCharts: collection('[data-test-primary-metric]', {
    38      name: text('[data-test-primary-metric-title]'),
    39      chartClass: attribute('class', '[data-test-percentage-chart] progress'),
    40    }),
    41  
    42    resourceEmptyMessage: text('[data-test-resource-error-headline]'),
    43  
    44    lifecycleChart: LifecycleChart,
    45  
    46    tasks: collection('[data-test-task-row]', {
    47      name: text('[data-test-name]'),
    48      state: text('[data-test-state]'),
    49      message: text('[data-test-message]'),
    50      time: text('[data-test-time]'),
    51      ports: text('[data-test-ports]'),
    52      volumes: text('[data-test-volumes]'),
    53  
    54      hasUnhealthyDriver: isPresent('[data-test-icon="unhealthy-driver"]'),
    55      hasProxyTag: isPresent('[data-test-proxy-tag]'),
    56  
    57      clickLink: clickable('[data-test-name] a'),
    58      clickRow: clickable('[data-test-name]'),
    59    }),
    60  
    61    firstUnhealthyTask() {
    62      return this.tasks.toArray().findBy('hasUnhealthyDriver');
    63    },
    64  
    65    hasRescheduleEvents: isPresent('[data-test-reschedule-events]'),
    66  
    67    isEmpty: isPresent('[data-test-empty-tasks-list]'),
    68  
    69    wasPreempted: isPresent('[data-test-was-preempted]'),
    70    preempter: {
    71      scope: '[data-test-was-preempted]',
    72  
    73      status: text('[data-test-allocation-status]'),
    74      name: text('[data-test-allocation-name]'),
    75      priority: text('[data-test-job-priority]'),
    76      reservedCPU: text('[data-test-allocation-cpu]'),
    77      reservedMemory: text('[data-test-allocation-memory]'),
    78  
    79      visit: clickable('[data-test-allocation-id]'),
    80      visitJob: clickable('[data-test-job-link]'),
    81      visitClient: clickable('[data-test-client-link]'),
    82    },
    83  
    84    preempted: isPresent('[data-test-preemptions]'),
    85    ...allocations('[data-test-preemptions] [data-test-allocation]', 'preemptions'),
    86  
    87    ports: collection('[data-test-allocation-port]', {
    88      dynamic: text('[data-test-allocation-port-is-dynamic]'),
    89      name: text('[data-test-allocation-port-name]'),
    90      address: text('[data-test-allocation-port-address]'),
    91      to: text('[data-test-allocation-port-to]'),
    92    }),
    93  
    94    services: collection('[data-test-service]', {
    95      name: text('[data-test-service-name]'),
    96      port: text('[data-test-service-port]'),
    97      tags: text('[data-test-service-tags]'),
    98      connect: text('[data-test-service-connect]'),
    99      upstreams: text('[data-test-service-upstreams]'),
   100    }),
   101  
   102    error: {
   103      isShown: isPresent('[data-test-error]'),
   104      title: text('[data-test-error-title]'),
   105      message: text('[data-test-error-message]'),
   106      seekHelp: clickable('[data-test-error-message] a'),
   107    },
   108  
   109    inlineError: {
   110      isShown: isPresent('[data-test-inline-error]'),
   111      title: text('[data-test-inline-error-title]'),
   112      message: text('[data-test-inline-error-body]'),
   113      dismiss: clickable('[data-test-inline-error-close]'),
   114    },
   115  });