mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
Update writing-tests-java.md sample code (#19894)
Fix code compilation issues reported in https://github.com/microsoft/playwright-java/issues/1158
This commit is contained in:
parent
ef877dadfe
commit
9f7b0e4e01
@ -12,6 +12,7 @@ package org.example;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
import com.microsoft.playwright.*;
|
||||
import com.microsoft.playwright.options.AriaRole;
|
||||
|
||||
import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
|
||||
|
||||
@ -26,7 +27,7 @@ public class App {
|
||||
assertThat(page).hasTitle(Pattern.compile("Playwright"));
|
||||
|
||||
// create a locator
|
||||
Locator getStarted = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Get Started"))
|
||||
Locator getStarted = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Get Started"));
|
||||
|
||||
// Expect an attribute "to be strictly equal" to the value.
|
||||
assertThat(getStarted).hasAttribute("href", "/docs/intro");
|
||||
@ -91,4 +92,4 @@ Page page = context.newPage();
|
||||
|
||||
- [Run single test, multiple tests, headed mode](./running-tests.md)
|
||||
- [Generate tests with Codegen](./codegen.md)
|
||||
- [See a trace of your tests](./trace-viewer-intro.md)
|
||||
- [See a trace of your tests](./trace-viewer-intro.md)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user