More tests and WIP vibe work
This commit is contained in:
@@ -9,15 +9,36 @@ public class AgentsPage : BasePage
|
||||
}
|
||||
|
||||
public ILocator Grid => Page.Locator(".agents-grid");
|
||||
public ILocator AgentCards => Page.Locator(".agent-card");
|
||||
public ILocator SearchInput => Page.Locator(".search-input");
|
||||
|
||||
public async Task GotoAsync()
|
||||
{
|
||||
await NavigateToAsync("/agents");
|
||||
}
|
||||
|
||||
public async Task WaitForGridAsync()
|
||||
public async Task WaitForInteractiveAsync()
|
||||
{
|
||||
await Page.WaitForLoadStateAsync(LoadState.DOMContentLoaded);
|
||||
try {
|
||||
// Wait for the grid container with a much longer timeout for Telerik initialization
|
||||
await Page.WaitForSelectorAsync(".agents-page", new PageWaitForSelectorOptions { Timeout = 30_000, State = WaitForSelectorState.Visible });
|
||||
// Wait for the actual Telerik Grid to be rendered and populated
|
||||
await Page.WaitForSelectorAsync(".k-grid", new PageWaitForSelectorOptions { Timeout = 30_000, State = WaitForSelectorState.Visible });
|
||||
} catch (System.Exception ex) {
|
||||
var content = await Page.ContentAsync();
|
||||
var title = await Page.TitleAsync();
|
||||
var url = Page.Url;
|
||||
System.Console.WriteLine($"[DEBUG_LOG] FAILED to find Agents Grid. Error: {ex.Message}");
|
||||
System.Console.WriteLine($"[DEBUG_LOG] URL: {url}, Title: {title}");
|
||||
System.Console.WriteLine("[DEBUG_LOG] Page Content length: " + content.Length);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SearchAsync(string query)
|
||||
{
|
||||
await SearchInput.FillAsync(query);
|
||||
await Page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
||||
await Grid.WaitForAsync();
|
||||
}
|
||||
}
|
||||
@@ -13,9 +13,18 @@ public class DecksPage : BasePage
|
||||
await NavigateToAsync("/decks");
|
||||
}
|
||||
|
||||
public ILocator GetDeckCards()
|
||||
public ILocator DeckCards => Page.Locator(".deck-card");
|
||||
public ILocator CreateDeckButton => Page.Locator(".btn-create-deck");
|
||||
|
||||
public async Task WaitForInteractiveAsync()
|
||||
{
|
||||
return Page.Locator(".deck-card");
|
||||
await Page.WaitForLoadStateAsync(LoadState.DOMContentLoaded);
|
||||
await Page.WaitForSelectorAsync(".deck-card", new PageWaitForSelectorOptions { Timeout = 15_000 });
|
||||
}
|
||||
|
||||
public async Task ClickCreateDeckAsync()
|
||||
{
|
||||
await CreateDeckButton.ClickAsync();
|
||||
}
|
||||
|
||||
public async Task ClickDeckByNameAsync(string name)
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
using Microsoft.Playwright;
|
||||
|
||||
namespace Tests.PageObjects;
|
||||
|
||||
public class SyndicatesPage : BasePage
|
||||
{
|
||||
public SyndicatesPage(IPage page) : base(page)
|
||||
{
|
||||
}
|
||||
|
||||
public ILocator PairingCards => Page.Locator(".pairing-card");
|
||||
public ILocator SyndicateDialog => Page.Locator(".card-detail");
|
||||
public ILocator DialogCloseButton => SyndicateDialog.Locator(".detail-close");
|
||||
public ILocator DialogTitle => SyndicateDialog.Locator(".detail-header h2");
|
||||
|
||||
public async Task GotoAsync()
|
||||
{
|
||||
await NavigateToAsync("/syndicates");
|
||||
}
|
||||
|
||||
public async Task WaitForInteractiveAsync()
|
||||
{
|
||||
await Page.WaitForLoadStateAsync(LoadState.DOMContentLoaded);
|
||||
try {
|
||||
await Page.WaitForSelectorAsync(".pairing-card", new PageWaitForSelectorOptions { Timeout = 15_000 });
|
||||
} catch (System.Exception) {
|
||||
var content = await Page.ContentAsync();
|
||||
var title = await Page.TitleAsync();
|
||||
var url = Page.Url;
|
||||
System.Console.WriteLine($"[DEBUG_LOG] FAILED to find .pairing-card. URL: {url}, Title: {title}");
|
||||
System.Console.WriteLine("[DEBUG_LOG] Page Content snippet: " + (content.Length > 2000 ? content.Substring(0, 2000) : content));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OpenSyndicateAsync(string name)
|
||||
{
|
||||
await PairingCards.Filter(new LocatorFilterOptions { HasText = name }).ClickAsync();
|
||||
}
|
||||
|
||||
public async Task CloseDialogAsync()
|
||||
{
|
||||
await DialogCloseButton.ClickAsync();
|
||||
await Page.WaitForSelectorAsync(".card-detail", new PageWaitForSelectorOptions { State = WaitForSelectorState.Hidden });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user