using Microsoft.Playwright;
using NUnit.Framework;

namespace PlaywrightDotNetDemo;

public class Tests
{
    [SetUp]
    public void Setup()
    {
    }

    [Test]
    public async Task Test1()
    {
        // Launch Settings
        var launchSettings = new BrowserTypeLaunchOptions
        {
            Headless = false,
        };

        // Playwright
        using var playwright = await Playwright.CreateAsync();
        // Browser
        await using var browser = await playwright.Chromium.LaunchAsync(launchSettings);
        // Page
        var page = await browser.NewPageAsync();

        await page.GotoAsync("http://eaapp.somee.com");
        await page.ClickAsync("text=Login");

        await page.ScreenshotAsync(new PageScreenshotOptions
        {
            Path = "EAapp.jpg"
        });

    }
}