Skip to content

Commit

Permalink
updateMethodsInProcessTesting
Browse files Browse the repository at this point in the history
  • Loading branch information
WendyFPM committed Sep 13, 2024
1 parent ebe2108 commit 1f09e06
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pages/processTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export class ProcessTesting {

//I.Search scenario
searchScenario(scenarioName) {
cy.wait(1000);
cy.get(selectors.searchScenario).first().clear().type(scenarioName, { delay: 80, force: true });
cy.get(selectors.searchScenario).first().type(' ', { force: true });
cy.get(selectors.searchScenario).first().type('{backspace}{backspace}', { force: true })
Expand Down Expand Up @@ -298,7 +299,6 @@ export class ProcessTesting {
//IV. Delete scenario
deleteScenario() {
cy.get('a[data-test="delete-scenario-btn"]').click();
//cy.xpath(selectors.deleteScenarioBtn).first().click();
cy.wait(1500)
cy.xpath(selectors.confirmDeleteScenario).click();
}
Expand All @@ -324,7 +324,8 @@ export class ProcessTesting {
this.clickOnTestRunTab();
}

createScenario(scenarioName, scenarioDescription, scenarioCreationType, data, nameFile, filePath) {
createScenario(createScenarioConfig) {
const { scenarioName, scenarioDescription, scenarioCreationType, data, nameFile, filePath } = createScenarioConfig
this.clickOnPlusScenario();
this.fillName(scenarioName);
this.fillDescription(scenarioDescription);
Expand All @@ -345,19 +346,21 @@ export class ProcessTesting {
}

//2D Modal to create scenario
createScenarioByProcess(scenarioName, scenarioDescription, scenarioCreationType, data, nameFile, filePath) {
createScenarioByProcess(createScenarioConfig) {
this.goToScenariosTab();
this.createScenario(scenarioName, scenarioDescription, scenarioCreationType, data, nameFile, filePath)
this.createScenario(createScenarioConfig)
cy.get('.alert-wrapper > .alert').should("be.visible");
cy.get('.alert-wrapper > .alert').should("contain","The process test scenario was created.");
}

createScenarioIfNotExist(scenarioName, scenarioDescription, scenarioCreationType, data, nameFile, filePath) {
createScenarioIfNotExist(scenarioName,createScenarioConfig) {
this.goToScenariosTab();
this.searchScenario(scenarioName);
this.load();
cy.xpath('//div[@id="scenarios-edit-tab"]//div[@class="data-table"]').invoke('text').then($element => {
cy.log($element)
if ($element.includes('No Data Available')) {
this.createScenario(scenarioName, scenarioDescription, scenarioCreationType, data, nameFile, filePath);
this.createScenario(createScenarioConfig);
} else {
cy.log('brenda')
}
Expand Down

0 comments on commit 1f09e06

Please sign in to comment.