2020-10-29 12:46:42 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
clickable,
|
|
|
|
collection,
|
|
|
|
create,
|
|
|
|
hasClass,
|
2020-11-04 18:22:24 +00:00
|
|
|
isPresent,
|
2020-10-29 12:46:42 +00:00
|
|
|
text,
|
|
|
|
visitable,
|
|
|
|
} from 'ember-cli-page-object';
|
|
|
|
|
|
|
|
import recommendationCard from 'nomad-ui/tests/pages/components/recommendation-card';
|
2020-11-06 21:53:58 +00:00
|
|
|
import facet from 'nomad-ui/tests/pages/components/facet';
|
2020-11-30 14:18:44 +00:00
|
|
|
import toggle from 'nomad-ui/tests/pages/components/toggle';
|
2020-10-29 12:46:42 +00:00
|
|
|
|
|
|
|
export default create({
|
|
|
|
visit: visitable('/optimize'),
|
|
|
|
|
2020-11-09 15:28:40 +00:00
|
|
|
search: {
|
|
|
|
scope: '[data-test-recommendation-summaries-search] input',
|
2020-11-09 15:32:49 +00:00
|
|
|
placeholder: attribute('placeholder'),
|
2020-11-09 15:28:40 +00:00
|
|
|
},
|
|
|
|
|
2020-11-10 19:42:15 +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]'),
|
|
|
|
},
|
|
|
|
|
2020-11-30 14:18:44 +00:00
|
|
|
allNamespacesToggle: toggle('[data-test-all-namespaces-toggle]'),
|
|
|
|
|
2020-10-29 12:46:42 +00:00
|
|
|
card: recommendationCard,
|
|
|
|
|
|
|
|
recommendationSummaries: collection('[data-test-recommendation-summary-row]', {
|
|
|
|
isActive: hasClass('is-active'),
|
|
|
|
isDisabled: hasClass('is-disabled'),
|
|
|
|
|
|
|
|
slug: text('[data-test-slug]'),
|
|
|
|
namespace: text('[data-test-namespace]'),
|
|
|
|
date: text('[data-test-date]'),
|
|
|
|
allocationCount: text('[data-test-allocation-count]'),
|
|
|
|
cpu: text('[data-test-cpu]'),
|
|
|
|
memory: text('[data-test-memory]'),
|
|
|
|
aggregateCpu: text('[data-test-aggregate-cpu]'),
|
|
|
|
aggregateMemory: text('[data-test-aggregate-memory]'),
|
|
|
|
}),
|
|
|
|
|
|
|
|
empty: {
|
|
|
|
scope: '[data-test-empty-recommendations]',
|
|
|
|
headline: text('[data-test-empty-recommendations-headline]'),
|
|
|
|
},
|
|
|
|
|
|
|
|
error: {
|
|
|
|
scope: '[data-test-recommendation-error]',
|
|
|
|
headline: text('[data-test-headline]'),
|
|
|
|
errors: text('[data-test-errors]'),
|
|
|
|
dismiss: clickable('[data-test-dismiss]'),
|
|
|
|
},
|
2020-11-04 18:22:24 +00:00
|
|
|
|
|
|
|
applicationError: {
|
|
|
|
isPresent: isPresent('[data-test-error]'),
|
|
|
|
title: text('[data-test-error-title]'),
|
|
|
|
},
|
2020-10-29 12:46:42 +00:00
|
|
|
});
|