2018-07-11 01:42:19 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
create,
|
|
|
|
collection,
|
|
|
|
clickable,
|
|
|
|
fillable,
|
2020-01-20 20:57:01 +00:00
|
|
|
is,
|
2018-07-11 01:42:19 +00:00
|
|
|
isPresent,
|
|
|
|
text,
|
|
|
|
visitable,
|
|
|
|
} from 'ember-cli-page-object';
|
|
|
|
|
2019-01-24 04:33:47 +00:00
|
|
|
import facet from 'nomad-ui/tests/pages/components/facet';
|
2020-04-02 22:52:44 +00:00
|
|
|
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({
|
2020-03-31 23:11:23 +00:00
|
|
|
pageSize: 25,
|
2018-07-11 01:42:19 +00:00
|
|
|
|
|
|
|
visit: visitable('/jobs'),
|
|
|
|
|
|
|
|
search: fillable('[data-test-jobs-search] input'),
|
|
|
|
|
2020-01-20 20:57:01 +00:00
|
|
|
runJobButton: {
|
|
|
|
scope: '[data-test-run-job]',
|
|
|
|
isDisabled: is('[disabled]'),
|
|
|
|
},
|
2018-08-16 00:12:18 +00:00
|
|
|
|
2018-07-11 01:42:19 +00:00
|
|
|
jobs: collection('[data-test-job-row]', {
|
2018-08-10 18:20:44 +00:00
|
|
|
id: attribute('data-test-job-row'),
|
2018-07-11 01:42:19 +00:00
|
|
|
name: text('[data-test-job-name]'),
|
|
|
|
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]'),
|
|
|
|
|
|
|
|
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: {
|
2018-07-11 18:41:34 +00:00
|
|
|
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'),
|
2018-11-08 00:19:45 +00:00
|
|
|
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
|
|
|
|
|
|
|
namespaceSwitcher: {
|
|
|
|
isPresent: isPresent('[data-test-namespace-switcher]'),
|
|
|
|
open: clickable('[data-test-namespace-switcher] .ember-power-select-trigger'),
|
|
|
|
options: collection('.ember-power-select-option', {
|
2019-03-14 06:43:46 +00:00
|
|
|
testContainer: '#ember-testing',
|
|
|
|
resetScope: true,
|
2018-07-11 18:59:20 +00:00
|
|
|
label: text(),
|
|
|
|
}),
|
|
|
|
},
|
2019-01-24 04:33:47 +00:00
|
|
|
|
2020-04-02 22:52:44 +00:00
|
|
|
pageSizeSelect: pageSizeSelect(),
|
2020-03-31 23:11:23 +00:00
|
|
|
|
2019-01-24 04:33:47 +00:00
|
|
|
facets: {
|
|
|
|
type: facet('[data-test-type-facet]'),
|
|
|
|
status: facet('[data-test-status-facet]'),
|
|
|
|
datacenter: facet('[data-test-datacenter-facet]'),
|
|
|
|
prefix: facet('[data-test-prefix-facet]'),
|
|
|
|
},
|
2018-07-11 01:42:19 +00:00
|
|
|
});
|