github.com/hernad/nomad@v1.6.112/ui/tests/pages/jobs/job/deployments.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import {
     7    attribute,
     8    clickable,
     9    create,
    10    collection,
    11    isPresent,
    12    text,
    13    visitable,
    14  } from 'ember-cli-page-object';
    15  
    16  import allocations from 'nomad-ui/tests/pages/components/allocations';
    17  import error from 'nomad-ui/tests/pages/components/error';
    18  
    19  export default create({
    20    visit: visitable('/jobs/:id/deployments'),
    21  
    22    deployments: collection('[data-test-deployment]', {
    23      text: text(),
    24      status: text('[data-test-deployment-status]'),
    25      statusClass: attribute('class', '[data-test-deployment-status]'),
    26      version: text('[data-test-deployment-version]'),
    27      submitTime: text('[data-test-deployment-submit-time]'),
    28      promotionIsRequired: isPresent('[data-test-promotion-required]'),
    29  
    30      toggle: clickable('[data-test-deployment-toggle-details]'),
    31  
    32      hasDetails: isPresent('[data-test-deployment-details]'),
    33  
    34      metrics: collection('[data-test-deployment-metric]', {
    35        id: attribute('data-test-deployment-metric'),
    36        text: text(),
    37      }),
    38  
    39      metricFor(id) {
    40        return this.metrics.toArray().findBy('id', id);
    41      },
    42  
    43      notification: text('[data-test-deployment-notification]'),
    44  
    45      hasTaskGroups: isPresent('[data-test-deployment-task-groups]'),
    46      taskGroups: collection('[data-test-deployment-task-group]', {
    47        name: text('[data-test-deployment-task-group-name]'),
    48        promotion: text('[data-test-deployment-task-group-promotion]'),
    49        autoRevert: text('[data-test-deployment-task-group-auto-revert]'),
    50        canaries: text('[data-test-deployment-task-group-canaries]'),
    51        allocs: text('[data-test-deployment-task-group-allocs]'),
    52        healthy: text('[data-test-deployment-task-group-healthy]'),
    53        unhealthy: text('[data-test-deployment-task-group-unhealthy]'),
    54        progress: text('[data-test-deployment-task-group-progress-deadline]'),
    55      }),
    56  
    57      ...allocations('[data-test-deployment-allocation]'),
    58      hasAllocations: isPresent('[data-test-deployment-allocations]'),
    59    }),
    60  
    61    error: error(),
    62  });