Skip to content

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

Open
@JesperHerrloff

Description

@JesperHerrloff

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions