mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Verify that we've navigated to Settings by checking the title. (#21245)
* Fail the consuming test if navigation to settings is unsuccessful. * Add testSubjects.existOrFail helper.
This commit is contained in:
parent
5fcd10ef71
commit
b328bd0e3d
4 changed files with 17 additions and 4 deletions
|
@ -20,7 +20,9 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
<EuiText
|
||||
grow={true}
|
||||
>
|
||||
<h1>
|
||||
<h1
|
||||
data-test-subj="managementSettingsTitle"
|
||||
>
|
||||
Settings
|
||||
</h1>
|
||||
</EuiText>
|
||||
|
@ -253,7 +255,9 @@ exports[`AdvancedSettings should render specific setting if given setting key 1`
|
|||
<EuiText
|
||||
grow={true}
|
||||
>
|
||||
<h1>
|
||||
<h1
|
||||
data-test-subj="managementSettingsTitle"
|
||||
>
|
||||
Settings
|
||||
</h1>
|
||||
</EuiText>
|
||||
|
|
|
@ -137,7 +137,7 @@ export class AdvancedSettings extends Component {
|
|||
<EuiFlexGroup gutterSize="none">
|
||||
<EuiFlexItem>
|
||||
<EuiText>
|
||||
<h1>Settings</h1>
|
||||
<h1 data-test-subj="managementSettingsTitle">Settings</h1>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
|
|
|
@ -45,7 +45,8 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
|
|||
|
||||
async clickKibanaSettings() {
|
||||
await this.clickLinkText('Advanced Settings');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
// Verify navigation is successful.
|
||||
await testSubjects.existOrFail('managementSettingsTitle');
|
||||
}
|
||||
|
||||
async clickKibanaSavedObjects() {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import expect from 'expect.js';
|
||||
import testSubjSelector from '@kbn/test-subj-selector';
|
||||
import {
|
||||
filter as filterAsync,
|
||||
|
@ -37,6 +38,13 @@ export function TestSubjectsProvider({ getService }) {
|
|||
return await find.existsByDisplayedByCssSelector(testSubjSelector(selector), timeout);
|
||||
}
|
||||
|
||||
async existOrFail(selector, timeout = 1000) {
|
||||
log.debug(`TestSubjects.existOrFail(${selector})`);
|
||||
const doesExist = await this.exists(selector, timeout);
|
||||
// Verify element exists, or else fail the test consuming this.
|
||||
expect(doesExist).to.be(true);
|
||||
}
|
||||
|
||||
async append(selector, text) {
|
||||
return await retry.try(async () => {
|
||||
const input = await this.find(selector);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue