"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)(runCanViewHotelInfoPageTest);
function runCanViewHotelInfoPageTest(config) {
    (0, test_1.test)(`can view hotel info on ${config.url}`, (_a) => __awaiter(this, [_a], void 0, function* ({ page }) {
        yield page.goto(config.url);
        // Click through to the 'Hotel info' page.
        const hotelInfoLink = page.getByRole('link', { name: 'Hotel info' });
        yield (0, test_1.expect)(hotelInfoLink).toBeVisible();
        yield hotelInfoLink.click();
        // Check that header and subheader are on the page.
        const header = page.locator('h1.c-masthead__header');
        const subheader = page.locator('h2.c-masthead__sub-header');
        (0, test_1.expect)(header).toBeVisible();
        (0, test_1.expect)(header).not.toBeEmpty();
        (0, test_1.expect)(subheader).toBeVisible();
        (0, test_1.expect)(subheader).not.toBeEmpty();
        // Check that the 'Powered by roomstay.io' message exists.
        const poweredByMessage = page.getByText('Powered by Roomstay.io');
        yield (0, test_1.expect)(poweredByMessage).toBeVisible();
        // Check that the 'Book Now' button exists.
        const bookNowButton = page.getByRole('button', { name: 'Book Now' });
        (0, test_1.expect)(bookNowButton).toBeVisible();
        // Check that clicking the 'Book Now' button takes the user to the booking page.
        yield bookNowButton.click();
        const selectYourDateHeading = page.getByRole('heading', { name: 'Select your date' });
        yield (0, test_1.expect)(selectYourDateHeading).toBeVisible();
    }));
}
;
//# sourceMappingURL=canViewHotelnfoPage.spec.js.map