"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LoginPage = void 0;
const test_1 = require("@playwright/test");
const BasePage_1 = require("../BasePage/BasePage");
const LoginPage_locators_1 = require("./LoginPage.locators");
class LoginPage extends BasePage_1.BasePage {
    constructor(page) {
        super(page);
        const locators = (0, LoginPage_locators_1.createLoginPageLocators)(page);
        this.emailInput = locators.emailInput;
        this.passwordInput = locators.passwordInput;
        this.submitButton = locators.submitButton;
        this.LoginWithCertificateCSP = locators.LoginWithCertificateCSP;
    }
    async gotoLogin() {
        await this.goto('main/auth/signin');
    }
    async login(email, password) {
        await test_1.test.step(`Ввод Email пользователя`, async () => {
            await this.emailInput.fill(email);
        });
        await test_1.test.step(`Ввод пароля пользователя`, async () => {
            await this.passwordInput.fill(password);
        });
        await this.submitButton.click();
    }
    async loginWithCertificate(certHolder) {
        await this.LoginWithCertificateCSP.click();
        await this.certificateHelper.chooseCertificateAndSign(certHolder);
    }
}
exports.LoginPage = LoginPage;
