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

Матчер на валидацию ИЛИ #5532

Open
AlexeyGirin opened this issue May 28, 2024 · 0 comments
Open

Матчер на валидацию ИЛИ #5532

AlexeyGirin opened this issue May 28, 2024 · 0 comments

Comments

@AlexeyGirin
Copy link
Contributor

AlexeyGirin commented May 28, 2024

Связался пользователь (skype: glazki05 - Инесса) со следующей проблемой:

Добрый вечер!
Подскажите, пожалуйста, как можно вот это
downloadsPage.downloadsTable.verify().all()
.rows(d -> d.sku.contains(expectedProductSkuPart) || d.name.contains(expectedProductSkuPart));
переделать в
downloadsPage.downloadsTable.verify().all().rows(containsValue(expectedProductSkuPart, inColumn("sku")));
чтобы проверялось через "или" containsValue(expectedProductSkuPart, inColumn("name"))
через "и" знаю как, но надо именно "или"
первый ассерт занимает 14 мин, второй 3 сек, но мне нужно добавить дополнительную проверку на колонку Name

Результат инвестигации проблемы (by @pnatashap):

на колонки правда нет валидации на ИЛИ, только И

Необходимо реализовать валидацию ИЛИ, т.е. добавить в ColumnMatcher написать реализацию oneOf
что бы по итогу - этот код стал рабочим:

verify().all().rows(oneOf(containsValue(expectedProductSkuPart, inColumn("sku"), containsValue(expectedProductSkuPart, inColumn("name"))))

что во всех строчках в колонке или в колонке "sku или в колонке "name" есть подстрока expectedProductSkuPart

Если будут силы - добавить реализацию allOf туда же в ColumnMatcher

verify().all().rows(allOf(containsValue(expectedProductSkuPart, inColumn("sku"), containsValue(expectedProductSkuPart, inColumn("name"))))

что во всех строчках в колонке и в "sku и в "name" есть подстрока expectedProductSkuPart

@AlexeyGirin AlexeyGirin moved this to ToDo in JDI Light Board May 28, 2024
@AlexeyGirin AlexeyGirin moved this from ToDo to In Progress in JDI Light Board May 29, 2024
@AlexeyGirin AlexeyGirin moved this from In Progress to BackLog in JDI Light Board May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: BackLog
Development

No branches or pull requests

1 participant