forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--------- **Commit 1:** [pageObjects/console] update selectors to use test subjects * Original sha: 565a751005fb362234f421ae0474d3c5c0359ee2 [formerly a2d37fc] * Authored by spalger <email@spalger.com> on 2016-09-12T23:34:07Z **Commit 2:** [tests/config] fix console url * Original sha: 834da4abe8bc9c41e16b56e70d2bfc7b3ce5c4de [formerly 7d7ef27] * Authored by spalger <email@spalger.com> on 2016-09-12T23:34:34Z Former-commit-id: 93c199d
- Loading branch information
1 parent
41931d8
commit 8ba86b1
Showing
6 changed files
with
47 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/core_plugins/console/public/src/directives/sense_navbar.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<kbn-top-nav name="timelion" ng-if="sense" config="navbar.menu"></kbn-top-nav> | ||
<kbn-top-nav name="console" ng-if="sense" config="navbar.menu" data-test-subj="top-nav"></kbn-top-nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,38 @@ | ||
import Bluebird from 'bluebird'; | ||
|
||
import PageObjects from './'; | ||
import { | ||
defaultFindTimeout, | ||
} from '../'; | ||
|
||
export default class ConsolePage { | ||
|
||
init(remote) { | ||
this.remote = remote; | ||
this.findTimeout = this.remote.setFindTimeout(defaultFindTimeout); | ||
} | ||
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'); | ||
} | ||
|
||
getServer() { | ||
return this.findTimeout | ||
.findByCssSelector('#kibana-body > div.content > div > div') | ||
.getVisibleText(); | ||
} | ||
export default class ConsolePage { | ||
init() { | ||
|
||
setServer(server) { | ||
return this.findTimeout | ||
.findByCssSelector('input[aria-label="Server Name"]') | ||
.clearValue() | ||
.type(server); | ||
} | ||
|
||
getRequest() { | ||
return this.findTimeout | ||
.findAllByCssSelector('div.ace_line_group') | ||
.then(function (editorData) { | ||
|
||
function getEditorData(line) { | ||
return line.getVisibleText(); | ||
} | ||
|
||
var getEditorDataPromises = editorData.map(getEditorData); | ||
return Promise.all(getEditorDataPromises); | ||
}); | ||
async getRequest() { | ||
const requestEditor = await PageObjects.common.findTestSubject('console request-editor'); | ||
return await getVisibleTextFromAceEditor(requestEditor); | ||
} | ||
|
||
getResponse() { | ||
return this.findTimeout | ||
.findByCssSelector('#output > div.ace_scroller > div') | ||
.getVisibleText(); | ||
async getResponse() { | ||
const responseEditor = await PageObjects.common.findTestSubject('console response-editor'); | ||
return await getVisibleTextFromAceEditor(responseEditor); | ||
} | ||
|
||
clickPlay() { | ||
return this.findTimeout | ||
.findByCssSelector('#editor_actions > span.ng-scope > a > i') | ||
.click(); | ||
async clickPlay() { | ||
const sendRequestButton = await PageObjects.common.findTestSubject('console send-request-button'); | ||
await sendRequestButton.click(); | ||
} | ||
|
||
collapseHelp() { | ||
return this.findTimeout | ||
.findByCssSelector('div.config-close.remove > i') | ||
.click(); | ||
|
||
async collapseHelp() { | ||
const closeButton = await PageObjects.common.findTestSubject('console top-nav config-close-button'); | ||
await closeButton.click(); | ||
} | ||
|
||
} |