Skip to content

Commit

Permalink
fixFuntions
Browse files Browse the repository at this point in the history
  • Loading branch information
MayraMelisa committed Sep 24, 2024
1 parent 96e0b42 commit 4df47ec
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
7 changes: 7 additions & 0 deletions pages/documentingProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export class DocumentingProcess {
});
}

openAlternativeInDocumentingFromTemplate(alternative = "A") {
cy.url().then(($url) => {
let processID = $url.split("/")[5].trim();
cy.visit("/modeler/" + processID + "/documentation/" + alternative + "?generated=false");
});
}

//Go to Documentation from modeler
goToDocumentationFromModeler() {
cy.get(selectors.options).first().should('exist').click();
Expand Down
12 changes: 7 additions & 5 deletions pages/execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -8593,10 +8593,11 @@ async actionsAndAssertionsOfTCP42332_4(taskName, process_id, subprocess_id, subp
actionsAndAssertionsTCP42977(nameProcess, version){
navHelper.navigateToProcessPage();
process.searchProcessAndSelectOptions(nameProcess,"Template");
var templateName = new Date().getTime()+"New template";
var Description = new Date().getTime()+"Description test";
//Step 1: Create process as a Template
process.publishTemplate(templateName,Description, version);
let timeStamp = new Date().getTime();
var templateName = "TCP4-2977 Template"+timeStamp;
var Description = "Verify that a template is created after importing a BPMN";
//Step 1: Create template form a process
template.createTemplatefromProcess(templateName,Description, version);
//Step 2: Review template created
navHelper.navigateToProcessPage();
cy.get("#nav-templates-tab").click();
Expand Down Expand Up @@ -8712,7 +8713,7 @@ async actionsAndAssertionsOfTCP42332_4(taskName, process_id, subprocess_id, subp
cy.wait(1000);
cy.get("div > span").first().should('be.visible');
}
actionsAndAssertionsTC42983(processName){
actionsAndAssertionsTC42983(processName, IdProcess){
//Step1: Review nested screen
navHelper.navigateToProcessPage();
process.searchProcessAndSelectOptions(processName,"edit");
Expand Down Expand Up @@ -8743,6 +8744,7 @@ async actionsAndAssertionsOfTCP42332_4(taskName, process_id, subprocess_id, subp
cy.readFile(path).its("name").should("eq", processName);
cy.readFile(path).its("type").should("eq", "process_package");
}

verifyConfigurationTCP43114(processName){
process.searchProcessAndSelectOptions(processName,"edit");
cy.get('[data-cy="inspector-button"]').should('be.visible').click();
Expand Down
10 changes: 0 additions & 10 deletions pages/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -2034,16 +2034,6 @@ export class Process {
cy.xpath(selectors.inspectorPanel).should("have.css", "display", "none");
}

publishTemplate(templateName,Description, version){
var nameXpath = '//div[@id="createTemplate"]//div[@class="modal-body"]//legend[text()="Template Name"]/ancestor::fieldset//div /input';
var descriptionXpath = '//div[@id="createTemplate"]//div[@class="modal-body"]//legend[text()="Description"]/ancestor::fieldset//div /textarea';
var versionXpath = '//div[@id="createTemplate"]//div[@class="modal-body"]//legend[text()="Version"]/ancestor::fieldset//div /input[@name="version"]';
var saveXpath='//div[@id="createTemplate"]//footer//button[normalize-space()="Save"]';
cy.xpath(nameXpath).should('be.visible').type(templateName);
cy.xpath(descriptionXpath).should('be.visible').type(Description);
cy.xpath(versionXpath).should('be.visible').type(version);
cy.xpath(saveXpath).should('be.visible').click();
}
searchTemplate(templateName) {
cy.xpath(selectors.threePointsBtnXpathTemplate).should("be.visible");
cy.xpath("(//div[@id='search']//input[@aria-label='Search'])[1]")
Expand Down
8 changes: 8 additions & 0 deletions pages/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,12 @@ export class Templates {
return response.data.processId;
});
}

//Create a template from a process
createTemplatefromProcess(templateName,Description, version){
cy.get(selectors.nameTxtBx).should('be.visible').type(templateName, {delay:200});
cy.get(selectors.descriptionTemp).should('be.visible').type(Description, {delay:200});
cy.get(selectors.versionTemp).should('be.visible').type(version);
cy.get(selectors.saveTemp).should('be.visible').click();
}
}
4 changes: 4 additions & 0 deletions selectors/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export default {
addProcessBtn:'[aria-label="Create Process"]',
useTemplate:':nth-child(2) > .d-flex > .btn',
saveBtnInPopUp: '//button[text()="Save"]',
//Template from a process
nameTxtBx: '[name="name"]',
descriptionTemp: '[name="description"]',
versionTemp:'[name="version"]',
saveTemp: 'button[class="btn ml-2 btn-primary"]',

}

0 comments on commit 4df47ec

Please sign in to comment.