-
Notifications
You must be signed in to change notification settings - Fork 3
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
Issue 1375: rework generation flow #1390
Conversation
src/app/utils/appUtils.ts
Outdated
@@ -14,7 +14,7 @@ export const checkSession = async (setStateCallback: (val: boolean) => void) => | |||
}); | |||
}; | |||
|
|||
export const getSessionId = async () => { | |||
export const initLocatorSocketController = async (xpathConfig: any) => { |
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'd suggest also type xpathConfig: MainState["xpathConfig"]
like in src/features/locators/utils/locatorGenerationController.ts
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.
done, thank you!
|
||
export const getLocator = (locatorValue: LocatorValue, locatorType: LocatorType = LocatorType.xPath) => { | ||
if (locatorType !== LocatorType.cssSelector) return locatorValue.xPath; | ||
return locatorValue.cssSelector; | ||
return locatorValue.cssSelector || CALCULATING; |
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.
Can we have a situation when xPath also will be calculating?
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.
No, we can't. CALCULATING is shown when Css is undefined. xPath can't be undefined, at least it will be fullXpath value
|
||
export const runCssSelectorGeneration = async (locators: Locator[]) => { | ||
sendMessage.generateSelectorGroupByHash({ elements: locators, fireCallbackMessage: true }); | ||
return Promise.resolve("started"); |
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'd suggest use LocatorsGenerationStatus
enum here like in src/features/locators/utils/runXpathGeneration.ts
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.
sure. done
@@ -57,7 +57,9 @@ export const changeLocatorElement = createAsyncThunk( | |||
jdnHash: foundHash, | |||
locator: { | |||
...(isCSSLocator ? { cssSelector: locator, xPath: fullXpath } : { xPath: locator, cssSelector }), | |||
taskStatus: LocatorTaskStatus.SUCCESS, | |||
...(isCSSLocator |
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 think we can avoid this redundant checking and just add cssSelectorStatus
or xPathStatus
property with the others on line 59
No description provided.