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

cannot use strings with comma sign in locatorFunction as it is wrapped with " which breaks Php #913

Open
JesperHerrloff opened this issue Jan 1, 2024 · 1 comment

Comments

@JesperHerrloff
Copy link

private function wrapFunctionArgsWithQuotes($functionRegex, $input)
This feature is exploding the whole string inside the paranntheses.

Its more or less impossible to use XPATH in this method as we cannot use //span[contains(@Class,'class-to-search-for') and contains(@Class,'has-another-class')] it will add " around the comma signs.
I know this is translatable to css selector but thats not the issue. I cannot use string literals with , sign as variables

Where vehicle is: 2.0 TDI (CKUB, CSNA) 163Hk | Bakhjulsdrift | 201107-201612 | Skåp
<element name="vehicleOption" type="text" locatorFunction="contains(span.select2-dropdown.vehicle-select > li.select2-results__option, {{vehicle}})" parameterized="true"/>

Preconditions

Using Magento 2.4.6-p3

Steps to reproduce

Expected result

$I->click(Locator::contains("span.select2-dropdown.vehicle-select > li.select2-results__option", "2.0 TDI (CKUB, CSNA) 163Hk | Bakhjulsdrift | 201107-201612 | Skåp")); // stepKey: clicksOnVehicleOptionCustomerGivesAChoiceToSelectSpecificVehicle

Actual result

$I->click(Locator::contains("span.select2-dropdown.vehicle-select > li.select2-results__option", "2.0 TDI (CKUB", "CSNA) 163Hk | Bakhjulsdrift | 201107-201612 | Skåp")); // stepKey: clicksOnVehicleOptionCustomerGivesAChoiceToSelectSpecificVehicle

Copy link

m2-assistant bot commented Jan 1, 2024

Hi @JesperHerrloff. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant