magento / magento2-functional-testing-framework

Magento2 Functional Testing Framework
Other
155 stars 133 forks source link

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

Open JesperHerrloff opened 7 months ago

JesperHerrloff commented 7 months ago

https://github.com/magento/magento2-functional-testing-framework/blob/0a5672871f31784e9a646bbd2ecb7d64173bbfd2/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php#L1818 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 `

`

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

m2-assistant[bot] commented 7 months ago

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.