Skip to content

Commit 3db8d21

Browse files
authored
chore(test): Implement ability to identify missing Tests (microsoft#1104)
* Replaced xml comments referencing TypeScript tests with attributes (to allow reflection) * Added new capabilities to ApiUtility
1 parent 2468477 commit 3db8d21

File tree

183 files changed

+1654
-3691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+1654
-3691
lines changed

src/PlaywrightSharp.Tests/Accessibility/AccessibilityTests.cs

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ public AccessibilityTests(ITestOutputHelper output) : base(output)
1818
{
1919
}
2020

21-
///<playwright-file>accessibility.spec.js</playwright-file>
22-
///<playwright-describe>Accessibility</playwright-describe>
23-
///<playwright-it>should work</playwright-it>
21+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "should work")]
2422
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
2523
public async Task ShouldWork()
2624
{
@@ -205,9 +203,7 @@ await Page.SetContentAsync(@"
205203
Assert.True(result.AreEqual, result.DifferencesString);
206204
}
207205

208-
///<playwright-file>accessibility.spec.js</playwright-file>
209-
///<playwright-describe>Accessibility</playwright-describe>
210-
///<playwright-it>should work with regular text</playwright-it>
206+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "should work with regular text")]
211207
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
212208
public async Task ShouldWorkWithRegularRext()
213209
{
@@ -220,9 +216,7 @@ public async Task ShouldWorkWithRegularRext()
220216
}, snapshot.Children[0]);
221217
}
222218

223-
///<playwright-file>accessibility.spec.js</playwright-file>
224-
///<playwright-describe>Accessibility</playwright-describe>
225-
///<playwright-it>roledescription</playwright-it>
219+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "roledescription")]
226220
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
227221
public async Task RoleDescription()
228222
{
@@ -231,9 +225,7 @@ public async Task RoleDescription()
231225
Assert.Equal("foo", snapshot.Children[0].RoleDescription);
232226
}
233227

234-
///<playwright-file>accessibility.spec.js</playwright-file>
235-
///<playwright-describe>Accessibility</playwright-describe>
236-
///<playwright-it>orientation</playwright-it>
228+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "orientation")]
237229
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
238230
public async Task Orientation()
239231
{
@@ -242,9 +234,7 @@ public async Task Orientation()
242234
Assert.Equal("vertical", snapshot.Children[0].Orientation);
243235
}
244236

245-
///<playwright-file>accessibility.spec.js</playwright-file>
246-
///<playwright-describe>Accessibility</playwright-describe>
247-
///<playwright-it>autocomplete</playwright-it>
237+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "autocomplete")]
248238
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
249239
public async Task Autocomplete()
250240
{
@@ -253,9 +243,7 @@ public async Task Autocomplete()
253243
Assert.Equal("list", snapshot.Children[0].AutoComplete);
254244
}
255245

256-
///<playwright-file>accessibility.spec.js</playwright-file>
257-
///<playwright-describe>Accessibility</playwright-describe>
258-
///<playwright-it>multiselectable</playwright-it>
246+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "multiselectable")]
259247
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
260248
public async Task Multiselectable()
261249
{
@@ -264,9 +252,7 @@ public async Task Multiselectable()
264252
Assert.True(snapshot.Children[0].Multiselectable);
265253
}
266254

267-
///<playwright-file>accessibility.spec.js</playwright-file>
268-
///<playwright-describe>Accessibility</playwright-describe>
269-
///<playwright-it>keyshortcuts</playwright-it>
255+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "keyshortcuts")]
270256
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
271257
public async Task KeyShortcuts()
272258
{
@@ -275,9 +261,7 @@ public async Task KeyShortcuts()
275261
Assert.Equal("foo", snapshot.Children[0].KeyShortcuts);
276262
}
277263

278-
///<playwright-file>accessibility.spec.js</playwright-file>
279-
///<playwright-describe>Accessibility</playwright-describe>
280-
///<playwright-it>filtering children of leaf nodes</playwright-it>
264+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "filtering children of leaf nodes")]
281265
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
282266
public async Task FilteringChildrenOfLeafNodes()
283267
{
@@ -311,9 +295,7 @@ await Page.SetContentAsync(@"
311295
snapshot);
312296
}
313297

314-
///<playwright-file>accessibility.spec.js</playwright-file>
315-
///<playwright-describe>Accessibility</playwright-describe>
316-
///<playwright-it>rich text editable fields should have children</playwright-it>
298+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "rich text editable fields should have children")]
317299
[SkipBrowserAndPlatformFact(skipWebkit: true)]
318300
public async Task RichTextEditableFieldsShouldHaveChildren()
319301
{
@@ -372,9 +354,7 @@ await Page.SetContentAsync(@"
372354
Assert.Equal(node, snapshot.Children[0]);
373355
}
374356

375-
///<playwright-file>accessibility.spec.js</playwright-file>
376-
///<playwright-describe>Accessibility</playwright-describe>
377-
///<playwright-it>rich text editable fields with role should have children</playwright-it>
357+
[PlaywrightTest("accessibility.spec.js", "Accessibility", "rich text editable fields with role should have children")]
378358
[SkipBrowserAndPlatformFact(skipWebkit: true)]
379359
public async Task RichTextEditableFieldsWithRoleShouldHaveChildren()
380360
{

src/PlaywrightSharp.Tests/Accessibility/PlainTextContentEditableTests.cs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ public PlainTextContentEditableTests(ITestOutputHelper output) : base(output)
1616
{
1717
}
1818

19-
///<playwright-file>accessibility.spec.js</playwright-file>
20-
///<playwright-describe>plaintext contenteditable</playwright-describe>
21-
///<playwright-it>plain text field with role should not have children</playwright-it>
19+
[PlaywrightTest("accessibility.spec.js", "plaintext contenteditable", "plain text field with role should not have children")]
2220
[SkipBrowserAndPlatformFact(skipWebkit: true, skipFirefox: true)]
2321
public async Task PlainTextFieldWithRoleShouldNotHaveChildren()
2422
{
@@ -33,9 +31,7 @@ public async Task PlainTextFieldWithRoleShouldNotHaveChildren()
3331
(await Page.Accessibility.SnapshotAsync()).Children[0]);
3432
}
3533

36-
///<playwright-file>accessibility.spec.js</playwright-file>
37-
///<playwright-describe>plaintext contenteditable</playwright-describe>
38-
///<playwright-it>plain text field without role should not have content</playwright-it>
34+
[PlaywrightTest("accessibility.spec.js", "plaintext contenteditable", "plain text field without role should not have content")]
3935
[SkipBrowserAndPlatformFact(skipWebkit: true, skipFirefox: true)]
4036
public async Task PlainTextFieldWithoutRoleShouldNotHaveContent()
4137
{
@@ -46,9 +42,7 @@ await Page.SetContentAsync(
4642
Assert.Equal(string.Empty, snapshot.Children[0].Name);
4743
}
4844

49-
///<playwright-file>accessibility.spec.js</playwright-file>
50-
///<playwright-describe>plaintext contenteditable</playwright-describe>
51-
///<playwright-it>plain text field with tabindex and without role should not have content</playwright-it>
45+
[PlaywrightTest("accessibility.spec.js", "plaintext contenteditable", "plain text field with tabindex and without role should not have content")]
5246
[SkipBrowserAndPlatformFact(skipWebkit: true, skipFirefox: true)]
5347
public async Task PlainTextFieldWithTabindexAndWithoutRoleShouldNotHaveContent()
5448
{
@@ -58,9 +52,7 @@ public async Task PlainTextFieldWithTabindexAndWithoutRoleShouldNotHaveContent()
5852
Assert.Empty(node.Name);
5953
}
6054

61-
///<playwright-file>accessibility.spec.js</playwright-file>
62-
///<playwright-describe>plaintext contenteditable</playwright-describe>
63-
///<playwright-it>non editable textbox with role and tabIndex and label should not have children</playwright-it>
55+
[PlaywrightTest("accessibility.spec.js", "plaintext contenteditable", "non editable textbox with role and tabIndex and label should not have children")]
6456
[SkipBrowserAndPlatformFact(skipWebkit: true, skipFirefox: true)]
6557
public async Task NonEditableTextboxWithRoleAndTabIndexAndLabelShouldNotHaveChildren()
6658
{
@@ -102,9 +94,7 @@ this is the inner content
10294
Assert.Equal(node, (await Page.Accessibility.SnapshotAsync()).Children[0]);
10395
}
10496

105-
///<playwright-file>accessibility.spec.js</playwright-file>
106-
///<playwright-describe>plaintext contenteditable</playwright-describe>
107-
///<playwright-it>checkbox with and tabIndex and label should not have children</playwright-it>
97+
[PlaywrightTest("accessibility.spec.js", "plaintext contenteditable", "checkbox with and tabIndex and label should not have children")]
10898
[SkipBrowserAndPlatformFact(skipWebkit: true, skipFirefox: true)]
10999
public async Task CheckboxWithAndTabIndexAndLabelShouldNotHaveChildren()
110100
{
@@ -123,9 +113,7 @@ this is the inner content
123113
(await Page.Accessibility.SnapshotAsync()).Children[0]);
124114
}
125115

126-
///<playwright-file>accessibility.spec.js</playwright-file>
127-
///<playwright-describe>plaintext contenteditable</playwright-describe>
128-
///<playwright-it>checkbox without label should not have children</playwright-it>
116+
[PlaywrightTest("accessibility.spec.js", "plaintext contenteditable", "checkbox without label should not have children")]
129117
[SkipBrowserAndPlatformFact(skipWebkit: true, skipFirefox: true)]
130118
public async Task CheckboxWithoutLabelShouldNotHaveChildren()
131119
{

src/PlaywrightSharp.Tests/Accessibility/RootOptionTests.cs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ public RootOptionTests(ITestOutputHelper output) : base(output)
1717
{
1818
}
1919

20-
///<playwright-file>accessibility.spec.js</playwright-file>
21-
///<playwright-describe>root option</playwright-describe>
22-
///<playwright-it>should work a button</playwright-it>
20+
[PlaywrightTest("accessibility.spec.js", "root option", "should work a button")]
2321
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
2422
public async Task ShouldWorkAButton()
2523
{
@@ -35,9 +33,7 @@ public async Task ShouldWorkAButton()
3533
await Page.Accessibility.SnapshotAsync(root: button));
3634
}
3735

38-
///<playwright-file>accessibility.spec.js</playwright-file>
39-
///<playwright-describe>root option</playwright-describe>
40-
///<playwright-it>should work an input</playwright-it>
36+
[PlaywrightTest("accessibility.spec.js", "root option", "should work an input")]
4137
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
4238
public async Task ShouldWorkAnInput()
4339
{
@@ -54,9 +50,7 @@ public async Task ShouldWorkAnInput()
5450
await Page.Accessibility.SnapshotAsync(root: input));
5551
}
5652

57-
///<playwright-file>accessibility.spec.js</playwright-file>
58-
///<playwright-describe>root option</playwright-describe>
59-
///<playwright-it>should work on a menu</playwright-it>
53+
[PlaywrightTest("accessibility.spec.js", "root option", "should work on a menu")]
6054
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
6155
public async Task ShouldWorkOnAMenu()
6256
{
@@ -99,9 +93,7 @@ await Page.SetContentAsync(@"
9993
Assert.True(result.AreEqual, result.DifferencesString);
10094
}
10195

102-
///<playwright-file>accessibility.spec.js</playwright-file>
103-
///<playwright-describe>root option</playwright-describe>
104-
///<playwright-it>should return null when the element is no longer in DOM</playwright-it>
96+
[PlaywrightTest("accessibility.spec.js", "root option", "should return null when the element is no longer in DOM")]
10597
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
10698
public async Task ShouldReturnNullWhenTheElementIsNoLongerInDOM()
10799
{
@@ -112,9 +104,7 @@ public async Task ShouldReturnNullWhenTheElementIsNoLongerInDOM()
112104
Assert.Null(await Page.Accessibility.SnapshotAsync(root: button));
113105
}
114106

115-
///<playwright-file>accessibility.spec.js</playwright-file>
116-
///<playwright-describe>root option</playwright-describe>
117-
///<playwright-it>should show uninteresting nodes</playwright-it>
107+
[PlaywrightTest("accessibility.spec.js", "root option", "should show uninteresting nodes")]
118108
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
119109
public async Task ShouldReportUninterestingNodes()
120110
{

src/PlaywrightSharp.Tests/Autowaiting/AutoWaitingShouldNotHangTests.cs

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ public AutoWaitingShouldNotHangTests(ITestOutputHelper output) : base(output)
2020
{
2121
}
2222

23-
///<playwright-file>autowaiting.spec.js</playwright-file>
24-
///<playwright-describe>Auto waiting should not hang when</playwright-describe>
25-
///<playwright-it>clicking on links which do not commit navigation</playwright-it>
23+
[PlaywrightTest("autowaiting.spec.js", "Auto waiting should not hang when", "clicking on links which do not commit navigation")]
2624
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
2725
public async Task ClickingOnLinksWhichDoNotCommitNavigation()
2826
{
@@ -31,9 +29,7 @@ public async Task ClickingOnLinksWhichDoNotCommitNavigation()
3129
await Page.ClickAsync("a");
3230
}
3331

34-
///<playwright-file>autowaiting.spec.js</playwright-file>
35-
///<playwright-describe>Auto waiting should not hang when</playwright-describe>
36-
///<playwright-it>calling window.stop async</playwright-it>
32+
[PlaywrightTest("autowaiting.spec.js", "Auto waiting should not hang when", "calling window.stop async")]
3733
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
3834
public async Task CallingWindowStopAsync()
3935
{
@@ -45,9 +41,7 @@ await Page.EvaluateAsync($@"(url) => {{
4541
}}", TestConstants.EmptyPage);
4642
}
4743

48-
///<playwright-file>autowaiting.spec.js</playwright-file>
49-
///<playwright-describe>Auto waiting should not hang when</playwright-describe>
50-
///<playwright-it>calling window.stop</playwright-it>
44+
[PlaywrightTest("autowaiting.spec.js", "Auto waiting should not hang when", "calling window.stop")]
5145
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
5246
public async Task CallingWindowStop()
5347
{
@@ -59,19 +53,15 @@ await Page.EvaluateAsync($@"(url) => {{
5953
}}", TestConstants.EmptyPage);
6054
}
6155

62-
///<playwright-file>autowaiting.spec.js</playwright-file>
63-
///<playwright-describe>Auto waiting should not hang when</playwright-describe>
64-
///<playwright-it>assigning location to about:blank</playwright-it>
56+
[PlaywrightTest("autowaiting.spec.js", "Auto waiting should not hang when", "assigning location to about:blank")]
6557
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
6658
public async Task AssigningLocationToAboutBlank()
6759
{
6860
await Page.GoToAsync(TestConstants.EmptyPage);
6961
await Page.EvaluateAsync("window.location.href = 'about:blank';");
7062
}
7163

72-
///<playwright-file>autowaiting.spec.js</playwright-file>
73-
///<playwright-describe>Auto waiting should not hang when</playwright-describe>
74-
///<playwright-it>assigning location to about:blank after non-about:blank</playwright-it>
64+
[PlaywrightTest("autowaiting.spec.js", "Auto waiting should not hang when", "assigning location to about:blank after non-about:blank")]
7565
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
7666
public async Task AssigningLocationToAboutBlankAfterNonAboutBlank()
7767
{
@@ -83,9 +73,7 @@ await Page.EvaluateAsync($@"(url) => {{
8373
}}", TestConstants.EmptyPage);
8474
}
8575

86-
///<playwright-file>autowaiting.spec.js</playwright-file>
87-
///<playwright-describe>Auto waiting should not hang when</playwright-describe>
88-
///<playwright-it>calling window.open and window.close</playwright-it>
76+
[PlaywrightTest("autowaiting.spec.js", "Auto waiting should not hang when", "calling window.open and window.close")]
8977
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
9078
public async Task CallingWindowOpenAndWindowClose()
9179
{
@@ -97,9 +85,7 @@ await Page.EvaluateAsync($@"(url) => {{
9785
}}", TestConstants.EmptyPage);
9886
}
9987

100-
///<playwright-file>autowaiting.spec.js</playwright-file>
101-
///<playwright-describe>Auto waiting should not hang when</playwright-describe>
102-
///<playwright-it>opening a popup</playwright-it>
88+
[PlaywrightTest("autowaiting.spec.js", "Auto waiting should not hang when", "opening a popup")]
10389
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
10490
public async Task OpeningAPopup()
10591
{

0 commit comments

Comments
 (0)