@umbraco/playwright-testhelpers
Version:
Test helpers for making playwright tests for Umbraco solutions
30 lines • 1.53 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CurrentUserProfileUiHelper = void 0;
const UiBaseLocators_1 = require("./UiBaseLocators");
const ConstantHelper_1 = require("./ConstantHelper");
class CurrentUserProfileUiHelper extends UiBaseLocators_1.UiBaseLocators {
changePasswordBtn;
constructor(page) {
super(page);
this.changePasswordBtn = page.getByLabel('Change password');
}
async clickChangePasswordButton() {
await this.click(this.changePasswordBtn);
}
async changePassword(currentPassword, newPassword) {
await this.enterText(this.currentPasswordTxt, currentPassword);
await this.enterText(this.newPasswordTxt, newPassword);
await this.enterText(this.confirmPasswordTxt, newPassword);
await this.clickConfirmButton();
}
async changePasswordAndWaitForSuccess(currentPassword, newPassword) {
await this.waitForVisible(this.currentPasswordTxt);
await this.enterText(this.currentPasswordTxt, currentPassword);
await this.enterText(this.newPasswordTxt, newPassword);
await this.enterText(this.confirmPasswordTxt, newPassword);
return await this.waitForResponseAfterExecutingPromise(ConstantHelper_1.ConstantHelper.apiEndpoints.currentUser + '/change-password', this.clickConfirmButton(), ConstantHelper_1.ConstantHelper.statusCodes.ok);
}
}
exports.CurrentUserProfileUiHelper = CurrentUserProfileUiHelper;
//# sourceMappingURL=CurrentUserProfileUiHelper.js.map