-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8245 from elastic/jasper/backport/8241/5.0
[backport] PR #8241 to 5.0 - Fix functional tests - dev tools selectors
- Loading branch information
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(); | ||
} | ||
|
||
} |