Skip to content

Commit 6ef0cc2

Browse files
authored
chore: roll driver to 1.26.0 (#1071)
1 parent 8dfe959 commit 6ef0cc2

File tree

5 files changed

+7
-62
lines changed

5 files changed

+7
-62
lines changed

playwright/src/main/java/com/microsoft/playwright/FrameLocator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* <p> **Strictness**
3131
*
3232
* <p> Frame locators are strict. This means that all operations on frame locators will throw if more than one element matches
33-
* given selector.
33+
* a given selector.
3434
* <pre>{@code
3535
* // Throws if there are several frames in DOM:
3636
* page.frame_locator(".result-frame").locator("button").click();

playwright/src/main/java/com/microsoft/playwright/assertions/LocatorAssertions.java

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ default void containsText(Pattern[] expected) {
795795
*/
796796
void containsText(Pattern[] expected, ContainsTextOptions options);
797797
/**
798-
* Ensures the {@code Locator} points to an element with given attribute value.
798+
* Ensures the {@code Locator} points to an element with given attribute.
799799
* <pre>{@code
800800
* assertThat(page.locator("input")).hasAttribute("type", "text");
801801
* }</pre>
@@ -807,7 +807,7 @@ default void hasAttribute(String name, String value) {
807807
hasAttribute(name, value, (HasAttributeOptions) null);
808808
}
809809
/**
810-
* Ensures the {@code Locator} points to an element with given attribute value.
810+
* Ensures the {@code Locator} points to an element with given attribute.
811811
* <pre>{@code
812812
* assertThat(page.locator("input")).hasAttribute("type", "text");
813813
* }</pre>
@@ -817,7 +817,7 @@ default void hasAttribute(String name, String value) {
817817
*/
818818
void hasAttribute(String name, String value, HasAttributeOptions options);
819819
/**
820-
* Ensures the {@code Locator} points to an element with given attribute value.
820+
* Ensures the {@code Locator} points to an element with given attribute.
821821
* <pre>{@code
822822
* assertThat(page.locator("input")).hasAttribute("type", "text");
823823
* }</pre>
@@ -829,7 +829,7 @@ default void hasAttribute(String name, Pattern value) {
829829
hasAttribute(name, value, (HasAttributeOptions) null);
830830
}
831831
/**
832-
* Ensures the {@code Locator} points to an element with given attribute value.
832+
* Ensures the {@code Locator} points to an element with given attribute.
833833
* <pre>{@code
834834
* assertThat(page.locator("input")).hasAttribute("type", "text");
835835
* }</pre>
@@ -838,28 +838,6 @@ default void hasAttribute(String name, Pattern value) {
838838
* @param value Expected attribute value.
839839
*/
840840
void hasAttribute(String name, Pattern value, HasAttributeOptions options);
841-
/**
842-
* Ensures the {@code Locator} points to an element with given attribute. The method will assert attribute presence.
843-
* <pre>{@code
844-
* assertThat(page.locator("input")).hasAttribute("disabled");
845-
* assertThat(page.locator("input")).not().hasAttribute("open");
846-
* }</pre>
847-
*
848-
* @param name Attribute name.
849-
*/
850-
default void hasAttribute(String name) {
851-
hasAttribute(name, (HasAttributeOptions) null);
852-
}
853-
/**
854-
* Ensures the {@code Locator} points to an element with given attribute. The method will assert attribute presence.
855-
* <pre>{@code
856-
* assertThat(page.locator("input")).hasAttribute("disabled");
857-
* assertThat(page.locator("input")).not().hasAttribute("open");
858-
* }</pre>
859-
*
860-
* @param name Attribute name.
861-
*/
862-
void hasAttribute(String name, HasAttributeOptions options);
863841
/**
864842
* Ensures the {@code Locator} points to an element with given CSS classes. This needs to be a full match or using a relaxed
865843
* regular expression.

playwright/src/main/java/com/microsoft/playwright/impl/LocatorAssertionsImpl.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,7 @@ private void hasAttribute(String name, ExpectedTextValue expectedText, Object ex
105105
if (expectedValue instanceof Pattern) {
106106
message += " matching regex";
107107
}
108-
expectImpl("to.have.attribute.value", expectedText, expectedValue, message, commonOptions);
109-
}
110-
111-
@Override
112-
public void hasAttribute(String name, HasAttributeOptions options) {
113-
if (options == null) {
114-
options = new HasAttributeOptions();
115-
}
116-
FrameExpectOptions commonOptions = convertType(options, FrameExpectOptions.class);
117-
commonOptions.expressionArg = name;
118-
String message = "Locator expected to have attribute '" + name + "'";
119-
expectImpl("to.have.attribute", (List<ExpectedTextValue>) null, null, message, commonOptions);
108+
expectImpl("to.have.attribute", expectedText, expectedValue, message, commonOptions);
120109
}
121110

122111
@Override

playwright/src/test/java/com/microsoft/playwright/TestLocatorAssertions.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -284,28 +284,6 @@ void hasAttributeRegExpFail() {
284284
assertTrue(e.getMessage().contains("Locator expected to have attribute 'id' matching regex: .Nod..\nReceived: node"), e.getMessage());
285285
}
286286

287-
@Test
288-
void hasAttributeBooleanPass() {
289-
page.setContent("<div checked id=node>Text content</div>");
290-
Locator locator = page.locator("#node");
291-
assertThat(locator).hasAttribute("id");
292-
assertThat(locator).hasAttribute("checked");
293-
assertThat(locator).not().hasAttribute("open");
294-
assertThat(locator).hasAttribute("id", Pattern.compile("n..e"));
295-
}
296-
297-
@Test
298-
void hasAttributeBooleanFail() {
299-
page.setContent("<div checked id=node>Text content</div>");
300-
Locator locator = page.locator("#node");
301-
AssertionFailedError e = assertThrows(AssertionFailedError.class,
302-
() -> assertThat(locator).hasAttribute("disabled", new LocatorAssertions.HasAttributeOptions().setTimeout(100)));
303-
assertTrue(e.getMessage().contains("Locator expected to have attribute 'disabled'"), e.getMessage());
304-
e = assertThrows(AssertionFailedError.class,
305-
() -> assertThat(locator).not().hasAttribute("checked", new LocatorAssertions.HasAttributeOptions().setTimeout(100)));
306-
assertTrue(e.getMessage().contains("Locator expected not to have attribute 'checked'"), e.getMessage());
307-
}
308-
309287
@Test
310288
void hasClassTextPass() {
311289
page.setContent("<div class=\"foo bar baz\"></div>");

scripts/CLI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.26.0-beta-1662762342000
1+
1.26.0

0 commit comments

Comments
 (0)