Skip to content

Commit aa2d022

Browse files
best practise corrections
1 parent b7b332a commit aa2d022

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

AudioCuesheetEditor.End2EndTests/Models/ImportView.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818

1919
namespace AudioCuesheetEditor.End2EndTests.Models
2020
{
21-
internal class ImportView(IPage page)
21+
partial class ImportView(IPage page)
2222
{
23+
[GeneratedRegex("^Scheme common data$")]
24+
private static partial Regex SchemeCommonData();
25+
2326
internal const string BaseUrl = "http://localhost:5132/";
2427

2528
private readonly IPage _page = page;
@@ -79,7 +82,7 @@ internal async Task SwitchImportProfileAsync(string profile)
7982

8083
internal async Task ClearSchemeCommonDataAsync()
8184
{
82-
await _page.Locator("div").Filter(new() { HasTextRegex = new Regex("^Scheme common data$") }).GetByLabel("Clear").ClickAsync();
85+
await _page.Locator("div").Filter(new() { HasTextRegex = SchemeCommonData() }).GetByLabel("Clear").ClickAsync();
8386
}
8487

8588
internal async Task SetSchemeCommonDataAsync(string schemeCommonData)
@@ -89,7 +92,7 @@ internal async Task SetSchemeCommonDataAsync(string schemeCommonData)
8992

9093
internal async Task SelectSchemeCommonDataPlaceholderAsync(string placeholder)
9194
{
92-
await _page.Locator("div").Filter(new() { HasTextRegex = new Regex("^Scheme common data$") }).GetByRole(AriaRole.Button).Nth(1).ClickAsync();
95+
await _page.Locator("div").Filter(new() { HasTextRegex = SchemeCommonData() }).GetByRole(AriaRole.Button).Nth(1).ClickAsync();
9396
await _page.GetByRole(AriaRole.Paragraph).Filter(new() { HasText = placeholder }).ClickAsync();
9497
}
9598
}

0 commit comments

Comments
 (0)