@umbraco/playwright-testhelpers
Version:
Test helpers for making playwright tests for Umbraco solutions
55 lines • 2.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RelationTypeUiHelper = void 0;
const UiBaseLocators_1 = require("./UiBaseLocators");
class RelationTypeUiHelper extends UiBaseLocators_1.UiBaseLocators {
relationTypeNameTxt;
parentToChildRadioBtn;
bidirectionalRadioBtn;
isDependencyToggle;
parentDropDownBox;
childDropDownBox;
constructor(page) {
super(page);
this.relationTypeNameTxt = page.locator('#name #input');
this.parentToChildRadioBtn = page.locator("uui-radio[label='Parent to child'] #button");
this.bidirectionalRadioBtn = page.locator("uui-radio[label='Bidirectional'] #button");
this.isDependencyToggle = page.locator("umb-property-layout[label='Is dependency'] #toggle");
this.parentDropDownBox = page.locator("umb-property-layout[label='Parent'] #native");
this.childDropDownBox = page.locator("umb-property-layout[label='Child'] #native");
}
async clickActionsMenuForRelationType(name) {
await this.clickActionsMenuForName(name);
}
async clickRootFolderCaretButton() {
await this.clickCaretButtonForName("Relation Types");
}
async clickActionsMenuAtRoot() {
await this.clickActionsMenuForRelationType("Relation Types");
}
async openRelationTypeByNameAtRoot(relationTypeName) {
await this.clickRootFolderCaretButton();
await this.page.getByLabel(relationTypeName).click();
}
async enterRelationTypeName(name) {
await this.relationTypeNameTxt.clear();
await this.relationTypeNameTxt.fill(name);
}
async clickParentToChildRadioButton() {
await this.parentToChildRadioBtn.click();
}
async clickBidirectionalRadioButton() {
await this.bidirectionalRadioBtn.click();
}
async clickIsDependencyToggle() {
await this.isDependencyToggle.click();
}
async selectParentOption(option) {
await this.parentDropDownBox.selectOption({ label: option });
}
async selectChildOption(option) {
await this.childDropDownBox.selectOption({ label: option });
}
}
exports.RelationTypeUiHelper = RelationTypeUiHelper;
//# sourceMappingURL=RelationTypeUiHelper.js.map