...docker test
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
using Microsoft.Playwright.NUnit;
|
||||
using Microsoft.Playwright;
|
||||
|
||||
namespace Tests;
|
||||
|
||||
[Parallelizable(ParallelScope.Self)]
|
||||
[TestFixture]
|
||||
public class PlaywrightTests : PageTest
|
||||
{
|
||||
[Test]
|
||||
public async Task CanWriteAndSaveNote()
|
||||
{
|
||||
// 1. Navigate to the cards gallery
|
||||
await Page.GotoAsync("http://localhost:8080/cards");
|
||||
|
||||
// 2. Wait for cards to load - looking for at least one card-cell
|
||||
await Expect(Page.Locator(".card-cell").First).ToBeVisibleAsync();
|
||||
|
||||
// 3. Find an Agent card and click it.
|
||||
var agentCard = Page.Locator(".card-cell:has(.card-category-badge.agent)").First;
|
||||
await agentCard.ClickAsync();
|
||||
|
||||
// 4. Wait for the detail view to show the note textarea
|
||||
var noteInput = Page.Locator(".note-input");
|
||||
await Expect(noteInput).ToBeVisibleAsync();
|
||||
|
||||
// 5. Type a unique note
|
||||
string uniqueNote = "Test note " + Guid.NewGuid().ToString();
|
||||
await noteInput.FillAsync(uniqueNote);
|
||||
|
||||
// 6. Blur to trigger save
|
||||
await noteInput.BlurAsync();
|
||||
|
||||
// 7. Wait for saving indicator to disappear (if it appeared)
|
||||
var savingIndicator = Page.Locator(".saving-indicator");
|
||||
if (await savingIndicator.IsVisibleAsync())
|
||||
{
|
||||
await Expect(savingIndicator).Not.ToBeVisibleAsync();
|
||||
}
|
||||
|
||||
// 8. Close the detail view by clicking the backdrop
|
||||
await Page.Locator(".modal-backdrop").ClickAsync();
|
||||
await Expect(noteInput).Not.ToBeVisibleAsync();
|
||||
|
||||
// 9. Re-open the same agent card
|
||||
await agentCard.ClickAsync();
|
||||
|
||||
// 10. Verify the note is still there
|
||||
await Expect(noteInput).ToHaveValueAsync(uniqueNote);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Microsoft.Playwright.NUnit;
|
||||
using Microsoft.Playwright;
|
||||
|
||||
namespace Tests;
|
||||
|
||||
[Parallelizable(ParallelScope.Self)]
|
||||
[TestFixture]
|
||||
public class TelerikLicenseTests : PageTest
|
||||
{
|
||||
[Test]
|
||||
public async Task TelerikLicenseBannerIsNotVisible()
|
||||
{
|
||||
// 1. Navigate to the agents page which uses Telerik components
|
||||
await Page.GotoAsync("http://localhost:8080/agents");
|
||||
|
||||
// 2. Wait for the page to load and the grid to be visible
|
||||
await Page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
||||
var grid = Page.Locator(".agents-grid");
|
||||
await Expect(grid).ToBeVisibleAsync();
|
||||
|
||||
// 3. Verify that the Telerik license warning banner is NOT present
|
||||
// According to Telerik docs, the warning text is:
|
||||
// "We couldn't verify your license key for Telerik UI for Blazor. Please see the build log for details and resolution steps"
|
||||
var licenseWarning = Page.GetByText("We couldn't verify your license key for Telerik UI for Blazor");
|
||||
await Expect(licenseWarning).Not.ToBeVisibleAsync();
|
||||
|
||||
// 4. Also verify that no "Trial" banner is visible
|
||||
var trialBanner = Page.GetByText("Telerik UI for Blazor Trial", new() { Exact = false });
|
||||
await Expect(trialBanner).Not.ToBeVisibleAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user