open-nomad/ui/tests/pages/exec.js
Buck Doyle 674da96a59
UI: add exec terminal (#6697)
This connects Xterm.js to a Nomad exec websocket so people
can interact on clients via live sessions. There are buttons on
job, allocation, task group, and task detail pages that open a
popup that lets them edit their shell command and start a
session.

More is to come, as recorded in issues.
2020-03-24 18:22:16 -05:00

44 lines
1 KiB
JavaScript

import {
clickable,
collection,
create,
hasClass,
isPresent,
text,
triggerable,
visitable,
} from 'ember-cli-page-object';
export default create({
visitJob: visitable('/exec/:job'),
visitTaskGroup: visitable('/exec/:job/:task_group'),
visitTask: visitable('/exec/:job/:task_group/:task_name'),
header: {
region: { scope: '[data-test-region]' },
namespace: { scope: '[data-test-namespace]' },
job: text('[data-test-job]'),
},
taskGroups: collection('[data-test-task-group]', {
click: clickable('[data-test-task-group-name]'),
name: text('[data-test-task-group-name]'),
chevron: {
scope: '.toggle-button .icon',
isDown: hasClass('icon-is-chevron-down'),
isRight: hasClass('icon-is-chevron-right'),
},
tasks: collection('[data-test-task]', {
name: text(),
isActive: isPresent('[data-test-task-active]'),
}),
}),
terminal: {
scope: '.xterm-helper-textarea',
pressEnter: triggerable('keydown', '', { eventProperties: { keyCode: 13 } }),
},
});