Description
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