We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b38b91 commit 112e1afCopy full SHA for 112e1af
1 file changed
samples/AfterBlazorServerSide.Tests/ControlSampleTests.cs
@@ -114,11 +114,8 @@ public async Task AdRotator_DisplaysAd_WithCorrectAttributes()
114
Assert.NotNull(altText);
115
Assert.NotEmpty(altText);
116
117
- // Assert - Ad is wrapped in an anchor tag with href
118
- var adLinkElement = await page.QuerySelectorAsync("a[href]");
119
- Assert.NotNull(adLinkElement);
120
-
121
- var href = await adLinkElement.GetAttributeAsync("href");
+ // Assert - Ad image is wrapped in an anchor tag with href (check parent element)
+ var href = await adImage.EvaluateAsync<string>("el => el.parentElement?.tagName === 'A' ? el.parentElement.getAttribute('href') : null");
122
Assert.NotNull(href);
123
Assert.NotEmpty(href);
124
}
0 commit comments