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
fix: prevented waiting element in the second time if an error was raised in the first #7111
Conversation
… was raised in the first.
@@ -2,6 +2,23 @@ import { AutomationErrorCtor } from '../types'; | |||
import { FnInfo, SelectorErrorCb } from '../../client/driver/command-executors/client-functions/types'; | |||
import * as Errors from './index'; | |||
|
|||
export function createInvisibleErrorCtor (elementName?: string): AutomationErrorCtor | string { |
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.
export function getInvisibleErrorCtorData
}; | ||
} | ||
|
||
export function createNotFoundErrorCtor (elementName?: string): AutomationErrorCtor | string { |
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.
export function getNotFoundErrorCtorData
@@ -69,8 +69,11 @@ function assertErrorMessage (fn, expectedErrMessage) { | |||
expect(actualErr.message).eql(expectedErrMessage); | |||
} | |||
|
|||
function makeSelector (str, skipVisibilityCheck) { | |||
const builder = new SelectorBuilder(str, { visibilityCheck: !skipVisibilityCheck }, { instantiation: 'Selector' }); | |||
function makeSelector (str, skipVisibilityCheck, needError, separatedErrors) { |
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.
Add default values to boolean arguments.
@@ -43,4 +44,20 @@ describe('[API] t.typeText()', function () { | |||
expect(errs[0]).to.contains('> 19 | await t.typeText(NaN, \'a\');'); | |||
}); | |||
}); | |||
|
|||
if (!config.proxyless) { | |||
it('Should not get selector the second time if the error was raised in the first.', function () { |
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.
Should not execute selector twice for non-existing element due to "confidential" option (GH-6623)
only: 'chrome', | ||
}) | ||
.catch(function (errs) { | ||
expect(testReport.durationMs).lessThan(1100); |
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.
Increase the selectorTimeout
value to make test more stable (this test sometimes failed on my machine).
@@ -156,6 +156,7 @@ export default class SelectorBuilder extends ClientFunctionBuilder { | |||
apiFnChain: this.options.apiFnChain, | |||
visibilityCheck: !!this.options.visibilityCheck, | |||
timeout: this.options.timeout, | |||
separatedErrors: this.options.separatedErrors, |
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 propose another name for this option - strictError
.
Release v1.20.0-rc.1 addresses this. |
[closes #6623]
Purpose
Prevent executing selector twice when it isn't available for the
typeText
command.Approach
References
#6623
Pre-Merge TODO