Skip to content

Commit

Permalink
fix: ToHaveAttribute with ignoreCase should work (#2626)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Jun 29, 2023
1 parent cd97198 commit 2ee4c31
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 25 deletions.
9 changes: 9 additions & 0 deletions src/Playwright.Tests/Assertions/LocatorAssertionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,15 @@ public async Task ShouldSupportToHaveAttribute()
await Expect(locator).ToHaveAttributeAsync("checked", new Regex(".*"));
}

[PlaywrightTest("playwright-test/playwright.expect.spec.ts", "should support toHaveAttribute")]
public async Task ShouldSupportToHaveAttribute_RegexIgnoreCase()
{
await Page.SetContentAsync("<img src=\"https://PLAYWRIGHT.dEV/mEDIa/photo.JPG?queryString=true\"/>");
var locator = Page.Locator("img");
await Expect(locator).ToHaveAttributeAsync("src", new Regex("https://playwright.dev/media/photo", RegexOptions.IgnoreCase));
}


[PlaywrightTest("playwright-test/playwright.expect.spec.ts", "should support toHaveCSS")]
public async Task ShouldSupportToHaveCSS()
{
Expand Down
18 changes: 9 additions & 9 deletions src/Playwright/Transport/Protocol/Generated/AXNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,31 @@ internal class AXNode
public string Valuetext { get; set; }

[JsonPropertyName("disabled")]
public bool Disabled { get; set; }
public bool? Disabled { get; set; }

[JsonPropertyName("expanded")]
public bool Expanded { get; set; }
public bool? Expanded { get; set; }

[JsonPropertyName("focused")]
public bool Focused { get; set; }
public bool? Focused { get; set; }

[JsonPropertyName("modal")]
public bool Modal { get; set; }
public bool? Modal { get; set; }

[JsonPropertyName("multiline")]
public bool Multiline { get; set; }
public bool? Multiline { get; set; }

[JsonPropertyName("multiselectable")]
public bool Multiselectable { get; set; }
public bool? Multiselectable { get; set; }

[JsonPropertyName("readonly")]
public bool Readonly { get; set; }
public bool? Readonly { get; set; }

[JsonPropertyName("required")]
public bool Required { get; set; }
public bool? Required { get; set; }

[JsonPropertyName("selected")]
public bool Selected { get; set; }
public bool? Selected { get; set; }

[JsonPropertyName("checked")]
public string Checked { get; set; }
Expand Down
18 changes: 9 additions & 9 deletions src/Playwright/Transport/Protocol/Generated/AndroidSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ namespace Microsoft.Playwright.Transport.Protocol;
internal class AndroidSelector
{
[JsonPropertyName("checkable")]
public bool Checkable { get; set; }
public bool? Checkable { get; set; }

[JsonPropertyName("checked")]
public bool Checked { get; set; }
public bool? Checked { get; set; }

[JsonPropertyName("clazz")]
public string Clazz { get; set; }

[JsonPropertyName("clickable")]
public bool Clickable { get; set; }
public bool? Clickable { get; set; }

[JsonPropertyName("depth")]
public int? Depth { get; set; }
Expand All @@ -47,13 +47,13 @@ internal class AndroidSelector
public string Desc { get; set; }

[JsonPropertyName("enabled")]
public bool Enabled { get; set; }
public bool? Enabled { get; set; }

[JsonPropertyName("focusable")]
public bool Focusable { get; set; }
public bool? Focusable { get; set; }

[JsonPropertyName("focused")]
public bool Focused { get; set; }
public bool? Focused { get; set; }

[JsonPropertyName("hasChild")]
public AndroidSelectorHasChild HasChild { get; set; }
Expand All @@ -62,7 +62,7 @@ internal class AndroidSelector
public AndroidSelectorHasDescendant HasDescendant { get; set; }

[JsonPropertyName("longClickable")]
public bool LongClickable { get; set; }
public bool? LongClickable { get; set; }

[JsonPropertyName("pkg")]
public string Pkg { get; set; }
Expand All @@ -71,10 +71,10 @@ internal class AndroidSelector
public string Res { get; set; }

[JsonPropertyName("scrollable")]
public bool Scrollable { get; set; }
public bool? Scrollable { get; set; }

[JsonPropertyName("selected")]
public bool Selected { get; set; }
public bool? Selected { get; set; }

[JsonPropertyName("text")]
public string Text { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ internal class ExpectedTextValue
public string RegexFlags { get; set; }

[JsonPropertyName("matchSubstring")]
public bool MatchSubstring { get; set; }
public bool? MatchSubstring { get; set; }

[JsonPropertyName("ignoreCase")]
public bool IgnoreCase { get; set; }
public bool? IgnoreCase { get; set; }

[JsonPropertyName("normalizeWhiteSpace")]
public bool NormalizeWhiteSpace { get; set; }
public bool? NormalizeWhiteSpace { get; set; }
}
2 changes: 1 addition & 1 deletion src/Playwright/Transport/Protocol/Generated/Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal class Metadata
public string ApiName { get; set; }

[JsonPropertyName("internal")]
public bool Internal { get; set; }
public bool? Internal { get; set; }

[JsonPropertyName("wallTime")]
public int? WallTime { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal class SerializedValue
public int? N { get; set; }

[JsonPropertyName("b")]
public bool B { get; set; }
public bool? B { get; set; }

[JsonPropertyName("s")]
public string S { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ internal class SetNetworkCookie
public int? Expires { get; set; }

[JsonPropertyName("httpOnly")]
public bool HttpOnly { get; set; }
public bool? HttpOnly { get; set; }

[JsonPropertyName("secure")]
public bool Secure { get; set; }
public bool? Secure { get; set; }

[JsonPropertyName("sameSite")]
public string SameSite { get; set; }
Expand Down

0 comments on commit 2ee4c31

Please sign in to comment.