Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser][wbt] SignalRClientTests - wait for selectors of all the buttons #100450

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,16 @@ public async Task SignalRPassMessages(string config, string transport)
}

if (msg.Text.Contains("Finished GetQueryParameters"))
{
// first click after render - make sure buttons are available
await page.WaitForSelectorAsync("button#connectButton");
await page.ClickAsync("button#connectButton");
}
await SaveClickButtonAsync(page, "button#connectButton");

if (msg.Text.Contains("SignalR connected"))
await page.ClickAsync("button#subscribeButton");
await SaveClickButtonAsync(page, "button#subscribeButton");

if (msg.Text.Contains("Subscribed to ReceiveMessage"))
await page.ClickAsync("button#sendMessageButton");
await SaveClickButtonAsync(page, "button#sendMessageButton");

if (msg.Text.Contains("ReceiveMessage from server"))
await page.ClickAsync("button#exitProgramButton");
await SaveClickButtonAsync(page, "button#exitProgramButton");
}
));

Expand All @@ -95,4 +91,10 @@ private string GetThreadOfAction(string testOutput, string pattern, string actio
Assert.True(match.Success, $"Expected to find a log that {actionDescription}. TestOutput: {testOutput}.");
return match.Groups[1].Value ?? "";
}

private async Task SaveClickButtonAsync(IPage page, string selector)
{
await page.WaitForSelectorAsync(selector);
await page.ClickAsync(selector);
}
}
Loading