UNPKG

@umbraco/playwright-testhelpers

Version:

Test helpers for making playwright tests for Umbraco solutions

55 lines 2.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InstallUiHelper = void 0; const test_1 = require("@playwright/test"); const UiBaseLocators_1 = require("../UiBaseLocators"); class InstallUiHelper extends UiBaseLocators_1.UiBaseLocators { nameTxt; emailTxt; passwordTxt; nextBtn; databaseTypeInput; databaseType; installBtn; constructor(page) { super(page); this.nameTxt = page.getByLabel('name'); this.emailTxt = page.getByLabel('email'); this.passwordTxt = page.getByLabel('password', { exact: true }); this.nextBtn = page.getByLabel('Next'); this.databaseTypeInput = page.locator('#database-type').locator('#native'); this.databaseType = page.locator('#database-type').locator('option:checked'); this.installBtn = page.getByLabel('Install'); } async goToInstallPage() { await this.page.goto(process.env.URL + '/umbraco/install'); } async enterName(name) { await (0, test_1.expect)(this.nameTxt).toBeVisible(); await this.nameTxt.fill(name); } async enterEmail(email) { await (0, test_1.expect)(this.emailTxt).toBeVisible(); await this.emailTxt.fill(email); } async enterPassword(password) { await (0, test_1.expect)(this.passwordTxt).toBeVisible(); await this.passwordTxt.fill(password); } async clickNextButton() { await (0, test_1.expect)(this.nextBtn).toBeVisible(); await this.nextBtn.click(); } async setDatabaseType(databaseType) { await this.databaseTypeInput.selectOption(databaseType); } async doesDatabaseHaveType(databaseType) { await (0, test_1.expect)(this.databaseType).toHaveText(databaseType); } async clickInstallButton() { await (0, test_1.expect)(this.installBtn).toBeVisible(); await this.installBtn.click(); } } exports.InstallUiHelper = InstallUiHelper; //# sourceMappingURL=InstallUiHelper.js.map