github.com/hernad/nomad@v1.6.112/ui/tests/pages/jobs/dispatch.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import { 7 clickable, 8 collection, 9 create, 10 fillable, 11 isPresent, 12 isVisible, 13 property, 14 text, 15 visitable, 16 } from 'ember-cli-page-object'; 17 import { codeFillable, code } from 'nomad-ui/tests/pages/helpers/codemirror'; 18 19 export default create({ 20 visit: visitable('/jobs/:id/dispatch'), 21 22 dispatchButton: { 23 scope: '[data-test-dispatch-button]', 24 isDisabled: property('disabled'), 25 click: clickable(), 26 isPresent: isPresent(), 27 }, 28 29 hasError: isVisible('[data-test-dispatch-error]'), 30 31 metaFields: collection('[data-test-meta-field]', { 32 field: { 33 scope: '[data-test-meta-field-input]', 34 input: fillable(), 35 id: property('id'), 36 }, 37 label: text('[data-test-meta-field-label]'), 38 }), 39 40 optionalMetaFields: collection('[data-test-meta-field="optional"]', { 41 field: { 42 scope: '[data-test-meta-field-input]', 43 input: fillable(), 44 id: property('id'), 45 }, 46 label: text('[data-test-meta-field-label]'), 47 }), 48 49 payload: { 50 title: text('[data-test-payload-head]'), 51 editor: { 52 scope: '[data-test-payload-editor]', 53 isPresent: isPresent(), 54 contents: code('[data-test-payload-editor]'), 55 fillIn: codeFillable('[data-test-payload-editor]'), 56 }, 57 emptyMessage: { 58 scope: '[data-test-empty-payload-message]', 59 isPresent: isPresent(), 60 }, 61 }, 62 });