-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Changes from all commits
80a85e9
97f1371
f4535f4
6b9cd4c
c8bfdb5
68ee317
69935c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: comment seems unnecessary. But up to you! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I normally would agree with you but I think the intention behind most of this test code becomes easily obscured so I've been erring on the side of caution with my comments. |
||
expect(doesExist).to.be(true); | ||
} | ||
|
||
async append(selector, text) { | ||
return await retry.try(async () => { | ||
const input = await this.find(selector); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of like the name
expectExists
. But up to you.