Skip to content

Commit 2b7cdbe

Browse files
Update IndexTest.cs
1 parent 090ea5e commit 2b7cdbe

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

AudioCuesheetEditor.End2EndTests/Pages/IndexTest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,29 @@ public async Task Record()
7979
[TestMethod]
8080
public async Task ChangeLanguage()
8181
{
82+
//TODO: Doesn't work in CI and using a new context conflicts tracing the default one
8283
// We need to use a new context because the default one doesn't work with changing a language
8384
var context = await Browser.NewContextAsync();
85+
await context.Tracing.StartAsync(new()
86+
{
87+
Title = $"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}",
88+
Screenshots = true,
89+
Snapshots = true,
90+
Sources = true
91+
});
8492
var page = await context.NewPageAsync();
8593
await page.GotoAsync("http://localhost:5132/");
8694
await page.GetByRole(AriaRole.Button, new() { Name = "Change language" }).ClickAsync();
8795
await page.Locator("div").Filter(new() { HasTextRegex = new Regex("^German \\(Germany\\)$") }).ClickAsync();
8896
await Expect(page.Locator("#app")).ToContainTextAsync("Allgemeine Informationen");
97+
await context.Tracing.StopAsync(new()
98+
{
99+
Path = Path.Combine(
100+
Environment.CurrentDirectory,
101+
"playwright-traces",
102+
$"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}.zip"
103+
)
104+
});
89105
await context.CloseAsync();
90106
}
91107

0 commit comments

Comments
 (0)