jomarko commented on code in PR #2239: URL: https://github.com/apache/incubator-kie-tools/pull/2239#discussion_r1570021450
########## packages/dmn-editor/tests/e2e/__fixtures__/propertiesPanel/decisionPropertiesPanel.ts: ########## @@ -0,0 +1,140 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { Page } from "@playwright/test"; +import { ShapeProperties } from "./parts/shapeProperties"; +import { PropertiesPanelBase } from "./propertiesPanelBase"; +import { Diagram } from "../diagram"; +import { FontProperties } from "./parts/fontProperties"; +import { DocumentationProperties } from "./parts/documentationProperties"; +import { DescriptionProperties } from "./parts/descriptionProperties"; +import { DataTypeProperties } from "./parts/dataTypeProperties"; +import { DataType } from "../jsonModel"; +import { NameProperties } from "./parts/nameProperties"; + +export class DecisionPropertiesPanel extends PropertiesPanelBase { + private nameProperties: NameProperties; + private dataTypeProperties: DataTypeProperties; + private descriptionProperties: DescriptionProperties; + private documentationProperties: DocumentationProperties; + private fontProperties: FontProperties; + private shapeProperties: ShapeProperties; + + constructor(public diagram: Diagram, public page: Page) { + super(diagram, page); + this.nameProperties = new NameProperties(this.panel(), page); + this.dataTypeProperties = new DataTypeProperties(this.panel(), page); + this.descriptionProperties = new DescriptionProperties(this.panel(), diagram); + this.documentationProperties = new DocumentationProperties(this.panel(), page); + this.fontProperties = new FontProperties(this.panel(), diagram); + this.shapeProperties = new ShapeProperties(this.panel()); + } + + public async setName(args: { newName: string }) { + await this.nameProperties.setName({ ...args }); + } + + public async getName() { + return await this.nameProperties.getName(); + } + + public async setDataType(args: { newDataType: DataType }) { + await this.dataTypeProperties.setDataType({ ...args }); + } + + public async setDescription(args: { newDescription: string }) { + await this.descriptionProperties.setDescription({ ...args }); + } + + public async getDescription() { + return await this.descriptionProperties.getDescription(); + } + + public async addDocumentationLink(args: { linkText: string; linkHref: string }) { + await this.documentationProperties.addDocumentationLink({ ...args }); + } + + public async getDocumentationLinks() { + return await this.documentationProperties.getDocumentationLinks(); + } + + public async setQuestion(args: { newQuestion: string }) { + await this.panel().getByPlaceholder("Enter a question...").fill(args.newQuestion); + // commit changes by click to the diagram + await this.diagram.resetFocus(); + } + + public async getQuestion() { + return await this.panel().getByPlaceholder("Enter a question...").inputValue(); + } + + public async setAllowedAnswers(args: { newAllowedAnswers: string }) { + await this.panel().getByPlaceholder("Enter allowed answers...").fill(args.newAllowedAnswers); + // commit changes by click to the diagram + await this.diagram.resetFocus(); Review Comment: thank you for this tip, I like usage of the "Tab", changes pushed now -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
