2019-07-02 21:42:38 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
collection,
|
|
|
|
clickable,
|
|
|
|
create,
|
|
|
|
hasClass,
|
|
|
|
isPresent,
|
|
|
|
text,
|
|
|
|
visitable,
|
|
|
|
} from 'ember-cli-page-object';
|
2019-06-20 22:20:15 +00:00
|
|
|
|
|
|
|
export default create({
|
2020-06-01 13:15:59 +00:00
|
|
|
visitAllocation: visitable('/allocations/:id/fs'),
|
|
|
|
visitAllocationPath: visitable('/allocations/:id/fs/:path'),
|
|
|
|
|
|
|
|
visitTask: visitable('/allocations/:id/:name/fs'),
|
|
|
|
visitTaskPath: visitable('/allocations/:id/:name/fs/:path'),
|
2019-06-20 22:20:15 +00:00
|
|
|
|
2019-07-02 21:42:38 +00:00
|
|
|
fileViewer: {
|
|
|
|
scope: '[data-test-file-viewer]',
|
|
|
|
},
|
|
|
|
|
|
|
|
breadcrumbsText: text('[data-test-fs-breadcrumbs]'),
|
|
|
|
|
|
|
|
breadcrumbs: collection('[data-test-fs-breadcrumbs] li', {
|
|
|
|
visit: clickable('a'),
|
|
|
|
path: attribute('href', 'a'),
|
|
|
|
isActive: hasClass('is-active'),
|
|
|
|
}),
|
|
|
|
|
2019-07-23 20:37:34 +00:00
|
|
|
sortOptions: collection('[data-test-sort-by]', {
|
|
|
|
id: attribute('data-test-sort-by'),
|
|
|
|
sort: clickable(),
|
|
|
|
}),
|
|
|
|
|
|
|
|
sortBy(id) {
|
|
|
|
return this.sortOptions
|
|
|
|
.toArray()
|
|
|
|
.findBy('id', id)
|
|
|
|
.sort();
|
|
|
|
},
|
|
|
|
|
2019-07-02 21:42:38 +00:00
|
|
|
directoryEntries: collection('[data-test-entry]', {
|
|
|
|
name: text('[data-test-name]'),
|
|
|
|
|
2019-07-08 15:36:56 +00:00
|
|
|
isFile: isPresent('.icon-is-file-outline'),
|
|
|
|
isDirectory: isPresent('.icon-is-folder-outline'),
|
2019-07-02 21:42:38 +00:00
|
|
|
|
|
|
|
size: text('[data-test-size]'),
|
|
|
|
lastModified: text('[data-test-last-modified]'),
|
|
|
|
|
|
|
|
visit: clickable('a'),
|
|
|
|
path: attribute('href', 'a'),
|
|
|
|
}),
|
2019-06-20 22:20:15 +00:00
|
|
|
|
2019-08-20 00:16:26 +00:00
|
|
|
isEmptyDirectory: isPresent('[data-test-empty-directory]'),
|
|
|
|
|
2019-07-23 20:37:34 +00:00
|
|
|
directoryEntryNames() {
|
|
|
|
return this.directoryEntries.toArray().mapBy('name');
|
|
|
|
},
|
|
|
|
|
2019-06-20 22:20:15 +00:00
|
|
|
hasEmptyState: isPresent('[data-test-not-running]'),
|
|
|
|
emptyState: {
|
|
|
|
headline: text('[data-test-not-running-headline]'),
|
|
|
|
},
|
2019-07-02 21:42:38 +00:00
|
|
|
|
|
|
|
error: {
|
|
|
|
title: text('[data-test-error-title]'),
|
|
|
|
},
|
2019-06-20 22:20:15 +00:00
|
|
|
});
|