mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import Bluebird from 'bluebird';
|
|
|
|
import PageObjects from './';
|
|
import {
|
|
defaultFindTimeout,
|
|
} from '../';
|
|
|
|
async function getVisibleTextFromAceEditor(editor) {
|
|
const lines = await editor.findAllByClassName('ace_line_group');
|
|
const linesText = await Bluebird.map(lines, l => l.getVisibleText());
|
|
return linesText.join('\n');
|
|
}
|
|
|
|
export default class ConsolePage {
|
|
init() {
|
|
|
|
}
|
|
|
|
async getRequest() {
|
|
const requestEditor = await PageObjects.common.findTestSubject('console request-editor');
|
|
return await getVisibleTextFromAceEditor(requestEditor);
|
|
}
|
|
|
|
async getResponse() {
|
|
const responseEditor = await PageObjects.common.findTestSubject('console response-editor');
|
|
return await getVisibleTextFromAceEditor(responseEditor);
|
|
}
|
|
|
|
async clickPlay() {
|
|
const sendRequestButton = await PageObjects.common.findTestSubject('console send-request-button');
|
|
await sendRequestButton.click();
|
|
}
|
|
|
|
async collapseHelp() {
|
|
const closeButton = await PageObjects.common.findTestSubject('console top-nav config-close-button');
|
|
await closeButton.click();
|
|
}
|
|
}
|