Fix tests
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user