2018-07-11 02:20:02 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
create,
|
|
|
|
collection,
|
|
|
|
clickable,
|
2020-05-11 19:43:17 +00:00
|
|
|
hasClass,
|
2018-07-11 02:20:02 +00:00
|
|
|
isPresent,
|
2020-05-11 19:43:17 +00:00
|
|
|
property,
|
2018-07-11 02:20:02 +00:00
|
|
|
text,
|
|
|
|
visitable,
|
|
|
|
} from 'ember-cli-page-object';
|
|
|
|
|
2018-07-24 03:13:16 +00:00
|
|
|
import allocations from 'nomad-ui/tests/pages/components/allocations';
|
2020-05-11 16:29:30 +00:00
|
|
|
import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
|
2020-10-29 12:46:42 +00:00
|
|
|
import recommendationAccordion from 'nomad-ui/tests/pages/components/recommendation-accordion';
|
2018-07-24 03:13:16 +00:00
|
|
|
|
2018-07-11 02:20:02 +00:00
|
|
|
export default create({
|
|
|
|
visit: visitable('/jobs/:id'),
|
|
|
|
|
|
|
|
tabs: collection('[data-test-tab]', {
|
|
|
|
id: attribute('data-test-tab'),
|
|
|
|
visit: clickable('a'),
|
|
|
|
}),
|
|
|
|
|
|
|
|
tabFor(id) {
|
|
|
|
return this.tabs.toArray().findBy('id', id);
|
|
|
|
},
|
|
|
|
|
2020-10-29 12:46:42 +00:00
|
|
|
recommendations: collection('[data-test-recommendation-accordion]', recommendationAccordion),
|
|
|
|
|
2020-05-11 16:29:30 +00:00
|
|
|
stop: twoStepButton('[data-test-stop]'),
|
|
|
|
start: twoStepButton('[data-test-start]'),
|
|
|
|
|
|
|
|
execButton: {
|
|
|
|
scope: '[data-test-exec-button]',
|
2020-05-11 19:43:17 +00:00
|
|
|
isDisabled: property('disabled'),
|
|
|
|
hasTooltip: hasClass('tooltip'),
|
|
|
|
tooltipText: attribute('aria-label'),
|
2020-05-11 16:29:30 +00:00
|
|
|
},
|
|
|
|
|
2018-07-11 02:20:02 +00:00
|
|
|
stats: collection('[data-test-job-stat]', {
|
|
|
|
id: attribute('data-test-job-stat'),
|
|
|
|
text: text(),
|
|
|
|
}),
|
|
|
|
|
|
|
|
statFor(id) {
|
|
|
|
return this.stats.toArray().findBy('id', id);
|
|
|
|
},
|
|
|
|
|
2018-11-08 05:04:27 +00:00
|
|
|
childrenSummary: isPresent('[data-test-job-summary] [data-test-children-status-bar]'),
|
|
|
|
allocationsSummary: isPresent('[data-test-job-summary] [data-test-allocation-status-bar]'),
|
|
|
|
|
2018-07-24 03:13:16 +00:00
|
|
|
...allocations(),
|
|
|
|
|
|
|
|
viewAllAllocations: text('[data-test-view-all-allocations]'),
|
|
|
|
|
2020-09-19 05:20:09 +00:00
|
|
|
jobs: collection('[data-test-job-row]', {
|
|
|
|
id: attribute('data-test-job-row'),
|
|
|
|
name: text('[data-test-job-name]'),
|
|
|
|
link: attribute('href', '[data-test-job-name] a'),
|
|
|
|
submitTime: text('[data-test-job-submit-time]'),
|
|
|
|
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-07-11 02:20:02 +00:00
|
|
|
error: {
|
|
|
|
isPresent: isPresent('[data-test-error]'),
|
|
|
|
title: text('[data-test-error-title]'),
|
|
|
|
message: text('[data-test-error-message]'),
|
|
|
|
seekHelp: clickable('[data-test-error-message] a'),
|
|
|
|
},
|
2018-07-24 03:13:16 +00:00
|
|
|
|
|
|
|
recentAllocationsEmptyState: {
|
|
|
|
headline: text('[data-test-empty-recent-allocations-headline]'),
|
|
|
|
},
|
2018-07-11 02:20:02 +00:00
|
|
|
});
|