open-nomad/ui/tests/pages/jobs/list.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
2.0 KiB
JavaScript
Raw Normal View History

2018-07-11 01:42:19 +00:00
import {
attribute,
create,
collection,
clickable,
isPresent,
property,
2018-07-11 01:42:19 +00:00
text,
triggerable,
2018-07-11 01:42:19 +00:00
visitable,
} from 'ember-cli-page-object';
import { multiFacet, singleFacet } from 'nomad-ui/tests/pages/components/facet';
import pageSizeSelect from 'nomad-ui/tests/pages/components/page-size-select';
2019-01-24 04:33:47 +00:00
2018-07-11 01:42:19 +00:00
export default create({
pageSize: 25,
2018-07-11 01:42:19 +00:00
visit: visitable('/jobs'),
search: {
scope: '[data-test-jobs-search] input',
keydown: triggerable('keydown'),
},
2018-07-11 01:42:19 +00:00
runJobButton: {
scope: '[data-test-run-job]',
isDisabled: property('disabled'),
},
2018-08-16 00:12:18 +00:00
2018-07-11 01:42:19 +00:00
jobs: collection('[data-test-job-row]', {
id: attribute('data-test-job-row'),
2018-07-11 01:42:19 +00:00
name: text('[data-test-job-name]'),
namespace: text('[data-test-job-namespace]'),
2018-07-11 01:42:19 +00:00
link: attribute('href', '[data-test-job-name] a'),
status: text('[data-test-job-status]'),
type: text('[data-test-job-type]'),
priority: text('[data-test-job-priority]'),
taskGroups: text('[data-test-job-task-groups]'),
hasNamespace: isPresent('[data-test-job-namespace]'),
2018-07-11 01:42:19 +00:00
clickRow: clickable(),
clickName: clickable('[data-test-job-name] a'),
}),
2018-10-30 21:17:23 +00:00
nextPage: clickable('[data-test-pager="next"]'),
prevPage: clickable('[data-test-pager="prev"]'),
2018-07-11 01:42:19 +00:00
isEmpty: isPresent('[data-test-empty-jobs-list]'),
emptyState: {
headline: text('[data-test-empty-jobs-list-headline]'),
},
error: {
isPresent: isPresent('[data-test-error]'),
2018-07-11 01:42:19 +00:00
title: text('[data-test-error-title]'),
message: text('[data-test-error-message]'),
seekHelp: clickable('[data-test-error-message] a'),
gotoJobs: clickable('[data-test-error-jobs-link]'),
gotoClients: clickable('[data-test-error-clients-link]'),
2018-07-11 01:42:19 +00:00
},
2018-07-11 18:59:20 +00:00
pageSizeSelect: pageSizeSelect(),
2019-01-24 04:33:47 +00:00
facets: {
namespace: singleFacet('[data-test-namespace-facet]'),
type: multiFacet('[data-test-type-facet]'),
status: multiFacet('[data-test-status-facet]'),
datacenter: multiFacet('[data-test-datacenter-facet]'),
prefix: multiFacet('[data-test-prefix-facet]'),
2019-01-24 04:33:47 +00:00
},
2018-07-11 01:42:19 +00:00
});