Fix tests

This commit is contained in:
jheaps
2025-09-24 14:39:52 -06:00
parent 4bc69d1989
commit 3da59f9e93
2 changed files with 14 additions and 3 deletions
+12 -2
View File
@@ -39,16 +39,20 @@ public class GameplayTests : PageTest
{
// Start a multiplayer game
await Page.ClickAsync("#startGameBtn");
await Page.WaitForTimeoutAsync(3000);
await Page.WaitForSelectorAsync(".chessPiece");
if (await Page.Locator("#square-55:has(img[src='/images/Chess Images/WhitePawn.svg'])").CountAsync() == 0)
{
await Page.ClickAsync("#startGameBtn");
await Page.WaitForSelectorAsync(".chessPiece");
}
// Create a second browser context for the second player
await using var browser = await Playwright.Chromium.LaunchAsync();
await using var context2 = await browser.NewContextAsync(ContextOptions());
var page2 = await context2.NewPageAsync();
await page2.GotoAsync($"{Config.Test.BaseUrl}/chess");
await page2.ClickAsync("#startGameBtn");
await page2.WaitForTimeoutAsync(3000);
await page2.WaitForSelectorAsync(".chessPiece");
/*
@@ -107,6 +111,12 @@ public class GameplayTests : PageTest
await Page.ClickAsync("#startGameBtn");
await Page.WaitForSelectorAsync(".chessPiece");
if (await Page.Locator("#square-55:has(img[src='/images/Chess Images/WhitePawn.svg'])").CountAsync() == 0)
{
await Page.ClickAsync("#startGameBtn");
await Page.WaitForSelectorAsync(".chessPiece");
}
// Create a second browser context for the second player (black)
await using var browser = await Playwright.Chromium.LaunchAsync();
await using var context2 = await browser.NewContextAsync(ContextOptions());
@@ -7,7 +7,8 @@
"Height": 720
},
"BrowserTimeout": 30000,
"ActionTimeout": 10000
"ActionTimeout": 10000,
"IgnoreHTTPSErrors": true
},
"TestSettings": {
"BaseUrl": "https://localhost:7118",