mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
use new playwright locators
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.commafeed.e2e;
|
||||
|
||||
import com.microsoft.playwright.Page;
|
||||
import com.microsoft.playwright.Page.GetByRoleOptions;
|
||||
import com.microsoft.playwright.options.AriaRole;
|
||||
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
@@ -8,9 +10,9 @@ import lombok.experimental.UtilityClass;
|
||||
public class PlaywrightTestUtils {
|
||||
|
||||
public static void login(Page page) {
|
||||
page.locator("[placeholder='User Name or E-mail']").fill("admin");
|
||||
page.locator("[placeholder='Password']").fill("admin");
|
||||
page.locator("button:has-text('Log in')").click();
|
||||
page.getByPlaceholder("User Name or E-mail").fill("admin");
|
||||
page.getByPlaceholder("Password").fill("admin");
|
||||
page.getByRole(AriaRole.BUTTON, new GetByRoleOptions().setName("Log in")).click();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user