using Microsoft.Playwright;
using Microsoft.Playwright.NUnit;
using NUnit.Framework;
namespace ShopOnline.Test;

public class NunitPlaywright : PageTest
{
    [SetUp]
    public async Task Setup()
    {
        await Page.GotoAsync("https://localhost:7081/");
    }

    [Test]
    public async Task AddOneOfEachToCart()
    {
        await Page.PauseAsync();

        await Page.GetByRole(AriaRole.Link, new() { Name = "Glossier - Beauty Kit $100.00" }).ClickAsync();
        await Page.GetByRole(AriaRole.Button, new() { Name = "Add To Cart" }).ClickAsync();
        await Page.GetByRole(AriaRole.Link, new() { Name = "Home" }).ClickAsync();
        await Page.GetByRole(AriaRole.Link, new() { Name = "Curology - Skin Care Kit $50.00" }).ClickAsync();
        await Page.GetByRole(AriaRole.Button, new() { Name = "Add To Cart" }).ClickAsync();
        await Page.GetByRole(AriaRole.Link, new() { Name = "Furniture" }).ClickAsync();
        await Page.GetByRole(AriaRole.Link, new() { Name = "Lounge Chair $70.00" }).ClickAsync();
        await Page.GetByRole(AriaRole.Button, new() { Name = "Add To Cart" }).ClickAsync();
        await Page.GetByRole(AriaRole.Link, new() { Name = "Electronics" }).ClickAsync();
        await Page.GetByRole(AriaRole.Link, new() { Name = "Nintendo Gameboy $100.00" }).ClickAsync();
        await Page.GetByRole(AriaRole.Button, new() { Name = "Add To Cart" }).ClickAsync();
        await Page.GetByRole(AriaRole.Link, new() { Name = "Shoes" }).ClickAsync();
        await Page.GetByRole(AriaRole.Link, new() { Name = "Red Nike Trainers $200.00" }).ClickAsync();
        await Page.GetByRole(AriaRole.Button, new() { Name = "Add To Cart" }).ClickAsync();
        await Page.GetByRole(AriaRole.Button).Nth(1).ClickAsync();
        await Page.GetByRole(AriaRole.Link, new() { Name = " Proceed to Checkout" }).ClickAsync();

    }
}