-
-
Notifications
You must be signed in to change notification settings - Fork 736
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
Selector regression with upgrade from 3.5.8 to 3.5.11 #4139
Comments
hi @cjhille thanks for your report! We made a bold move to replace the current lib with https://www.npmjs.com/package/csstoxpath?activeTab=explore for css to xpath convertion as you could see right here #4101 may you help try with 3.x branch to see if issues still occur? |
@kobenguyent could you tag an alpha (or nightly) release for npm? i'll happily take it for a test drive. :) |
Sure @cjhille here you go https://www.npmjs.com/package/codeceptjs/v/3.5.12-beta.1 |
Thank you very much! @kobenguyent. Is "last-of-type" somewhat cursed for xpath conversion? Now i'm getting this:
![]() Selector is still
|
So @cjhille that is unfortunately one of the limitations of the lib https://www.npmjs.com/package/csstoxpath?activeTab=explore#limitations |
@kobenguyent Oh, I see. Thank you for pointing me toward this. Sadly, this is not the only caveat of the new library. 🥲 Tracking back the issue, I see that the reason for switching was #3563. It is great to have that fixed, but I don't think the benefit of this outweighs the drawbacks introduced regressions (and future limitations) by the new library. Would you consider a rollback? I assume that not too many projects are upgrading to the latest codeceptjs version right away, and many more projects will find their selectors broken in the coming weeks. |
hey @cjhille thinking of a hybrid solution for this. |
@kobenguyent Nice, wouldn't have thought of that ^^ Oddly, it still goes down the code path to the new lib for this locator:
Leading to: |
I'm curious if that is the locator before the lib changed? Cause I remembered the old lib doesn't work with hyphen in locator. |
Yes, that locator works with 3.5.8. |
So that locator didn't have the issue #3563? |
Thank you for your input. I understood the problem now. Thinking a nice solution for now. |
Soooo, another try, I hope we could resolve this this time. I could not think of any better solution right now but this hybrid approach would be a cheap and fast way right now. We will check the locator and load either the old one which is being used until 3.5.8
Test build: https://www.npmjs.com/package/codeceptjs/v/3.5.12-beta.3 |
After some layer 8 errors on my side, I'm positively certain that this PR fixes the regression. Thank you, @kobenguyent, for your patience. |
I confirm the beta In With Fixed with beta, hope it can be release soon 🤞 |
I encountered several regressions when trying to upgrade codeceptjs from 3.5.8 to 3.5.11. Selector that worked with 3.5.8 do not work with 3.5.11.
What do you get instead?
ERROR! Unsupported pseudo :last-of-type
. Example selector that is now broken:I looked through the dependencies. The dependency
convert-cssxpath/src/converter.js:
throws the error. Likely the same issue as mentioned in slack.`locator.all: DOMException: Failed to execute 'evaluate' on 'Document': The string '[contains(., 'Delete')]' is not a valid XPath expression. The selector is:
Once I remove
:last-of-type:
the selector works again, so this may just be the same as the first with a different point of failure.locator.all: DOMException: Failed to execute 'evaluate' on 'Document': The string '//li[@role="option"]//*[@data-testid="date"][ancestor::]' is not a valid XPath expression.
. Locator is:Likely also the same issue, but I can't fully verify because this is needed for the suite to continue.
The text was updated successfully, but these errors were encountered: