32 lines
871 B
Java
32 lines
871 B
Java
package ru.kovbasa.utils;
|
|
|
|
import com.microsoft.playwright.Locator;
|
|
import com.microsoft.playwright.Page;
|
|
import java.util.List;
|
|
|
|
public final class UiActions {
|
|
|
|
private UiActions() {
|
|
}
|
|
|
|
public static void closeCommonPopups(Page page) {
|
|
List<String> selectors = List.of(
|
|
"button:has-text('Принять')",
|
|
"button:has-text('Согласен')",
|
|
"button:has-text('Ок')",
|
|
"button:has-text('OK')",
|
|
"button[aria-label='Закрыть']",
|
|
"button[aria-label='Close']",
|
|
".popup__close",
|
|
".modal__close"
|
|
);
|
|
|
|
for (String selector : selectors) {
|
|
Locator locator = page.locator(selector).first();
|
|
if (locator.isVisible()) {
|
|
locator.click();
|
|
}
|
|
}
|
|
}
|
|
}
|