github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/tests/pages/allocations/fs.js (about)

     1  import {
     2    attribute,
     3    collection,
     4    clickable,
     5    create,
     6    hasClass,
     7    isPresent,
     8    text,
     9    visitable,
    10  } from 'ember-cli-page-object';
    11  
    12  export default create({
    13    visitAllocation: visitable('/allocations/:id/fs'),
    14    visitAllocationPath: visitable('/allocations/:id/fs/:path'),
    15  
    16    visitTask: visitable('/allocations/:id/:name/fs'),
    17    visitTaskPath: visitable('/allocations/:id/:name/fs/:path'),
    18  
    19    fileViewer: {
    20      scope: '[data-test-file-viewer]',
    21    },
    22  
    23    breadcrumbsText: text('[data-test-fs-breadcrumbs]'),
    24  
    25    breadcrumbs: collection('[data-test-fs-breadcrumbs] li', {
    26      visit: clickable('a'),
    27      path: attribute('href', 'a'),
    28      isActive: hasClass('is-active'),
    29    }),
    30  
    31    sortOptions: collection('[data-test-sort-by]', {
    32      id: attribute('data-test-sort-by'),
    33      sort: clickable(),
    34    }),
    35  
    36    sortBy(id) {
    37      return this.sortOptions
    38        .toArray()
    39        .findBy('id', id)
    40        .sort();
    41    },
    42  
    43    directoryEntries: collection('[data-test-entry]', {
    44      name: text('[data-test-name]'),
    45  
    46      isFile: isPresent('.icon-is-file-outline'),
    47      isDirectory: isPresent('.icon-is-folder-outline'),
    48  
    49      size: text('[data-test-size]'),
    50      lastModified: text('[data-test-last-modified]'),
    51  
    52      visit: clickable('a'),
    53      path: attribute('href', 'a'),
    54    }),
    55  
    56    isEmptyDirectory: isPresent('[data-test-empty-directory]'),
    57  
    58    directoryEntryNames() {
    59      return this.directoryEntries.toArray().mapBy('name');
    60    },
    61  
    62    hasEmptyState: isPresent('[data-test-not-running]'),
    63    emptyState: {
    64      headline: text('[data-test-not-running-headline]'),
    65    },
    66  
    67    error: {
    68      title: text('[data-test-error-title]'),
    69    },
    70  });