
import io.github.bonigarcia.seljup.SeleniumJupiter;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.openqa.selenium.chrome.ChromeDriver;
import ua.tqs.*;


@ExtendWith(SeleniumJupiter.class)
public class BlazeDemoPOMTest {
 
 
    @Test
    @DisplayName("Book a flight using Page Object Model")
    void testBookFlight(ChromeDriver driver) {
        driver.get("https://blazedemo.com/");

        // Page objects
        HomePage home = new HomePage(driver);
        home.selectFromPort("Paris");
        home.selectToPort("London");
        home.clickFindFlights();

        FlightsPage flights = new FlightsPage(driver);
        flights.chooseFlight();

        PurchasePage purchase = new PurchasePage(driver);
        purchase.fillForm("Ana", "Rua da Uni", "Aveiro", "A", "3810", "Visa", "12121212121212121");
        purchase.submit();

        ConfirmationPage confirmation = new ConfirmationPage(driver);
        confirmation.assertConfirmation();
    }
}