Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify that we've navigated to Settings by checking the title. #21245

Merged
merged 7 commits into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ exports[`AdvancedSettings should render normally 1`] = `
<EuiText
grow={true}
>
<h1>
<h1
data-test-subj="managementSettingsTitle"
>
Settings
</h1>
</EuiText>
Expand Down Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/settings_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function SettingsPageProvider({ getService, getPageObjects }) {

async clickKibanaSettings() {
await this.clickLinkText('Advanced Settings');
await PageObjects.header.waitUntilLoadingHasFinished();
await testSubjects.exists('managementSettingsTitle');
Copy link
Contributor

@stacey-gammon stacey-gammon Jul 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is some confusion about what this function does. It returns true or false, it doesn't assert that that does indeed exist. I think the default time is like 1 second, so this is the equivalent of adding a 1 second sleep. :) If you want to assert that it does exist, use find instead, as that will retry for something like 60 seconds, and fail if it is never found.

The function should probably be renamed getExists instead of exists to eliminate that confusion.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. It does return true or false. And it has a 1 second timeout, but I don't think that means it's like a 1 second sleep. If it does find it it will return as quickly as it can. If it doesn't find it within 1 second it will return false.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, in the latter case, if it doesn't find it, it's like adding a 1 second sleep. In the former case, it's like adding a variable sleep, up to 1 seconds, possibly quicker. I'm wondering if that's why the tests appear more stable.

}

async clickKibanaSavedObjects() {
Expand Down