import { test, expect } from '@playwright/test'


// Tests if the title is present and with the correct name 
test('Has Title About Creative Discovery', async ({page})=>{
    await page.goto('http://localhost:3000/aboutus');
    await expect(page).toHaveTitle(/Creative Discovery/)
})

// Checks and screnshots the logo
test('Has The logo', async ({page}) => { 
    await page.goto('http://localhost:3000/aboutus');
    await page.getByAltText('creative discovery logo').screenshot({path:'logoss.png'});
 })

 // It will navigate through all pages .
 test('Menu is working', async ({page})=>{
    await page.goto('http://localhost:3000/aboutus');
    await page.getByText('Sobre Nós').click();
    await page.goBack();
    await page.getByText('Serviços').click();
    await page.goBack();
    await page.getByText('Parceiros').click();
    await page.goBack();
 })

 test('Projects throw 404',async ({page})=>{
    await page.goto('http://localhost:3000/aboutus');
    await page.getByText('Projetos').click();
    test.fail()
 })

 test('Found Text from the API',async ({page})=>{
    await page.goto('http://localhost:3000/aboutus');
    await page.getByText('Projetos').click();
 })