🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@processmaker/cypress-utils

Package Overview
Dependencies
Maintainers
2
Versions
531
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@processmaker/cypress-utils - npm Package Compare versions

Comparing version

to
1.0.526

2

package.json
{
"name": "@processmaker/cypress-utils",
"version": "1.0.525",
"version": "1.0.526",
"description": "ProcessMaker Cypress Testing Utilities",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -735,114 +735,120 @@ import selectors from "#selectors/processTesting";

//Modal Run Test from process configure
/* runTestFromProcessConfigure(runTestConfig, manualOrAdvanced, singleOrMassive, query) {
const { alternative, startingPoint, manualResumePoint, scenario, additionalData, isEnabledBypass } = runTestConfig
/**
* Runs a test from the process configuration
* @param {Object} runTestConfig - Test configuration
* @param {string} manualOrAdvanced - Execution mode ('Manual' or 'Advanced')
* @param {string} singleOrMassive - Execution type ('Single' or 'Massive')
* @param {string} query - PMQL query for advanced mode
*/
runTestFromProcessConfigure(runTestConfig, manualOrAdvanced, singleOrMassive, query) {
const { alternative, startingPoint, manualResumePoint, scenario, additionalData, isEnabledBypass } = runTestConfig;
// Wait for the page to be ready
cy.wait(2000);
// Create the test
this.createRunTest();
cy.xpath(selectors.labelAlternative).should('be.visible');
cy.xpath(selectors.containerSP).should('contain', 'Start Event');
// Verify that the modal is present and visible
cy.get('.modal-content', { timeout: 30000 })
.should('exist')
.should('be.visible')
.within(() => {
// Verify main elements
cy.xpath(selectors.labelAlternative, { timeout: 30000 })
.should('exist')
.should('be.visible')
.then($el => {
cy.log('Element found:', $el.text());
});
if (alternative !== null) {
this.selectAlternativeFromProcessConfigure(alternative.alternative);
}
cy.xpath(selectors.containerSP, { timeout: 30000 })
.should('exist')
.should('be.visible')
.should('contain', 'Start Event');
if (startingPoint !== null) {
cy.wait(3000);
this.selectStartingPoint(startingPoint.startingPointOption);
}
// Configure alternative if it exists
if (alternative !== null) {
cy.log('Configuring alternative:', alternative.alternative);
this.selectAlternativeFromProcessConfigure(alternative.alternative);
cy.wait(1000);
}
if (manualResumePoint !== null) {
this.selectManualResumePoint(manualResumePoint.stopPointOption);
}
// Configure starting point if it exists
if (startingPoint !== null) {
cy.log('Configuring starting point:', startingPoint.startingPointOption);
cy.wait(3000);
this.selectStartingPoint(startingPoint.startingPointOption);
cy.wait(1000);
}
switch (manualOrAdvanced) {
case "Manual":
this.selectManualOrAdvanced('Manual');
break;
case "Advanced":
this.selectManualOrAdvanced('Advanced');
this.fillPMQL(query);
this.clickOnBrowseBtn();
break;
default:
break;
}
// Configure manual resume point if it exists
if (manualResumePoint !== null) {
cy.log('Configuring manual resume point:', manualResumePoint.stopPointOption);
this.selectManualResumePoint(manualResumePoint.stopPointOption);
cy.wait(1000);
}
if (scenario !== null) {
switch (singleOrMassive) {
case "Single":
this.selectScenario(scenario.scenarioOption);
break;
case "Massive":
this.selectAllScenarios(scenario.scenarioOption);
break;
default:
break;
}
}
// Select manual or advanced mode
cy.log('Selecting mode:', manualOrAdvanced);
switch (manualOrAdvanced) {
case "Manual":
this.selectManualOrAdvanced('Manual');
cy.get(selectors.manualBtn)
.should('have.class', 'active')
.should('be.visible');
break;
case "Advanced":
this.selectManualOrAdvanced('Advanced');
cy.get(selectors.advancedBtn)
.should('have.class', 'active')
.should('be.visible');
if (query) {
this.fillPMQL(query);
this.clickOnBrowseBtn();
cy.wait(1000);
}
break;
default:
cy.log('Modo no especificado:', manualOrAdvanced);
}
if (additionalData !== null) {
this.addAdditionalData(additionalData.data)
}
// Configure or Massive scenario if it exists
if (scenario !== null) {
cy.log('Configuring scenario:', scenario.scenarioOption);
switch (singleOrMassive) {
case "Single":
this.selectScenario(scenario.scenarioOption);
cy.wait(2000);
break;
case "Massive":
this.selectAllScenariosSync();
cy.wait(2000);
break;
default:
cy.log('Tipo de ejecución no especificado:', singleOrMassive);
}
}
if (isEnabledBypass) {
this.enableBypassCheckbox();
}
// Add additional data if it exists
if (additionalData !== null) {
cy.log('Adding additional data:', additionalData.data);
this.addAdditionalData(additionalData.data);
cy.wait(1000);
}
this.clickOnRunBtn();
}
// Enable bypass if it is necessary
if (isEnabledBypass) {
cy.log('Enabling bypass');
this.enableBypassCheckbox();
cy.wait(1000);
}
//III.Others
openLastTest() {
cy.xpath('//div[@id="test_runs"]//table//tbody//td[1]//a').last().click();
}
// Run the test
cy.log('Running test');
this.clickOnRunBtn();
});
clickOnclearBtn() {
cy.get(selectors.clearBtnInRunTab).should('be.visible');
cy.get('div[class="tab-content"]', { timeout: 10000 }).should('be.visible')
cy.get(selectors.clearBtnInRunTab).click();
}
clickOnConfirmClearTests() {
cy.xpath(selectors.confirmDeleteAllTests).should('be.visible');
cy.xpath(selectors.confirmDeleteAllTests).click();
}
clearAllTestRuns() {
this.clickOnTestRunsTab();
this.clickOnTestRunTabScenarios();
cy.wait(2000);
this.clickOnTestRunTab();
cy.xpath(selectors.rowTestsRun).find('td').invoke('text').then(($element) => {
if ($element !== 'No Data Available') {
this.clickOnclearBtn();
this.clickOnConfirmClearTests();
}
else {
return;
}
})
}*/
runTestFromProcessConfigure(runTestConfig, manualOrAdvanced, singleOrMassive, query) {
const { alternative, startingPoint, manualResumePoint, scenario, additionalData, isEnabledBypass } = runTestConfig
// Wait for the page to load
cy.wait(2000);
// Create the test run
this.createRunTest();
// Verifies that the element exists (using the most flexible selector)
cy.xpath('//label[contains(text(),"Alternative")]', { timeout: 30000 })
.should('exist')
.should('be.visible')
.then($el => {
cy.log('Elemento encontrado:', $el.text());
});
// Verifies the container
cy.xpath(selectors.containerSP)
.should('exist')
.should('contain', 'Start Event');
}
selectAllScenariosSync(){

@@ -849,0 +855,0 @@ cy.xpath('//div[@data-test="test-run-scenario-select"]//div[@class="multiselect__tags"]')