"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const test_1 = require("@playwright/test");
const playwrightHelpers_1 = require("./helpers/playwrightHelpers");
(0, playwrightHelpers_1.runPlaywrightTestWithConfig)(runCanViewReservationsPageTest);
function runCanViewReservationsPageTest(config) {
    (0, test_1.test)(`can view find reservations page on ${config.url}`, (_a) => __awaiter(this, [_a], void 0, function* ({ page }) {
        yield page.goto(config.url);
        // Click through to the 'Hotel info' page.
        const findReservationsLink = page.getByRole('link', { name: 'Find reservations' });
        yield (0, test_1.expect)(findReservationsLink).toBeVisible();
        yield findReservationsLink.click();
        // Verify that the expected elements are on the page.
        const findYourReservationHeading = page.getByRole('heading', { name: 'Find your reservation' });
        yield (0, test_1.expect)(findYourReservationHeading).toBeVisible();
        const findReservationButton = page.getByRole('button', { name: 'Find Reservation' });
        yield (0, test_1.expect)(findReservationButton).toBeVisible();
        // todo: Maybe test form validation?
        // Verify that we can go back to the main booking page.
        const backToCheckAvailabilityButton = page.getByRole('button', { name: 'Back to check availability' });
        yield (0, test_1.expect)(backToCheckAvailabilityButton).toBeVisible();
        yield backToCheckAvailabilityButton.click();
        const selectYourDateHeading = page.getByRole('heading', { name: 'Select your date' });
        yield (0, test_1.expect)(selectYourDateHeading).toBeVisible();
    }));
}
;
//# sourceMappingURL=canViewFindReservationsPage.spec.js.map