From 0463df0e03df8aac86a34dcb173248fd2f7c9fe7 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 3 Apr 2020 19:25:18 -0700 Subject: [PATCH] Page object for volumes list --- ui/tests/pages/storage/volumes/list.js | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ui/tests/pages/storage/volumes/list.js diff --git a/ui/tests/pages/storage/volumes/list.js b/ui/tests/pages/storage/volumes/list.js new file mode 100644 index 000000000..909575c4f --- /dev/null +++ b/ui/tests/pages/storage/volumes/list.js @@ -0,0 +1,41 @@ +import { clickable, collection, create, isPresent, text, visitable } from 'ember-cli-page-object'; + +import error from 'nomad-ui/tests/pages/components/error'; + +export default create({ + pageSize: 10, + + visit: visitable('/csi/volumes'), + + volumes: collection('[data-test-volume-row]', { + name: text('[data-test-volume-name]'), + schedulable: text('[data-test-volume-schedulable]'), + controllerHealth: text('[data-test-volume-controller-health]'), + nodeHealth: text('[data-test-volume-node-health]'), + provider: text('[data-test-volume-provider]'), + allocations: text('[data-test-volume-allocations]'), + + clickRow: clickable(), + clickName: clickable('[data-test-volume-name] a'), + }), + + nextPage: clickable('[data-test-pager="next"]'), + prevPage: clickable('[data-test-pager="prev"]'), + + isEmpty: isPresent('[data-test-empty-volumes-list]'), + emptyState: { + headline: text('[data-test-empty-volumes-list-headline]'), + }, + + error: error(), + + namespaceSwitcher: { + isPresent: isPresent('[data-test-namespace-switcher]'), + open: clickable('[data-test-namespace-switcher] .ember-power-select-trigger'), + options: collection('.ember-power-select-option', { + testContainer: '#ember-testing', + resetScope: true, + label: text(), + }), + }, +});