2018-04-03 14:16:57 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
focusable,
|
|
|
|
value,
|
|
|
|
clickable,
|
|
|
|
isPresent,
|
|
|
|
collection,
|
|
|
|
fillable,
|
|
|
|
text,
|
|
|
|
triggerable,
|
|
|
|
} from 'ember-cli-page-object';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
hasStringList: isPresent('[data-test-component=string-list]'),
|
2018-12-10 16:44:37 +00:00
|
|
|
hasSearchSelect: isPresent('[data-test-component=search-select]'),
|
2018-04-03 14:16:57 +00:00
|
|
|
hasTextFile: isPresent('[data-test-component=text-file]'),
|
2020-04-20 15:17:50 +00:00
|
|
|
hasTTLPicker: isPresent('[data-test-toggle-input="Foo"]'),
|
2022-03-29 16:25:16 +00:00
|
|
|
hasJSONEditor: isPresent('[data-test-component="code-mirror-modifier"]'),
|
2021-05-27 21:25:58 +00:00
|
|
|
hasJSONClearButton: isPresent('[data-test-json-clear-button]'),
|
2018-04-03 14:16:57 +00:00
|
|
|
hasSelect: isPresent('select'),
|
|
|
|
hasInput: isPresent('input'),
|
|
|
|
hasCheckbox: isPresent('input[type=checkbox]'),
|
|
|
|
hasTextarea: isPresent('textarea'),
|
2018-12-07 21:23:42 +00:00
|
|
|
hasMaskedInput: isPresent('[data-test-masked-input]'),
|
2018-04-03 14:16:57 +00:00
|
|
|
hasTooltip: isPresent('[data-test-component=info-tooltip]'),
|
|
|
|
tooltipTrigger: focusable('[data-test-tool-tip-trigger]'),
|
|
|
|
tooltipContent: text('[data-test-help-text]'),
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
fields: collection('[data-test-field]', {
|
|
|
|
clickLabel: clickable('label'),
|
2020-04-20 15:17:50 +00:00
|
|
|
toggleTtl: clickable('[data-test-toggle-input="Foo"]'),
|
2018-09-25 16:28:26 +00:00
|
|
|
for: attribute('for', 'label', { multiple: true }),
|
|
|
|
labelText: text('label', { multiple: true }),
|
|
|
|
input: fillable('input'),
|
2020-04-20 15:17:50 +00:00
|
|
|
ttlTime: fillable('[data-test-ttl-value]'),
|
2018-09-25 16:28:26 +00:00
|
|
|
select: fillable('select'),
|
|
|
|
textarea: fillable('textarea'),
|
2019-08-14 15:02:16 +00:00
|
|
|
change: triggerable('keyup', '.input'),
|
2018-09-25 16:28:26 +00:00
|
|
|
inputValue: value('input'),
|
|
|
|
textareaValue: value('textarea'),
|
|
|
|
inputChecked: attribute('checked', 'input[type=checkbox]'),
|
|
|
|
selectValue: value('select'),
|
2018-04-03 14:16:57 +00:00
|
|
|
}),
|
2021-12-17 03:44:29 +00:00
|
|
|
fillInTextarea: async function (name, value) {
|
2018-09-25 16:28:26 +00:00
|
|
|
return this.fields
|
2021-12-17 03:44:29 +00:00
|
|
|
.filter((field) => {
|
2018-09-25 16:28:26 +00:00
|
|
|
return field.for.includes(name);
|
|
|
|
})[0]
|
|
|
|
.textarea(value);
|
|
|
|
},
|
2021-12-17 03:44:29 +00:00
|
|
|
fillIn: async function (name, value) {
|
2018-09-25 16:28:26 +00:00
|
|
|
return this.fields
|
2021-12-17 03:44:29 +00:00
|
|
|
.filter((field) => {
|
2018-09-25 16:28:26 +00:00
|
|
|
return field.for.includes(name);
|
|
|
|
})[0]
|
|
|
|
.input(value);
|
|
|
|
},
|
2018-04-03 14:16:57 +00:00
|
|
|
};
|