From 9e57be25a4b69d0d35337d073410d2c16f4264f7 Mon Sep 17 00:00:00 2001 From: jasquat Date: Wed, 10 May 2023 15:49:55 -0400 Subject: [PATCH 1/3] some updates for NDR_PP1 cypress tests w/ burnettk --- spiffworkflow-frontend/.gitignore | 2 + spiffworkflow-frontend/bin/cypress_pilot | 9 +- .../pilot/NDR_PP1/consultingfees.cy.js | 38 +- .../pilot/NDR_PP1/softwarelicense.cy.js | 6705 ++++++++--------- .../cypress/support/commands.js | 1 + 5 files changed, 3376 insertions(+), 3379 deletions(-) diff --git a/spiffworkflow-frontend/.gitignore b/spiffworkflow-frontend/.gitignore index c0316f7e..b425f33a 100644 --- a/spiffworkflow-frontend/.gitignore +++ b/spiffworkflow-frontend/.gitignore @@ -33,3 +33,5 @@ cypress/screenshots # Editors .idea + +/cypress.env diff --git a/spiffworkflow-frontend/bin/cypress_pilot b/spiffworkflow-frontend/bin/cypress_pilot index 121e9138..12a71556 100755 --- a/spiffworkflow-frontend/bin/cypress_pilot +++ b/spiffworkflow-frontend/bin/cypress_pilot @@ -30,6 +30,14 @@ if [[ -z "${CYPRESS_SPIFFWORKFLOW_FRONTEND_AUTH_WITH_KEYCLOAK:-}" ]]; then export CYPRESS_SPIFFWORKFLOW_FRONTEND_AUTH_WITH_KEYCLOAK=true fi +if [[ -f cypress.env ]]; then + # shellcheck disable=1091 + source cypress.env +else + >&2 echo "ERROR: This requires a cypress.env file to run. You may be able to use generate_pp1_cypress_env_configs." + exit 1 +fi + cypress_run_file="/var/tmp/cypress_run" echo "Recording stats to ${cypress_run_file}" @@ -44,7 +52,6 @@ for attempt in $(seq 1 "$ATTEMPTS" ); do start_time=$(date +%s) success="false" - # spec_pattern="cypress/pilot/**/*.cy.{js,jsx,ts,tsx}" spec_pattern="cypress/pilot/**/*.cy.{js,jsx,ts,tsx}" if ./node_modules/.bin/cypress "$command" -c specPattern="${spec_pattern}" --e2e --browser chrome "$@"; then success="true" diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js index cea152e8..66d3dbf9 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js @@ -42,7 +42,7 @@ const submitWithUser = ( cy.get('button') .contains(/^Submit$/) .click(); - //Form 2 + //Form 2 /*cy.contains('Task: Enter NDR Items', { timeout: 60000 }); cy.get('button') .contains(/^Submit$/) @@ -105,12 +105,12 @@ describe.only('Consulting Fees Path - Without Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - + cy.wait(2000); cy.get('input#root-procurement').click(); cy.wait(2000); - - + + cy.get('button') .contains(/^Submit$/) .click(); @@ -234,12 +234,12 @@ describe.only('Consulting Fees Path - Without Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - + cy.wait(2000); cy.get('input#root-procurement').click(); cy.wait(2000); - - + + cy.get('button') .contains(/^Submit$/) .click(); @@ -363,12 +363,12 @@ describe.only('Consulting Fees Path - Without Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - + cy.wait(2000); cy.get('input#root-procurement').click(); cy.wait(2000); - - + + cy.get('button') .contains(/^Submit$/) .click(); @@ -517,12 +517,12 @@ describe('Consulting Fees Path - With Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - + cy.wait(2000); cy.get('input#root-procurement').click(); cy.wait(2000); - - + + cy.get('button') .contains(/^Submit$/) .click(); @@ -685,12 +685,12 @@ describe('Consulting Fees Path - With Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - + cy.wait(2000); cy.get('input#root-procurement').click(); cy.wait(2000); - - + + cy.get('button') .contains(/^Submit$/) .click(); @@ -856,12 +856,12 @@ describe('Consulting Fees Path - With Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - + cy.wait(2000); cy.get('input#root-procurement').click(); cy.wait(2000); - - + + cy.get('button') .contains(/^Submit$/) .click(); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js index a54299a3..a8ac1e5e 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js @@ -1,3403 +1,3390 @@ const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype + username, + password, + processInstanceId, + expectAdditionalApprovalInfoPage = false, + approvaltype ) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); + cy.wait(2000); + cy.log('========Login with : ', username); + cy.log('========processInstanceId: ', processInstanceId); + cy.login(username, password); - cy.wait(1000); - cy.log('=======visit find by id : '); - cy.visit('/admin/process-instances/find-by-id'); - cy.wait(3000); - cy.get('#process-instance-id-input').type(processInstanceId); - cy.get('button') + cy.wait(1000); + cy.log('=======visit find by id : '); + cy.visit('/admin/process-instances/find-by-id'); + cy.wait(3000); + cy.get('#process-instance-id-input').type(processInstanceId); + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.wait(2000); + cy.contains('Tasks I can complete', { timeout: 60000 }); + + cy.get('.cds--btn').contains(/^Go$/).click(); + + cy.wait(2000); + // approve! + if (approvaltype === "approve") { + cy.get('#root > label:nth-child(1)').click(); + cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' is approving this.')); + } else if (approvaltype === "reject") { + cy.get('#root > label:nth-child(3)').click(); + cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' is rejecting this.')); + } else if (approvaltype === "needmoreinfo") { + cy.get('#root > label:nth-child(2)').click(); + cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' needs additional info. A software license is a document that provides legally binding guidelines for the use and distribution of software.Software licenses typically provide end users with the right to END.')); + //cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' needs additional info.')); + } else if (approvaltype === "cpapproved") { + cy.get('#root > label:nth-child(3)').click(); + cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' is selecting CP is Approved.')); + } else if (approvaltype === "providemoreinfo") { + //Form 1 + cy.contains('Task: Submit Details', { timeout: 60000 }); + cy.get('button') .contains(/^Submit$/) .click(); - - cy.wait(2000); - cy.contains('Tasks I can complete', { timeout: 60000 }); - - cy.get('.cds--btn').contains(/^Go$/).click(); - - cy.wait(2000); - // approve! - if (approvaltype === "approve") { - cy.get('#root > label:nth-child(1)').click(); - cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' is approving this.')); - } else if (approvaltype === "reject") { - cy.get('#root > label:nth-child(3)').click(); - cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' is rejecting this.')); - } else if (approvaltype === "needmoreinfo") { - cy.get('#root > label:nth-child(2)').click(); - cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' needs additional info. A software license is a document that provides legally binding guidelines for the use and distribution of software.Software licenses typically provide end users with the right to END.')); - //cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' needs additional info.')); - } else if (approvaltype === "cpapproved") { - cy.get('#root > label:nth-child(3)').click(); - cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' is selecting CP is Approved.')); - } else if (approvaltype === "providemoreinfo") { - //Form 1 - cy.contains('Task: Submit Details', { timeout: 60000 }); - cy.get('button') - .contains(/^Submit$/) - .click(); - //Form 2 - /*cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - cy.get('button') - .contains(/^Submit$/) - .click();*/ + //Form 2 + /*cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + cy.get('button') + .contains(/^Submit$/) + .click();*/ //Form 3 - cy.contains( - 'Task: Review the Request', - { timeout: 60000 }); + cy.contains( + 'Task: Review the Request', + { timeout: 60000 }); - cy.get('.cds--text-area__wrapper').find('#root').clear().type('Providing additional info. Open source is a term that originally referred to open source software (OSS). Open source software is code that is designed to be publicly accessible—anyone can see, modify, and distribute.'); + cy.get('.cds--text-area__wrapper').find('#root').clear().type('Providing additional info. Open source is a term that originally referred to open source software (OSS). Open source software is code that is designed to be publicly accessible—anyone can see, modify, and distribute.'); - //cy.contains('Submit the Request').click(); - //cy.get('input[value="Submit the Request"]').click(); + //cy.contains('Submit the Request').click(); + //cy.get('input[value="Submit the Request"]').click(); } else { } + cy.get('button') + .contains(/^Submit$/) + .click(); + + if (expectAdditionalApprovalInfoPage) { + cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); + cy.get('button') - .contains(/^Submit$/) - .click(); + .contains(/^Continue$/) + .click(); - if (expectAdditionalApprovalInfoPage) { - cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); + } - cy.get('button') - .contains(/^Continue$/) - .click(); + cy.visit('/'); - } - - cy.visit('/'); - - cy.location({ timeout: 60000 }).should((loc) => { - expect(loc.pathname).to.eq('/'); - }); - cy.wait(2000); - cy.logout(); - cy.wait(2000); + cy.location({ timeout: 60000 }).should((loc) => { + expect(loc.pathname).to.eq('/'); + }); + cy.wait(2000); + cy.logout(); + cy.wait(2000); }; //Software and Licenses Path - Without Files describe.only('Software and Licenses Path - Without Files', () => { - Cypress._.times(1, () => { - - //Everyone approves with CP - it('Everyone approves with CP', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(2000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Microsoft'); - cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - //item 0 - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('SNT'); - cy.get('#root_item_0_unit_price').type('1915'); - - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 1 - cy.get('#root_item_1_sub_category').select('lic_and_sub'); - cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); - cy.get('#root_item_1_qty').clear().type('1'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('AED'); - cy.get('#root_item_1_unit_price').type('4500'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Windows 10 S, w/Ghost Manta Accessories, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Everyone approves the request - it('Everyone approves', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('05-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Red Hat'); - cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - - //item 0 - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Open source has become a movement and a way of working that reaches beyond software production'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('NZD'); - cy.get('#root_item_0_unit_price').type('2416'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 1 - cy.get('#root_item_1_sub_category').select('lic_and_sub'); - cy.get('#root_item_1_item_name').clear().type('A software license is a document that states the rights of the developer and user of software.'); - cy.get('#root_item_1_qty').clear().type('1'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('STN'); - cy.get('#root_item_1_unit_price').type('380'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('Software also comes with a license key or product key. The key is used to identify and verify the specific version of the software. It is also used to activate the software device.\nhttps://www.techtarget.com/searchcio/definition/software-license'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - 'Task: Update Application Landscape', - "approve" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Budget owner rejects the request - it('Budget owner rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('24-02-2026'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Oracle'); - cy.get('#root_payment_method').select('Bank Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('It defines the terms of. A user must agree to the terms of the license when acquiring the software.'); - cy.get('#root_item_0_qty').clear().type('5'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('EUR'); - cy.get('#root_item_0_unit_price').type('250'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('Software also comes with a license key or product key. The key is used to identify and verify the specific version of the software. It is also used to activate the software device.\nhttps://www.techtarget.com/searchcio/definition/software-license'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - //Budget owner request for additional details - it('Budget owner need more info', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('A software license establishes the rights of all parties involved with the software: the author, the provider and the end users. It defines the relationship between the software company and users and explains how they are protected'); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('25-02-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('ABC Licensing Co'); - cy.get('#root_payment_method').select('Crypto Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('They protect developers\' intellectual property and trade secrets based on copyright laws'); - cy.get('#root_item_0_qty').clear().type('4'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('SNT'); - cy.get('#root_item_0_unit_price').type('450'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('They define what users can do with software code they did not write.'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "needmoreinfo" - ); - - //requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - "providemoreinfo" - ); - - //budget owner approves second time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - - }); - }); - - //Infra reject the request - it('Infra rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('There are two general types of software licenses that differ based on how they are viewed under copyright law.'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('02-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Meta'); - cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('The open source movement uses the values and decentralized production model of open source software'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('AUD'); - cy.get('#root_item_0_unit_price').type('2416'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - + Cypress._.times(1, () => { + + //Everyone approves with CP + it.only('Everyone approves with CP', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); + + cy.runPrimaryBpmnFile(true); + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(2000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Windows 10 S, w/Ghost Manta Accessories, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); }); + + //Everyone approves the request + it('Everyone approves', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('05-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Red Hat'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source has become a movement and a way of working that reaches beyond software production'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('NZD'); + cy.get('#root_item_0_unit_price').type('2416'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that states the rights of the developer and user of software.'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('STN'); + cy.get('#root_item_1_unit_price').type('380'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('Software also comes with a license key or product key. The key is used to identify and verify the specific version of the software. It is also used to activate the software device.\nhttps://www.techtarget.com/searchcio/definition/software-license'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + 'Task: Update Application Landscape', + "approve" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); + }); + + //Budget owner rejects the request + it('Budget owner rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('Medium'); + cy.get('#root_period').clear().type('24-02-2026'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Oracle'); + cy.get('#root_payment_method').select('Bank Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('It defines the terms of. A user must agree to the terms of the license when acquiring the software.'); + cy.get('#root_item_0_qty').clear().type('5'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('EUR'); + cy.get('#root_item_0_unit_price').type('250'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('Software also comes with a license key or product key. The key is used to identify and verify the specific version of the software. It is also used to activate the software device.\nhttps://www.techtarget.com/searchcio/definition/software-license'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + //Budget owner request for additional details + it('Budget owner need more info', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('A software license establishes the rights of all parties involved with the software: the author, the provider and the end users. It defines the relationship between the software company and users and explains how they are protected'); + cy.get('#root_criticality').select('Low'); + cy.get('#root_period').clear().type('25-02-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('ABC Licensing Co'); + cy.get('#root_payment_method').select('Crypto Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('They protect developers\' intellectual property and trade secrets based on copyright laws'); + cy.get('#root_item_0_qty').clear().type('4'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('450'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('They define what users can do with software code they did not write.'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "needmoreinfo" + ); + + //requestor sending additional info + submitWithUser( + username, + password, + processInstanceId, + null, + "providemoreinfo" + ); + + //budget owner approves second time + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + + }); + }); + + //Infra reject the request + it('Infra rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('There are two general types of software licenses that differ based on how they are viewed under copyright law.'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('02-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Meta'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('The open source movement uses the values and decentralized production model of open source software'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('AUD'); + cy.get('#root_item_0_unit_price').type('2416'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + + }); }); //Software and Licenses Path - Without Files and with only mandatory fields describe('Software and Licenses Path - Without Files and with only mandatory fields', () => { - Cypress._.times(1, () => { - - //Everyone approves with CP - it('Everyone approves with CP', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Need to buy a Software'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('24-11-2025'); - cy.get('body').click(); - //cy.get('#root_vendor').clear().type('Embassar'); - //cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Open source software'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('USD'); - cy.get('#root_item_0_unit_price').type('550'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Everyone approves the request - it('Everyone approves', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('need software'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('20-11-2025'); - cy.get('body').click(); - //cy.get('#root_vendor').clear().type('Embassar'); - //cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('open source'); - cy.get('#root_item_0_qty').clear().type('1'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('AED'); - cy.get('#root_item_0_unit_price').type('1520'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - 'Task: Update Application Landscape', - "approve" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Budget owner rejects the request - it('Budget owner rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Nee license'); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('20-02-2026'); - cy.get('body').click(); - //cy.get('#root_vendor').clear().type('Subsc LTD'); - //cy.get('#root_payment_method').select('Bank Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('Software development'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('EUR'); - cy.get('#root_item_0_unit_price').type('1400'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - //Budget owner request for additional details - it('Budget owner need more info', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Software needed'); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('05-02-2025'); - cy.get('body').click(); - //cy.get('#root_vendor').clear().type('ABC Licensing Co'); - //cy.get('#root_payment_method').select('Crypto Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('License'); - cy.get('#root_item_0_qty').clear().type('4'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('SNT'); - cy.get('#root_item_0_unit_price').type('450'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('It\’s free and easy to post a job. Simply fill in a title, description and budget and competitive bids come within minutes. No job is too big or too small. We\'ve got freelancers for jobs of any size or budget across 1800 skills. No job is too complex.'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "needmoreinfo" - ); - - //requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - "providemoreinfo" - ); - - //budget owner approves second time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - - }); - }); - - //Infra reject the request - it('Infra rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Software is needed'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-11-2025'); - cy.get('body').click(); - // cy.get('#root_vendor').clear().type('Embassar'); - // cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Open source'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('AUD'); - cy.get('#root_item_0_unit_price').type('2416'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - + Cypress._.times(1, () => { + + //Everyone approves with CP + it('Everyone approves with CP', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Need to buy a Software'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('24-11-2025'); + cy.get('body').click(); + //cy.get('#root_vendor').clear().type('Embassar'); + //cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('USD'); + cy.get('#root_item_0_unit_price').type('550'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); }); + + //Everyone approves the request + it('Everyone approves', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('need software'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('20-11-2025'); + cy.get('body').click(); + //cy.get('#root_vendor').clear().type('Embassar'); + //cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('open source'); + cy.get('#root_item_0_qty').clear().type('1'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('AED'); + cy.get('#root_item_0_unit_price').type('1520'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + 'Task: Update Application Landscape', + "approve" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); + }); + + //Budget owner rejects the request + it('Budget owner rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Nee license'); + cy.get('#root_criticality').select('Medium'); + cy.get('#root_period').clear().type('20-02-2026'); + cy.get('body').click(); + //cy.get('#root_vendor').clear().type('Subsc LTD'); + //cy.get('#root_payment_method').select('Bank Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('Software development'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('EUR'); + cy.get('#root_item_0_unit_price').type('1400'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + //Budget owner request for additional details + it('Budget owner need more info', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Software needed'); + cy.get('#root_criticality').select('Low'); + cy.get('#root_period').clear().type('05-02-2025'); + cy.get('body').click(); + //cy.get('#root_vendor').clear().type('ABC Licensing Co'); + //cy.get('#root_payment_method').select('Crypto Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('License'); + cy.get('#root_item_0_qty').clear().type('4'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('450'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('It\’s free and easy to post a job. Simply fill in a title, description and budget and competitive bids come within minutes. No job is too big or too small. We\'ve got freelancers for jobs of any size or budget across 1800 skills. No job is too complex.'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "needmoreinfo" + ); + + //requestor sending additional info + submitWithUser( + username, + password, + processInstanceId, + null, + "providemoreinfo" + ); + + //budget owner approves second time + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + + }); + }); + + //Infra reject the request + it('Infra rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Software is needed'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + // cy.get('#root_vendor').clear().type('Embassar'); + // cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('AUD'); + cy.get('#root_item_0_unit_price').type('2416'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + + }); }); //Software and Licenses Path - With Files describe('Software and Licenses Path - With Files', () => { - Cypress._.times(1, () => { - - //Everyone approves with CP - it('Everyone approves with CP', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('15-11-2035'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Microsoft Corp'); - cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - //item 0 - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Open source software is developed in a decentralized and collaborative way'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('JPY'); - cy.get('#root_item_0_unit_price').type('2416'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 1 - cy.get('#root_item_1_sub_category').select('lic_and_sub'); - cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); - cy.get('#root_item_1_qty').clear().type('1'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('INR'); - cy.get('#root_item_1_unit_price').type('4500'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('Open source software is developed in a decentralized and collaborative way, relying on peer review and community production. Open source software is often cheaper more flexible. \nhttps://www.redhat.com/en'); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['sampletext.txt']); - - cy.wait(2000); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Everyone approves the request - it('Everyone approves', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Stware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('30-11-2024'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('ORACLE LTD'); - cy.get('#root_payment_method').select('Bank Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('A bounty is a payment or reward of money to locate'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('SGD'); - cy.get('#root_item_0_unit_price').type('2416'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('Open source software is developed in a decentralized and collaborative way, relying on peer review and community production. Open source software is often cheaper more flexible. \nhttps://www.redhat.com/en'); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['png-5mb-2.png']); - - cy.wait(2000); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - 'Task: Update Application Landscape', - "approve" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Budget owner rejects the request - it('Budget owner rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Stware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('24-12-2023'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Subscription PVT'); - cy.get('#root_payment_method').select('Bank Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('Software development consultants with Python background'); - cy.get('#root_item_0_qty').clear().type('5'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('EUR'); - cy.get('#root_item_0_unit_price').type('250'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('Open source software is developed in a decentralized and collaborative way, relying on peer review and community production. Open source software is often cheaper more flexible. \nhttps://www.redhat.com/en'); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['png-5mb-2.png']); - - cy.wait(2000); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - //Budget owner request for additional details - it('Budget owner need more info', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Stware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('25-02-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('LIC INST'); - cy.get('#root_payment_method').select('Crypto Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('Freelancers to do the Python development and front end react app development'); - cy.get('#root_item_0_qty').clear().type('4'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('SNT'); - cy.get('#root_item_0_unit_price').type('450'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, all software is copyright protected.'); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['png-5mb-2.png']); - - cy.wait(2000); - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "needmoreinfo" - ); - - //requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - "providemoreinfo" - ); - - //budget owner approves second time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - - - }); - }); - - //Infra rejects the request - it('Infra Rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Proprietary licenses are often referred to as closed source. They provide customers with operational code. Users cannot freely alter this software. These licenses also usually restrict reverse engineering the software\'s code to obtain the source code'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Red HAT'); - cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('They provide customers with operational code. Users cannot freely alter this software.'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('STN'); - cy.get('#root_item_0_unit_price').type('2416'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['png-5mb-2.png']); - - cy.wait(2000); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - + Cypress._.times(1, () => { + + //Everyone approves with CP + it('Everyone approves with CP', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('15-11-2035'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft Corp'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is developed in a decentralized and collaborative way'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('JPY'); + cy.get('#root_item_0_unit_price').type('2416'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('INR'); + cy.get('#root_item_1_unit_price').type('4500'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('Open source software is developed in a decentralized and collaborative way, relying on peer review and community production. Open source software is often cheaper more flexible. \nhttps://www.redhat.com/en'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['sampletext.txt']); + + cy.wait(2000); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); }); + + //Everyone approves the request + it('Everyone approves', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Stware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('30-11-2024'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('ORACLE LTD'); + cy.get('#root_payment_method').select('Bank Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('A bounty is a payment or reward of money to locate'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('SGD'); + cy.get('#root_item_0_unit_price').type('2416'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('Open source software is developed in a decentralized and collaborative way, relying on peer review and community production. Open source software is often cheaper more flexible. \nhttps://www.redhat.com/en'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['png-5mb-2.png']); + + cy.wait(2000); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + 'Task: Update Application Landscape', + "approve" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); + }); + + //Budget owner rejects the request + it('Budget owner rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Stware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('Medium'); + cy.get('#root_period').clear().type('24-12-2023'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Subscription PVT'); + cy.get('#root_payment_method').select('Bank Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('Software development consultants with Python background'); + cy.get('#root_item_0_qty').clear().type('5'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('EUR'); + cy.get('#root_item_0_unit_price').type('250'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('Open source software is developed in a decentralized and collaborative way, relying on peer review and community production. Open source software is often cheaper more flexible. \nhttps://www.redhat.com/en'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['png-5mb-2.png']); + + cy.wait(2000); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + //Budget owner request for additional details + it('Budget owner need more info', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Stware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('Low'); + cy.get('#root_period').clear().type('25-02-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('LIC INST'); + cy.get('#root_payment_method').select('Crypto Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('Freelancers to do the Python development and front end react app development'); + cy.get('#root_item_0_qty').clear().type('4'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('450'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, all software is copyright protected.'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['png-5mb-2.png']); + + cy.wait(2000); + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "needmoreinfo" + ); + + //requestor sending additional info + submitWithUser( + username, + password, + processInstanceId, + null, + "providemoreinfo" + ); + + //budget owner approves second time + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + + + }); + }); + + //Infra rejects the request + it('Infra Rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Proprietary licenses are often referred to as closed source. They provide customers with operational code. Users cannot freely alter this software. These licenses also usually restrict reverse engineering the software\'s code to obtain the source code'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Red HAT'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('They provide customers with operational code. Users cannot freely alter this software.'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('STN'); + cy.get('#root_item_0_unit_price').type('2416'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['png-5mb-2.png']); + + cy.wait(2000); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + }); }); //Software and Licenses Path - With Files and Multiple items describe('Software and Licenses Path - With Files and Multiple items', () => { - Cypress._.times(1, () => { - - //Everyone approves with CP - it('Everyone approves with CP', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Meta Corp'); - cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - - //item 0 - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); - cy.get('#root_item_0_qty').clear().type('1'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('AUD'); - cy.get('#root_item_0_unit_price').type('2416'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 1 - cy.get('#root_item_1_sub_category').select('lic_and_sub'); - cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides binding guidelines for the use and distribution.'); - cy.get('#root_item_1_qty').clear().type('5'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('EUR'); - cy.get('#root_item_1_unit_price').type('250'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 2 - cy.get('#root_item_2_sub_category').select('lic_and_sub'); - cy.get('#root_item_2_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); - cy.get('#root_item_2_qty').clear().type('10'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('DAI'); - cy.get('#root_item_2_unit_price').type('12500'); - - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, all software is copyright protected.'); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['sampletext.txt']); - - cy.wait(2000); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Everyone approves the request - it('Everyone approves', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Apple'); - cy.get('#root_payment_method').select('Crypto Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - //item 0 - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('AED'); - cy.get('#root_item_0_unit_price').type('1250'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 1 - cy.get('#root_item_1_sub_category').select('lic_and_sub'); - cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides binding guidelines for the use and distribution.'); - cy.get('#root_item_1_qty').clear().type('5'); - cy.get('#root_item_1_currency_type').select('Crypto'); - cy.get('#root_item_1_currency').select('SNT'); - cy.get('#root_item_1_unit_price').type('25000'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 2 - cy.get('#root_item_2_sub_category').select('lic_and_sub'); - cy.get('#root_item_2_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); - cy.get('#root_item_2_qty').clear().type('3'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('ETH'); - cy.get('#root_item_2_unit_price').type('2.10'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, \nhttps://en.wikipedia.org/wiki/Software_license'); - - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['png-5mb-2.png']); - - cy.wait(2000); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - 'Task: Update Application Landscape', - "approve" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Budget owner rejects the request - it('Budget owner rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('24-02-2026'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Subscription PVT'); - cy.get('#root_payment_method').select('Bank Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - - //item 0 - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); - cy.get('#root_item_0_qty').clear().type('5'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('USD'); - cy.get('#root_item_0_unit_price').type('250.50'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 1 - cy.get('#root_item_1_sub_category').select('lic_and_sub'); - cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides binding guidelines for the use and distribution.'); - cy.get('#root_item_1_qty').clear().type('5'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('GBP'); - cy.get('#root_item_1_unit_price').type('5200'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 2 - cy.get('#root_item_2_sub_category').select('op_src'); - cy.get('#root_item_2_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); - cy.get('#root_item_2_qty').clear().type('3'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('HKD'); - cy.get('#root_item_2_unit_price').type('2100'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, \nhttps://en.wikipedia.org/wiki/Software_license'); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['sampletext.txt']); - - cy.wait(2000); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - //Budget owner request for additional details - it('Budget owner need more info', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('25-02-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('LIC INST'); - cy.get('#root_payment_method').select('Crypto Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - //item 0 - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('A software license is a document that provides binding guidelines for the use and distribution.'); - cy.get('#root_item_0_qty').clear().type('24'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('SNT'); - cy.get('#root_item_0_unit_price').type('450'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 1 - cy.get('#root_item_1_sub_category').select('op_src'); - cy.get('#root_item_1_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); - cy.get('#root_item_1_qty').clear().type('15'); - cy.get('#root_item_1_currency_type').select('Crypto'); - cy.get('#root_item_1_currency').select('ETH'); - cy.get('#root_item_1_unit_price').type('0.85'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 2 - cy.get('#root_item_2_sub_category').select('lic_and_sub'); - cy.get('#root_item_2_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); - cy.get('#root_item_2_qty').clear().type('8'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('DAI'); - cy.get('#root_item_2_unit_price').type('2100'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, \nhttps://en.wikipedia.org/wiki/Software_license'); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['sampletext.txt']); - - cy.wait(2000); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "needmoreinfo" - ); - - //requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - "providemoreinfo" - ); - - //budget owner approves second time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - - - }); - }); - - //Infra rejects the request - it('Infra Rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - //cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('20-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Atlassian'); - cy.get('#root_payment_method').select('Debit Card'); - cy.get('button') - .contains(/^Submit$/) - .click(); - - //item 0 - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('THB'); - cy.get('#root_item_0_unit_price').type('1350'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 1 - cy.get('#root_item_1_sub_category').select('op_src'); - cy.get('#root_item_1_item_name').clear().type('Open source software (OSS) is software that is distributed with its source code'); - cy.get('#root_item_1_qty').clear().type('15'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('TRY'); - cy.get('#root_item_1_unit_price').type('3200'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 2 - cy.get('#root_item_2_sub_category').select('lic_and_sub'); - cy.get('#root_item_2_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); - cy.get('#root_item_2_qty').clear().type('8'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('DAI'); - cy.get('#root_item_2_unit_price').type('2100'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper').find('#root').type('A typical software license grants the licensee, typically an end-user, permission to use one or more copies of software in ways where such a use would otherwise potentially constitute copyright.\nhttps://en.wikipedia.org/wiki/Software_license'); - - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['png-5mb-1.png']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - cy.wait(1000); - - cy.get('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); - - cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); - cy.wait(1000); - - cy.get("input[type=file]") - .attachFile(['png-5mb-2.png']); - - cy.wait(2000); - - //cy.contains('Submit the Request').click(); - - //cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - null, - "reject" - ); - - }); - }); + Cypress._.times(1, () => { + + //Everyone approves with CP + it('Everyone approves with CP', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Meta Corp'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); + cy.get('#root_item_0_qty').clear().type('1'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('AUD'); + cy.get('#root_item_0_unit_price').type('2416'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides binding guidelines for the use and distribution.'); + cy.get('#root_item_1_qty').clear().type('5'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('EUR'); + cy.get('#root_item_1_unit_price').type('250'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 2 + cy.get('#root_item_2_sub_category').select('lic_and_sub'); + cy.get('#root_item_2_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); + cy.get('#root_item_2_qty').clear().type('10'); + cy.get('#root_item_2_currency_type').select('Crypto'); + cy.get('#root_item_2_currency').select('DAI'); + cy.get('#root_item_2_unit_price').type('12500'); + + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, all software is copyright protected.'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['sampletext.txt']); + + cy.wait(2000); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); }); + + //Everyone approves the request + it('Everyone approves', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Apple'); + cy.get('#root_payment_method').select('Crypto Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('AED'); + cy.get('#root_item_0_unit_price').type('1250'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides binding guidelines for the use and distribution.'); + cy.get('#root_item_1_qty').clear().type('5'); + cy.get('#root_item_1_currency_type').select('Crypto'); + cy.get('#root_item_1_currency').select('SNT'); + cy.get('#root_item_1_unit_price').type('25000'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 2 + cy.get('#root_item_2_sub_category').select('lic_and_sub'); + cy.get('#root_item_2_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); + cy.get('#root_item_2_qty').clear().type('3'); + cy.get('#root_item_2_currency_type').select('Crypto'); + cy.get('#root_item_2_currency').select('ETH'); + cy.get('#root_item_2_unit_price').type('2.10'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, \nhttps://en.wikipedia.org/wiki/Software_license'); + + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['png-5mb-2.png']); + + cy.wait(2000); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + 'Task: Update Application Landscape', + "approve" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); + }); + + //Budget owner rejects the request + it('Budget owner rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'); + cy.get('#root_criticality').select('Medium'); + cy.get('#root_period').clear().type('24-02-2026'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Subscription PVT'); + cy.get('#root_payment_method').select('Bank Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + + //item 0 + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); + cy.get('#root_item_0_qty').clear().type('5'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('USD'); + cy.get('#root_item_0_unit_price').type('250.50'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides binding guidelines for the use and distribution.'); + cy.get('#root_item_1_qty').clear().type('5'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('GBP'); + cy.get('#root_item_1_unit_price').type('5200'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 2 + cy.get('#root_item_2_sub_category').select('op_src'); + cy.get('#root_item_2_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); + cy.get('#root_item_2_qty').clear().type('3'); + cy.get('#root_item_2_currency_type').select('Fiat'); + cy.get('#root_item_2_currency').select('HKD'); + cy.get('#root_item_2_unit_price').type('2100'); + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, \nhttps://en.wikipedia.org/wiki/Software_license'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['sampletext.txt']); + + cy.wait(2000); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + //Budget owner request for additional details + it('Budget owner need more info', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'); + cy.get('#root_criticality').select('Low'); + cy.get('#root_period').clear().type('25-02-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('LIC INST'); + cy.get('#root_payment_method').select('Crypto Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('A software license is a document that provides binding guidelines for the use and distribution.'); + cy.get('#root_item_0_qty').clear().type('24'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('450'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('op_src'); + cy.get('#root_item_1_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); + cy.get('#root_item_1_qty').clear().type('15'); + cy.get('#root_item_1_currency_type').select('Crypto'); + cy.get('#root_item_1_currency').select('ETH'); + cy.get('#root_item_1_unit_price').type('0.85'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 2 + cy.get('#root_item_2_sub_category').select('lic_and_sub'); + cy.get('#root_item_2_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); + cy.get('#root_item_2_qty').clear().type('8'); + cy.get('#root_item_2_currency_type').select('Crypto'); + cy.get('#root_item_2_currency').select('DAI'); + cy.get('#root_item_2_unit_price').type('2100'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, \nhttps://en.wikipedia.org/wiki/Software_license'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['sampletext.txt']); + + cy.wait(2000); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "needmoreinfo" + ); + + //requestor sending additional info + submitWithUser( + username, + password, + processInstanceId, + null, + "providemoreinfo" + ); + + //budget owner approves second time + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + + + }); + }); + + //Infra rejects the request + it('Infra Rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + //cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('20-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Atlassian'); + cy.get('#root_payment_method').select('Debit Card'); + cy.get('button') + .contains(/^Submit$/) + .click(); + + //item 0 + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('THB'); + cy.get('#root_item_0_unit_price').type('1350'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('op_src'); + cy.get('#root_item_1_item_name').clear().type('Open source software (OSS) is software that is distributed with its source code'); + cy.get('#root_item_1_qty').clear().type('15'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('TRY'); + cy.get('#root_item_1_unit_price').type('3200'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 2 + cy.get('#root_item_2_sub_category').select('lic_and_sub'); + cy.get('#root_item_2_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); + cy.get('#root_item_2_qty').clear().type('8'); + cy.get('#root_item_2_currency_type').select('Crypto'); + cy.get('#root_item_2_currency').select('DAI'); + cy.get('#root_item_2_unit_price').type('2100'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('A typical software license grants the licensee, typically an end-user, permission to use one or more copies of software in ways where such a use would otherwise potentially constitute copyright.\nhttps://en.wikipedia.org/wiki/Software_license'); + + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['png-5mb-2.png']); + + cy.wait(2000); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + }); }); diff --git a/spiffworkflow-frontend/cypress/support/commands.js b/spiffworkflow-frontend/cypress/support/commands.js index 96855024..80383593 100644 --- a/spiffworkflow-frontend/cypress/support/commands.js +++ b/spiffworkflow-frontend/cypress/support/commands.js @@ -63,6 +63,7 @@ Cypress.Commands.add('login', (username, password) => { Cypress.Commands.add('logout', (_selector, ..._args) => { cy.get('#user-profile-toggletip').click(); + cy.wait(2000); cy.getBySel('logout-button').click(); if (Cypress.env('SPIFFWORKFLOW_FRONTEND_AUTH_WITH_KEYCLOAK') === true) { // otherwise we can click logout, quickly load the next page, and the javascript From da52b68c84f253b38d6bd15cdf0ef3e37f3b2443 Mon Sep 17 00:00:00 2001 From: jasquat Date: Wed, 10 May 2023 16:39:03 -0400 Subject: [PATCH 2/3] updated Spiffworkflow and updated terminated test to ensure tasks are deleted from the db w/ burnettk --- poetry.lock | 1000 ++++++++--------- spiffworkflow-backend/poetry.lock | 206 +--- .../services/process_instance_processor.py | 12 + .../services/task_service.py | 6 +- .../integration/test_process_api.py | 14 +- 5 files changed, 528 insertions(+), 710 deletions(-) diff --git a/poetry.lock b/poetry.lock index a63cec16..91d84471 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. + [[package]] name = "attrs" version = "22.2.0" @@ -5,6 +7,10 @@ description = "Classes Without Boilerplate" category = "dev" optional = false python-versions = ">=3.6" +files = [ + {file = "attrs-22.2.0-py3-none-any.whl", hash = "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836"}, + {file = "attrs-22.2.0.tar.gz", hash = "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"}, +] [package.extras] cov = ["attrs[tests]", "coverage-enable-subprocess", "coverage[toml] (>=5.3)"] @@ -20,6 +26,10 @@ description = "Security oriented static analyser for python code." category = "dev" optional = false python-versions = ">=3.7" +files = [ + {file = "bandit-1.7.2-py3-none-any.whl", hash = "sha256:e20402cadfd126d85b68ed4c8862959663c8c372dbbb1fca8f8e2c9f55a067ec"}, + {file = "bandit-1.7.2.tar.gz", hash = "sha256:6d11adea0214a43813887bfe71a377b5a9955e4c826c8ffd341b494e3ab25260"}, +] [package.dependencies] colorama = {version = ">=0.3.9", markers = "platform_system == \"Windows\""} @@ -39,465 +49,7 @@ description = "The uncompromising code formatter." category = "dev" optional = false python-versions = ">=3.7" - -[package.dependencies] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -packaging = ">=22.0" -pathspec = ">=0.9.0" -platformdirs = ">=2" - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] - -[[package]] -name = "cfgv" -version = "3.3.1" -description = "Validate configuration and produce human readable error messages." -category = "dev" -optional = false -python-versions = ">=3.6.1" - -[[package]] -name = "classify-imports" -version = "4.2.0" -description = "Utilities for refactoring imports in python-like syntax." -category = "dev" -optional = false -python-versions = ">=3.7" - -[[package]] -name = "click" -version = "8.1.3" -description = "Composable command line interface toolkit" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -category = "dev" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" - -[[package]] -name = "distlib" -version = "0.3.6" -description = "Distribution utilities" -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "docutils" -version = "0.19" -description = "Docutils -- Python Documentation Utilities" -category = "dev" -optional = false -python-versions = ">=3.7" - -[[package]] -name = "filelock" -version = "3.10.7" -description = "A platform independent file lock." -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -docs = ["furo (>=2022.12.7)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.2.2)", "diff-cover (>=7.5)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] - -[[package]] -name = "flake8" -version = "4.0.1" -description = "the modular source code checker: pep8 pyflakes and co" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -mccabe = ">=0.6.0,<0.7.0" -pycodestyle = ">=2.8.0,<2.9.0" -pyflakes = ">=2.4.0,<2.5.0" - -[[package]] -name = "flake8-bandit" -version = "2.1.2" -description = "Automated security testing with bandit and flake8." -category = "dev" -optional = false -python-versions = "*" - -[package.dependencies] -bandit = "*" -flake8 = "*" -flake8-polyfill = "*" -pycodestyle = "*" - -[[package]] -name = "flake8-bugbear" -version = "22.12.6" -description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -attrs = ">=19.2.0" -flake8 = ">=3.0.0" - -[package.extras] -dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit", "tox"] - -[[package]] -name = "flake8-docstrings" -version = "1.7.0" -description = "Extension for flake8 which uses pydocstyle to check docstrings" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -flake8 = ">=3" -pydocstyle = ">=2.1" - -[[package]] -name = "flake8-polyfill" -version = "1.0.2" -description = "Polyfill package for Flake8 plugins" -category = "dev" -optional = false -python-versions = "*" - -[package.dependencies] -flake8 = "*" - -[[package]] -name = "flake8-rst-docstrings" -version = "0.2.7" -description = "Python docstring reStructuredText (RST) validator" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -flake8 = ">=3.0.0" -pygments = "*" -restructuredtext-lint = "*" - -[[package]] -name = "gitdb" -version = "4.0.10" -description = "Git Object Database" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -smmap = ">=3.0.1,<6" - -[[package]] -name = "gitpython" -version = "3.1.31" -description = "GitPython is a Python library used to interact with Git repositories" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -gitdb = ">=4.0.1,<5" - -[[package]] -name = "identify" -version = "2.5.22" -description = "File identification library for Python" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -license = ["ukkonen"] - -[[package]] -name = "mccabe" -version = "0.6.1" -description = "McCabe checker, plugin for flake8" -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "mypy-extensions" -version = "1.0.0" -description = "Type system extensions for programs checked with the mypy type checker." -category = "dev" -optional = false -python-versions = ">=3.5" - -[[package]] -name = "nodeenv" -version = "1.7.0" -description = "Node.js virtual environment builder" -category = "dev" -optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" - -[package.dependencies] -setuptools = "*" - -[[package]] -name = "packaging" -version = "23.0" -description = "Core utilities for Python packages" -category = "dev" -optional = false -python-versions = ">=3.7" - -[[package]] -name = "pathspec" -version = "0.11.1" -description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" -optional = false -python-versions = ">=3.7" - -[[package]] -name = "pbr" -version = "5.11.1" -description = "Python Build Reasonableness" -category = "dev" -optional = false -python-versions = ">=2.6" - -[[package]] -name = "platformdirs" -version = "3.2.0" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] - -[[package]] -name = "pre-commit" -version = "2.21.0" -description = "A framework for managing and maintaining multi-language pre-commit hooks." -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -cfgv = ">=2.0.0" -identify = ">=1.0.0" -nodeenv = ">=0.11.1" -pyyaml = ">=5.1" -virtualenv = ">=20.10.0" - -[[package]] -name = "pre-commit-hooks" -version = "4.4.0" -description = "Some out-of-the-box hooks for pre-commit." -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -"ruamel.yaml" = ">=0.15" - -[[package]] -name = "pycodestyle" -version = "2.8.0" -description = "Python style guide checker" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[[package]] -name = "pydocstyle" -version = "6.3.0" -description = "Python docstring style checker" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -snowballstemmer = ">=2.2.0" - -[package.extras] -toml = ["tomli (>=1.2.3)"] - -[[package]] -name = "pyflakes" -version = "2.4.0" -description = "passive checker of Python programs" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[[package]] -name = "pygments" -version = "2.14.0" -description = "Pygments is a syntax highlighting package written in Python." -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.extras] -plugins = ["importlib-metadata"] - -[[package]] -name = "pyupgrade" -version = "3.3.1" -description = "A tool to automatically upgrade syntax for newer versions." -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -tokenize-rt = ">=3.2.0" - -[[package]] -name = "pyyaml" -version = "6.0" -description = "YAML parser and emitter for Python" -category = "dev" -optional = false -python-versions = ">=3.6" - -[[package]] -name = "reorder-python-imports" -version = "3.9.0" -description = "Tool for reordering python imports" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -classify-imports = ">=4.1" - -[[package]] -name = "restructuredtext-lint" -version = "1.4.0" -description = "reStructuredText linter" -category = "dev" -optional = false -python-versions = "*" - -[package.dependencies] -docutils = ">=0.11,<1.0" - -[[package]] -name = "ruamel-yaml" -version = "0.17.21" -description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" -category = "dev" -optional = false -python-versions = ">=3" - -[package.extras] -docs = ["ryd"] -jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] - -[[package]] -name = "setuptools" -version = "67.6.1" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - -[[package]] -name = "smmap" -version = "5.0.0" -description = "A pure Python implementation of a sliding window memory map manager" -category = "dev" -optional = false -python-versions = ">=3.6" - -[[package]] -name = "snowballstemmer" -version = "2.2.0" -description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "stevedore" -version = "5.0.0" -description = "Manage dynamic plugins for Python applications" -category = "dev" -optional = false -python-versions = ">=3.8" - -[package.dependencies] -pbr = ">=2.0.0,<2.1.0 || >2.1.0" - -[[package]] -name = "tokenize-rt" -version = "5.0.0" -description = "A wrapper around the stdlib `tokenize` which roundtrips." -category = "dev" -optional = false -python-versions = ">=3.7" - -[[package]] -name = "tomli" -version = "2.0.1" -description = "A lil' TOML parser" -category = "dev" -optional = false -python-versions = ">=3.7" - -[[package]] -name = "virtualenv" -version = "20.21.0" -description = "Virtual Python Environment builder" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -distlib = ">=0.3.6,<1" -filelock = ">=3.4.1,<4" -platformdirs = ">=2.4,<4" - -[package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=22.12)"] -test = ["covdefaults (>=2.2.2)", "coverage (>=7.1)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23)", "pytest (>=7.2.1)", "pytest-env (>=0.8.1)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.10)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)"] - -[metadata] -lock-version = "1.1" -python-versions = ">=3.11,<3.12" -content-hash = "b47d05a3bedc167232bba9ab07c2c770574018e949d7eb87c65a95a2df84d76b" - -[metadata.files] -attrs = [ - {file = "attrs-22.2.0-py3-none-any.whl", hash = "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836"}, - {file = "attrs-22.2.0.tar.gz", hash = "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"}, -] -bandit = [ - {file = "bandit-1.7.2-py3-none-any.whl", hash = "sha256:e20402cadfd126d85b68ed4c8862959663c8c372dbbb1fca8f8e2c9f55a067ec"}, - {file = "bandit-1.7.2.tar.gz", hash = "sha256:6d11adea0214a43813887bfe71a377b5a9955e4c826c8ffd341b494e3ab25260"}, -] -black = [ +files = [ {file = "black-23.1.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:b6a92a41ee34b883b359998f0c8e6eb8e99803aa8bf3123bf2b2e6fec505a221"}, {file = "black-23.1.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:57c18c5165c1dbe291d5306e53fb3988122890e57bd9b3dcb75f967f13411a26"}, {file = "black-23.1.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:9880d7d419bb7e709b37e28deb5e68a49227713b623c72b2b931028ea65f619b"}, @@ -524,126 +76,462 @@ black = [ {file = "black-23.1.0-py3-none-any.whl", hash = "sha256:7a0f701d314cfa0896b9001df70a530eb2472babb76086344e688829efd97d32"}, {file = "black-23.1.0.tar.gz", hash = "sha256:b0bd97bea8903f5a2ba7219257a44e3f1f9d00073d6cc1add68f0beec69692ac"}, ] -cfgv = [ + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +packaging = ">=22.0" +pathspec = ">=0.9.0" +platformdirs = ">=2" + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.7.4)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + +[[package]] +name = "cfgv" +version = "3.3.1" +description = "Validate configuration and produce human readable error messages." +category = "dev" +optional = false +python-versions = ">=3.6.1" +files = [ {file = "cfgv-3.3.1-py2.py3-none-any.whl", hash = "sha256:c6a0883f3917a037485059700b9e75da2464e6c27051014ad85ba6aaa5884426"}, {file = "cfgv-3.3.1.tar.gz", hash = "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736"}, ] -classify-imports = [ + +[[package]] +name = "classify-imports" +version = "4.2.0" +description = "Utilities for refactoring imports in python-like syntax." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "classify_imports-4.2.0-py2.py3-none-any.whl", hash = "sha256:dbbc264b70a470ed8c6c95976a11dfb8b7f63df44ed1af87328bbed2663f5161"}, {file = "classify_imports-4.2.0.tar.gz", hash = "sha256:7abfb7ea92149b29d046bd34573d247ba6e68cc28100c801eba4af17964fc40e"}, ] -click = [ + +[[package]] +name = "click" +version = "8.1.3" +description = "Composable command line interface toolkit" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, ] -colorama = [ + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +category = "dev" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] -distlib = [ + +[[package]] +name = "distlib" +version = "0.3.6" +description = "Distribution utilities" +category = "dev" +optional = false +python-versions = "*" +files = [ {file = "distlib-0.3.6-py2.py3-none-any.whl", hash = "sha256:f35c4b692542ca110de7ef0bea44d73981caeb34ca0b9b6b2e6d7790dda8f80e"}, {file = "distlib-0.3.6.tar.gz", hash = "sha256:14bad2d9b04d3a36127ac97f30b12a19268f211063d8f8ee4f47108896e11b46"}, ] -docutils = [ + +[[package]] +name = "docutils" +version = "0.19" +description = "Docutils -- Python Documentation Utilities" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "docutils-0.19-py3-none-any.whl", hash = "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc"}, {file = "docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"}, ] -filelock = [ + +[[package]] +name = "filelock" +version = "3.10.7" +description = "A platform independent file lock." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "filelock-3.10.7-py3-none-any.whl", hash = "sha256:bde48477b15fde2c7e5a0713cbe72721cb5a5ad32ee0b8f419907960b9d75536"}, {file = "filelock-3.10.7.tar.gz", hash = "sha256:892be14aa8efc01673b5ed6589dbccb95f9a8596f0507e232626155495c18105"}, ] -flake8 = [ + +[package.extras] +docs = ["furo (>=2022.12.7)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.2.2)", "diff-cover (>=7.5)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] + +[[package]] +name = "flake8" +version = "4.0.1" +description = "the modular source code checker: pep8 pyflakes and co" +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ {file = "flake8-4.0.1-py2.py3-none-any.whl", hash = "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d"}, {file = "flake8-4.0.1.tar.gz", hash = "sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d"}, ] -flake8-bandit = [ + +[package.dependencies] +mccabe = ">=0.6.0,<0.7.0" +pycodestyle = ">=2.8.0,<2.9.0" +pyflakes = ">=2.4.0,<2.5.0" + +[[package]] +name = "flake8-bandit" +version = "2.1.2" +description = "Automated security testing with bandit and flake8." +category = "dev" +optional = false +python-versions = "*" +files = [ {file = "flake8_bandit-2.1.2.tar.gz", hash = "sha256:687fc8da2e4a239b206af2e54a90093572a60d0954f3054e23690739b0b0de3b"}, ] -flake8-bugbear = [ + +[package.dependencies] +bandit = "*" +flake8 = "*" +flake8-polyfill = "*" +pycodestyle = "*" + +[[package]] +name = "flake8-bugbear" +version = "22.12.6" +description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "flake8-bugbear-22.12.6.tar.gz", hash = "sha256:4cdb2c06e229971104443ae293e75e64c6107798229202fbe4f4091427a30ac0"}, {file = "flake8_bugbear-22.12.6-py3-none-any.whl", hash = "sha256:b69a510634f8a9c298dfda2b18a8036455e6b19ecac4fe582e4d7a0abfa50a30"}, ] -flake8-docstrings = [ + +[package.dependencies] +attrs = ">=19.2.0" +flake8 = ">=3.0.0" + +[package.extras] +dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit", "tox"] + +[[package]] +name = "flake8-docstrings" +version = "1.7.0" +description = "Extension for flake8 which uses pydocstyle to check docstrings" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "flake8_docstrings-1.7.0-py2.py3-none-any.whl", hash = "sha256:51f2344026da083fc084166a9353f5082b01f72901df422f74b4d953ae88ac75"}, {file = "flake8_docstrings-1.7.0.tar.gz", hash = "sha256:4c8cc748dc16e6869728699e5d0d685da9a10b0ea718e090b1ba088e67a941af"}, ] -flake8-polyfill = [ + +[package.dependencies] +flake8 = ">=3" +pydocstyle = ">=2.1" + +[[package]] +name = "flake8-polyfill" +version = "1.0.2" +description = "Polyfill package for Flake8 plugins" +category = "dev" +optional = false +python-versions = "*" +files = [ {file = "flake8-polyfill-1.0.2.tar.gz", hash = "sha256:e44b087597f6da52ec6393a709e7108b2905317d0c0b744cdca6208e670d8eda"}, {file = "flake8_polyfill-1.0.2-py2.py3-none-any.whl", hash = "sha256:12be6a34ee3ab795b19ca73505e7b55826d5f6ad7230d31b18e106400169b9e9"}, ] -flake8-rst-docstrings = [ + +[package.dependencies] +flake8 = "*" + +[[package]] +name = "flake8-rst-docstrings" +version = "0.2.7" +description = "Python docstring reStructuredText (RST) validator" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "flake8-rst-docstrings-0.2.7.tar.gz", hash = "sha256:2740067ab9237559dd45a3434d8c987792c7b259ca563621a3b95efe201f5382"}, {file = "flake8_rst_docstrings-0.2.7-py3-none-any.whl", hash = "sha256:5d56075dce360bcc9c6775bfe7cb431aa395de600ca7e8d40580a28d50b2a803"}, ] -gitdb = [ + +[package.dependencies] +flake8 = ">=3.0.0" +pygments = "*" +restructuredtext-lint = "*" + +[[package]] +name = "gitdb" +version = "4.0.10" +description = "Git Object Database" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "gitdb-4.0.10-py3-none-any.whl", hash = "sha256:c286cf298426064079ed96a9e4a9d39e7f3e9bf15ba60701e95f5492f28415c7"}, {file = "gitdb-4.0.10.tar.gz", hash = "sha256:6eb990b69df4e15bad899ea868dc46572c3f75339735663b81de79b06f17eb9a"}, ] -gitpython = [ + +[package.dependencies] +smmap = ">=3.0.1,<6" + +[[package]] +name = "gitpython" +version = "3.1.31" +description = "GitPython is a Python library used to interact with Git repositories" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "GitPython-3.1.31-py3-none-any.whl", hash = "sha256:f04893614f6aa713a60cbbe1e6a97403ef633103cdd0ef5eb6efe0deb98dbe8d"}, {file = "GitPython-3.1.31.tar.gz", hash = "sha256:8ce3bcf69adfdf7c7d503e78fd3b1c492af782d58893b650adb2ac8912ddd573"}, ] -identify = [ + +[package.dependencies] +gitdb = ">=4.0.1,<5" + +[[package]] +name = "identify" +version = "2.5.22" +description = "File identification library for Python" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "identify-2.5.22-py2.py3-none-any.whl", hash = "sha256:f0faad595a4687053669c112004178149f6c326db71ee999ae4636685753ad2f"}, {file = "identify-2.5.22.tar.gz", hash = "sha256:f7a93d6cf98e29bd07663c60728e7a4057615068d7a639d132dc883b2d54d31e"}, ] -mccabe = [ + +[package.extras] +license = ["ukkonen"] + +[[package]] +name = "mccabe" +version = "0.6.1" +description = "McCabe checker, plugin for flake8" +category = "dev" +optional = false +python-versions = "*" +files = [ {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, ] -mypy-extensions = [ + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +category = "dev" +optional = false +python-versions = ">=3.5" +files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, ] -nodeenv = [ + +[[package]] +name = "nodeenv" +version = "1.7.0" +description = "Node.js virtual environment builder" +category = "dev" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" +files = [ {file = "nodeenv-1.7.0-py2.py3-none-any.whl", hash = "sha256:27083a7b96a25f2f5e1d8cb4b6317ee8aeda3bdd121394e5ac54e498028a042e"}, {file = "nodeenv-1.7.0.tar.gz", hash = "sha256:e0e7f7dfb85fc5394c6fe1e8fa98131a2473e04311a45afb6508f7cf1836fa2b"}, ] -packaging = [ + +[package.dependencies] +setuptools = "*" + +[[package]] +name = "packaging" +version = "23.0" +description = "Core utilities for Python packages" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "packaging-23.0-py3-none-any.whl", hash = "sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2"}, {file = "packaging-23.0.tar.gz", hash = "sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97"}, ] -pathspec = [ + +[[package]] +name = "pathspec" +version = "0.11.1" +description = "Utility library for gitignore style pattern matching of file paths." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "pathspec-0.11.1-py3-none-any.whl", hash = "sha256:d8af70af76652554bd134c22b3e8a1cc46ed7d91edcdd721ef1a0c51a84a5293"}, {file = "pathspec-0.11.1.tar.gz", hash = "sha256:2798de800fa92780e33acca925945e9a19a133b715067cf165b8866c15a31687"}, ] -pbr = [ + +[[package]] +name = "pbr" +version = "5.11.1" +description = "Python Build Reasonableness" +category = "dev" +optional = false +python-versions = ">=2.6" +files = [ {file = "pbr-5.11.1-py2.py3-none-any.whl", hash = "sha256:567f09558bae2b3ab53cb3c1e2e33e726ff3338e7bae3db5dc954b3a44eef12b"}, {file = "pbr-5.11.1.tar.gz", hash = "sha256:aefc51675b0b533d56bb5fd1c8c6c0522fe31896679882e1c4c63d5e4a0fccb3"}, ] -platformdirs = [ + +[[package]] +name = "platformdirs" +version = "3.2.0" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "platformdirs-3.2.0-py3-none-any.whl", hash = "sha256:ebe11c0d7a805086e99506aa331612429a72ca7cd52a1f0d277dc4adc20cb10e"}, {file = "platformdirs-3.2.0.tar.gz", hash = "sha256:d5b638ca397f25f979350ff789db335903d7ea010ab28903f57b27e1b16c2b08"}, ] -pre-commit = [ + +[package.extras] +docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] + +[[package]] +name = "pre-commit" +version = "2.21.0" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "pre_commit-2.21.0-py2.py3-none-any.whl", hash = "sha256:e2f91727039fc39a92f58a588a25b87f936de6567eed4f0e673e0507edc75bad"}, {file = "pre_commit-2.21.0.tar.gz", hash = "sha256:31ef31af7e474a8d8995027fefdfcf509b5c913ff31f2015b4ec4beb26a6f658"}, ] -pre-commit-hooks = [ + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +virtualenv = ">=20.10.0" + +[[package]] +name = "pre-commit-hooks" +version = "4.4.0" +description = "Some out-of-the-box hooks for pre-commit." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "pre_commit_hooks-4.4.0-py2.py3-none-any.whl", hash = "sha256:fc8837335476221ccccda3d176ed6ae29fe58753ce7e8b7863f5d0f987328fc6"}, {file = "pre_commit_hooks-4.4.0.tar.gz", hash = "sha256:7011eed8e1a25cde94693da009cba76392194cecc2f3f06c51a44ea6ad6c2af9"}, ] -pycodestyle = [ + +[package.dependencies] +"ruamel.yaml" = ">=0.15" + +[[package]] +name = "pycodestyle" +version = "2.8.0" +description = "Python style guide checker" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ {file = "pycodestyle-2.8.0-py2.py3-none-any.whl", hash = "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20"}, {file = "pycodestyle-2.8.0.tar.gz", hash = "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"}, ] -pydocstyle = [ + +[[package]] +name = "pydocstyle" +version = "6.3.0" +description = "Python docstring style checker" +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ {file = "pydocstyle-6.3.0-py3-none-any.whl", hash = "sha256:118762d452a49d6b05e194ef344a55822987a462831ade91ec5c06fd2169d019"}, {file = "pydocstyle-6.3.0.tar.gz", hash = "sha256:7ce43f0c0ac87b07494eb9c0b462c0b73e6ff276807f204d6b53edc72b7e44e1"}, ] -pyflakes = [ + +[package.dependencies] +snowballstemmer = ">=2.2.0" + +[package.extras] +toml = ["tomli (>=1.2.3)"] + +[[package]] +name = "pyflakes" +version = "2.4.0" +description = "passive checker of Python programs" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ {file = "pyflakes-2.4.0-py2.py3-none-any.whl", hash = "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"}, {file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"}, ] -pygments = [ + +[[package]] +name = "pygments" +version = "2.14.0" +description = "Pygments is a syntax highlighting package written in Python." +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ {file = "Pygments-2.14.0-py3-none-any.whl", hash = "sha256:fa7bd7bd2771287c0de303af8bfdfc731f51bd2c6a47ab69d117138893b82717"}, {file = "Pygments-2.14.0.tar.gz", hash = "sha256:b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297"}, ] -pyupgrade = [ + +[package.extras] +plugins = ["importlib-metadata"] + +[[package]] +name = "pyupgrade" +version = "3.3.1" +description = "A tool to automatically upgrade syntax for newer versions." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "pyupgrade-3.3.1-py2.py3-none-any.whl", hash = "sha256:3b93641963df022d605c78aeae4b5956a5296ea24701eafaef9c487527b77e60"}, {file = "pyupgrade-3.3.1.tar.gz", hash = "sha256:f88bce38b0ba92c2a9a5063c8629e456e8d919b67d2d42c7ecab82ff196f9813"}, ] -pyyaml = [ + +[package.dependencies] +tokenize-rt = ">=3.2.0" + +[[package]] +name = "pyyaml" +version = "6.0" +description = "YAML parser and emitter for Python" +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, @@ -685,42 +573,154 @@ pyyaml = [ {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, ] -reorder-python-imports = [ + +[[package]] +name = "reorder-python-imports" +version = "3.9.0" +description = "Tool for reordering python imports" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "reorder_python_imports-3.9.0-py2.py3-none-any.whl", hash = "sha256:3f9c16e8781f54c944756d0d1eb34a8c863554f7a4eb3693f574fe19b1a29b56"}, {file = "reorder_python_imports-3.9.0.tar.gz", hash = "sha256:49292ed537829a6bece9fb3746fc1bbe98f52643be5de01a4e13680268a5b0ec"}, ] -restructuredtext-lint = [ + +[package.dependencies] +classify-imports = ">=4.1" + +[[package]] +name = "restructuredtext-lint" +version = "1.4.0" +description = "reStructuredText linter" +category = "dev" +optional = false +python-versions = "*" +files = [ {file = "restructuredtext_lint-1.4.0.tar.gz", hash = "sha256:1b235c0c922341ab6c530390892eb9e92f90b9b75046063e047cacfb0f050c45"}, ] -ruamel-yaml = [ + +[package.dependencies] +docutils = ">=0.11,<1.0" + +[[package]] +name = "ruamel-yaml" +version = "0.17.21" +description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" +category = "dev" +optional = false +python-versions = ">=3" +files = [ {file = "ruamel.yaml-0.17.21-py3-none-any.whl", hash = "sha256:742b35d3d665023981bd6d16b3d24248ce5df75fdb4e2924e93a05c1f8b61ca7"}, {file = "ruamel.yaml-0.17.21.tar.gz", hash = "sha256:8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af"}, ] -setuptools = [ + +[package.extras] +docs = ["ryd"] +jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] + +[[package]] +name = "setuptools" +version = "67.6.1" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "setuptools-67.6.1-py3-none-any.whl", hash = "sha256:e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078"}, {file = "setuptools-67.6.1.tar.gz", hash = "sha256:257de92a9d50a60b8e22abfcbb771571fde0dbf3ec234463212027a4eeecbe9a"}, ] -smmap = [ + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] + +[[package]] +name = "smmap" +version = "5.0.0" +description = "A pure Python implementation of a sliding window memory map manager" +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ {file = "smmap-5.0.0-py3-none-any.whl", hash = "sha256:2aba19d6a040e78d8b09de5c57e96207b09ed71d8e55ce0959eeee6c8e190d94"}, {file = "smmap-5.0.0.tar.gz", hash = "sha256:c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936"}, ] -snowballstemmer = [ + +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +category = "dev" +optional = false +python-versions = "*" +files = [ {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, ] -stevedore = [ + +[[package]] +name = "stevedore" +version = "5.0.0" +description = "Manage dynamic plugins for Python applications" +category = "dev" +optional = false +python-versions = ">=3.8" +files = [ {file = "stevedore-5.0.0-py3-none-any.whl", hash = "sha256:bd5a71ff5e5e5f5ea983880e4a1dd1bb47f8feebbb3d95b592398e2f02194771"}, {file = "stevedore-5.0.0.tar.gz", hash = "sha256:2c428d2338976279e8eb2196f7a94910960d9f7ba2f41f3988511e95ca447021"}, ] -tokenize-rt = [ + +[package.dependencies] +pbr = ">=2.0.0,<2.1.0 || >2.1.0" + +[[package]] +name = "tokenize-rt" +version = "5.0.0" +description = "A wrapper around the stdlib `tokenize` which roundtrips." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "tokenize_rt-5.0.0-py2.py3-none-any.whl", hash = "sha256:c67772c662c6b3dc65edf66808577968fb10badfc2042e3027196bed4daf9e5a"}, {file = "tokenize_rt-5.0.0.tar.gz", hash = "sha256:3160bc0c3e8491312d0485171dea861fc160a240f5f5766b72a1165408d10740"}, ] -tomli = [ + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -virtualenv = [ + +[[package]] +name = "virtualenv" +version = "20.21.0" +description = "Virtual Python Environment builder" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ {file = "virtualenv-20.21.0-py3-none-any.whl", hash = "sha256:31712f8f2a17bd06234fa97fdf19609e789dd4e3e4bf108c3da71d710651adbc"}, {file = "virtualenv-20.21.0.tar.gz", hash = "sha256:f50e3e60f990a0757c9b68333c9fdaa72d7188caa417f96af9e52407831a3b68"}, ] + +[package.dependencies] +distlib = ">=0.3.6,<1" +filelock = ">=3.4.1,<4" +platformdirs = ">=2.4,<4" + +[package.extras] +docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=22.12)"] +test = ["covdefaults (>=2.2.2)", "coverage (>=7.1)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23)", "pytest (>=7.2.1)", "pytest-env (>=0.8.1)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.10)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)"] + +[metadata] +lock-version = "2.0" +python-versions = ">=3.11,<3.12" +content-hash = "b47d05a3bedc167232bba9ab07c2c770574018e949d7eb87c65a95a2df84d76b" diff --git a/spiffworkflow-backend/poetry.lock b/spiffworkflow-backend/poetry.lock index 7fc9d6b3..b7c9d95d 100644 --- a/spiffworkflow-backend/poetry.lock +++ b/spiffworkflow-backend/poetry.lock @@ -32,21 +32,6 @@ typing-extensions = ">=4" [package.extras] tz = ["python-dateutil"] -[[package]] -name = "amqp" -version = "5.1.1" -description = "Low-level AMQP client for Python (fork of amqplib)." -category = "main" -optional = false -python-versions = ">=3.6" -files = [ - {file = "amqp-5.1.1-py3-none-any.whl", hash = "sha256:6f0956d2c23d8fa6e7691934d8c3930eadb44972cbbd1a7ae3a520f735d43359"}, - {file = "amqp-5.1.1.tar.gz", hash = "sha256:2c1b13fecc0893e946c65cbd5f36427861cffa4ea2201d8f6fca22e2a373b5e2"}, -] - -[package.dependencies] -vine = ">=5.0.0" - [[package]] name = "aniso8601" version = "9.0.1" @@ -220,18 +205,6 @@ soupsieve = ">1.2" html5lib = ["html5lib"] lxml = ["lxml"] -[[package]] -name = "billiard" -version = "3.6.4.0" -description = "Python multiprocessing fork with improvements and bugfixes" -category = "main" -optional = false -python-versions = "*" -files = [ - {file = "billiard-3.6.4.0-py3-none-any.whl", hash = "sha256:87103ea78fa6ab4d5c751c4909bcff74617d985de7fa8b672cf8618afd5a875b"}, - {file = "billiard-3.6.4.0.tar.gz", hash = "sha256:299de5a8da28a783d51b197d496bef4f1595dd023a93a4f59dde1886ae905547"}, -] - [[package]] name = "black" version = "22.12.0" @@ -283,61 +256,6 @@ files = [ [package.dependencies] typing-extensions = "*" -[[package]] -name = "celery" -version = "5.2.7" -description = "Distributed Task Queue." -category = "main" -optional = false -python-versions = ">=3.7" -files = [ - {file = "celery-5.2.7-py3-none-any.whl", hash = "sha256:138420c020cd58d6707e6257b6beda91fd39af7afde5d36c6334d175302c0e14"}, - {file = "celery-5.2.7.tar.gz", hash = "sha256:fafbd82934d30f8a004f81e8f7a062e31413a23d444be8ee3326553915958c6d"}, -] - -[package.dependencies] -billiard = ">=3.6.4.0,<4.0" -click = ">=8.0.3,<9.0" -click-didyoumean = ">=0.0.3" -click-plugins = ">=1.1.1" -click-repl = ">=0.2.0" -kombu = ">=5.2.3,<6.0" -pytz = ">=2021.3" -vine = ">=5.0.0,<6.0" - -[package.extras] -arangodb = ["pyArango (>=1.3.2)"] -auth = ["cryptography"] -azureblockblob = ["azure-storage-blob (==12.9.0)"] -brotli = ["brotli (>=1.0.0)", "brotlipy (>=0.7.0)"] -cassandra = ["cassandra-driver (<3.21.0)"] -consul = ["python-consul2"] -cosmosdbsql = ["pydocumentdb (==2.3.2)"] -couchbase = ["couchbase (>=3.0.0)"] -couchdb = ["pycouchdb"] -django = ["Django (>=1.11)"] -dynamodb = ["boto3 (>=1.9.178)"] -elasticsearch = ["elasticsearch"] -eventlet = ["eventlet (>=0.32.0)"] -gevent = ["gevent (>=1.5.0)"] -librabbitmq = ["librabbitmq (>=1.5.0)"] -memcache = ["pylibmc"] -mongodb = ["pymongo[srv] (>=3.11.1)"] -msgpack = ["msgpack"] -pymemcache = ["python-memcached"] -pyro = ["pyro4"] -pytest = ["pytest-celery"] -redis = ["redis (>=3.4.1,!=4.0.0,!=4.0.1)"] -s3 = ["boto3 (>=1.9.125)"] -slmq = ["softlayer-messaging (>=1.0.3)"] -solar = ["ephem"] -sqlalchemy = ["sqlalchemy"] -sqs = ["kombu[sqs]"] -tblib = ["tblib (>=1.3.0)", "tblib (>=1.5.0)"] -yaml = ["PyYAML (>=3.10)"] -zookeeper = ["kazoo (>=1.3.1)"] -zstd = ["zstandard"] - [[package]] name = "certifi" version = "2022.12.7" @@ -551,56 +469,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -[[package]] -name = "click-didyoumean" -version = "0.3.0" -description = "Enables git-like *did-you-mean* feature in click" -category = "main" -optional = false -python-versions = ">=3.6.2,<4.0.0" -files = [ - {file = "click-didyoumean-0.3.0.tar.gz", hash = "sha256:f184f0d851d96b6d29297354ed981b7dd71df7ff500d82fa6d11f0856bee8035"}, - {file = "click_didyoumean-0.3.0-py3-none-any.whl", hash = "sha256:a0713dc7a1de3f06bc0df5a9567ad19ead2d3d5689b434768a6145bff77c0667"}, -] - -[package.dependencies] -click = ">=7" - -[[package]] -name = "click-plugins" -version = "1.1.1" -description = "An extension module for click to enable registering CLI commands via setuptools entry-points." -category = "main" -optional = false -python-versions = "*" -files = [ - {file = "click-plugins-1.1.1.tar.gz", hash = "sha256:46ab999744a9d831159c3411bb0c79346d94a444df9a3a3742e9ed63645f264b"}, - {file = "click_plugins-1.1.1-py2.py3-none-any.whl", hash = "sha256:5d262006d3222f5057fd81e1623d4443e41dcda5dc815c06b442aa3c02889fc8"}, -] - -[package.dependencies] -click = ">=4.0" - -[package.extras] -dev = ["coveralls", "pytest (>=3.6)", "pytest-cov", "wheel"] - -[[package]] -name = "click-repl" -version = "0.2.0" -description = "REPL plugin for Click" -category = "main" -optional = false -python-versions = "*" -files = [ - {file = "click-repl-0.2.0.tar.gz", hash = "sha256:cd12f68d745bf6151210790540b4cb064c7b13e571bc64b6957d98d120dacfd8"}, - {file = "click_repl-0.2.0-py3-none-any.whl", hash = "sha256:94b3fbbc9406a236f176e0506524b2937e4b23b6f4c0c0b2a0a83f8a64e9194b"}, -] - -[package.dependencies] -click = "*" -prompt-toolkit = "*" -six = "*" - [[package]] name = "clickclick" version = "20.10.2" @@ -1543,38 +1411,6 @@ pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"] -[[package]] -name = "kombu" -version = "5.2.4" -description = "Messaging library for Python." -category = "main" -optional = false -python-versions = ">=3.7" -files = [ - {file = "kombu-5.2.4-py3-none-any.whl", hash = "sha256:8b213b24293d3417bcf0d2f5537b7f756079e3ea232a8386dcc89a59fd2361a4"}, - {file = "kombu-5.2.4.tar.gz", hash = "sha256:37cee3ee725f94ea8bb173eaab7c1760203ea53bbebae226328600f9d2799610"}, -] - -[package.dependencies] -amqp = ">=5.0.9,<6.0.0" -vine = "*" - -[package.extras] -azureservicebus = ["azure-servicebus (>=7.0.0)"] -azurestoragequeues = ["azure-storage-queue"] -consul = ["python-consul (>=0.6.0)"] -librabbitmq = ["librabbitmq (>=2.0.0)"] -mongodb = ["pymongo (>=3.3.0,<3.12.1)"] -msgpack = ["msgpack"] -pyro = ["pyro4"] -qpid = ["qpid-python (>=0.26)", "qpid-tools (>=0.26)"] -redis = ["redis (>=3.4.1,!=4.0.0,!=4.0.1)"] -slmq = ["softlayer-messaging (>=1.0.3)"] -sqlalchemy = ["sqlalchemy"] -sqs = ["boto3 (>=1.9.12)", "pycurl (>=7.44.1,<7.45.0)", "urllib3 (>=1.26.7)"] -yaml = ["PyYAML (>=3.10)"] -zookeeper = ["kazoo (>=1.3.1)"] - [[package]] name = "lazy-object-proxy" version = "1.9.0" @@ -2150,21 +1986,6 @@ files = [ flask = "*" prometheus-client = "*" -[[package]] -name = "prompt-toolkit" -version = "3.0.38" -description = "Library for building powerful interactive command lines in Python" -category = "main" -optional = false -python-versions = ">=3.7.0" -files = [ - {file = "prompt_toolkit-3.0.38-py3-none-any.whl", hash = "sha256:45ea77a2f7c60418850331366c81cf6b5b9cf4c7fd34616f733c5427e6abbb1f"}, - {file = "prompt_toolkit-3.0.38.tar.gz", hash = "sha256:23ac5d50538a9a38c8bde05fecb47d0b403ecd0662857a86f886f798563d5b9b"}, -] - -[package.dependencies] -wcwidth = "*" - [[package]] name = "protobuf" version = "3.20.3" @@ -3293,7 +3114,6 @@ files = [] develop = false [package.dependencies] -celery = "*" configparser = "*" lxml = "*" @@ -3301,7 +3121,7 @@ lxml = "*" type = "git" url = "https://github.com/sartography/SpiffWorkflow" reference = "main" -resolved_reference = "6ae98b585b25dce78a8be814f5d773a6947d6320" +resolved_reference = "0a455cdd221137ec52d39801dd5ad6dabad4ed4f" [[package]] name = "sqlalchemy" @@ -3723,18 +3543,6 @@ brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] -[[package]] -name = "vine" -version = "5.0.0" -description = "Promises, promises, promises." -category = "main" -optional = false -python-versions = ">=3.6" -files = [ - {file = "vine-5.0.0-py2.py3-none-any.whl", hash = "sha256:4c9dceab6f76ed92105027c49c823800dd33cacce13bdedc5b914e3514b7fb30"}, - {file = "vine-5.0.0.tar.gz", hash = "sha256:7d3b1624a953da82ef63462013bbd271d3eb75751489f9807598e8f340bd637e"}, -] - [[package]] name = "virtualenv" version = "20.21.0" @@ -3756,18 +3564,6 @@ platformdirs = ">=2.4,<4" docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=22.12)"] test = ["covdefaults (>=2.2.2)", "coverage (>=7.1)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23)", "pytest (>=7.2.1)", "pytest-env (>=0.8.1)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.10)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)"] -[[package]] -name = "wcwidth" -version = "0.2.6" -description = "Measures the displayed width of unicode strings in a terminal" -category = "main" -optional = false -python-versions = "*" -files = [ - {file = "wcwidth-0.2.6-py2.py3-none-any.whl", hash = "sha256:795b138f6875577cd91bba52baf9e445cd5118fd32723b460e30a0af30ea230e"}, - {file = "wcwidth-0.2.6.tar.gz", hash = "sha256:a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0"}, -] - [[package]] name = "werkzeug" version = "2.2.3" diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py index 9ac3c432..d15a6e80 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -1902,6 +1902,18 @@ class ProcessInstanceProcessor: ) task_service.update_all_tasks_from_spiff_tasks(spiff_tasks, deleted_tasks, start_time) + # we may want to move this to task_service.update_all_tasks_from_spiff_tasks but not sure it's always good to it. + # for cancelled tasks, spiff only returns tasks that were cancelled, not the ones that were deleted so we have to find them + spiff_task_guids = [str(st.id) for st in spiff_tasks] + tasks_no_longer_in_spiff = TaskModel.query.filter( + and_( + TaskModel.process_instance_id == self.process_instance_model.id, + TaskModel.guid.not_in(spiff_task_guids), # type: ignore + ) + ).all() + for task in tasks_no_longer_in_spiff: + db.session.delete(task) + self.save() self.process_instance_model.status = "terminated" db.session.add(self.process_instance_model) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/task_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/task_service.py index 9d67ec0c..659242e5 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/task_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/task_service.py @@ -462,7 +462,10 @@ class TaskService: human_tasks_to_clear = HumanTaskModel.query.filter( HumanTaskModel.task_id.in_(deleted_task_ids) # type: ignore ).all() - for task in tasks_to_clear + human_tasks_to_clear: + + # delete human tasks first to avoid potential conflicts when deleting tasks. + # otherwise sqlalchemy returns several warnings. + for task in human_tasks_to_clear + tasks_to_clear: db.session.delete(task) # Note: Can't restrict this to definite, because some things are updated and are now CANCELLED @@ -473,6 +476,7 @@ class TaskService: spiff_tasks_updated[str(spiff_task.id)] = spiff_task for _id, spiff_task in spiff_tasks_updated.items(): self.update_task_model_with_spiff_task(spiff_task) + self.save_objects_to_database() @classmethod diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py index 5c0fc5b7..efcb8145 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py @@ -1611,6 +1611,10 @@ class TestProcessApi(BaseTest): assert len(ready_tasks) == 1 ready_task = ready_tasks[0] + # check all_tasks here to ensure we actually deleted items when cancelling the instance + all_tasks = TaskModel.query.filter_by(process_instance_id=process_instance_id).all() + assert len(all_tasks) == 8 + response = client.post( f"/v1.0/process-instance-terminate/{self.modify_process_identifier_for_path_param(process_model_identifier)}/{process_instance_id}", headers=self.logged_in_headers(with_super_admin_user), @@ -1621,11 +1625,13 @@ class TestProcessApi(BaseTest): process_instance = ProcessInstanceModel.query.filter_by(id=process_instance_id).first() assert process_instance assert process_instance.status == "terminated" - assert ready_task.state == "CANCELLED" - # TODO: uncomment this once spiff is returning deleted tasks on cancel - # remaining_tasks = TaskModel.query.filter_by(process_instance_id=process_instance_id).all() - # assert len(remaining_tasks) == 3 + ready_task_that_is_now_cancelled = TaskModel.query.filter_by(guid=ready_task.guid).first() + assert ready_task_that_is_now_cancelled is not None + assert ready_task_that_is_now_cancelled.state == "CANCELLED" + + remaining_tasks = TaskModel.query.filter_by(process_instance_id=process_instance_id).all() + assert len(remaining_tasks) == 3 def test_process_instance_delete( self, From ca27217a257908a237de206da9deb2af6b82a2bd Mon Sep 17 00:00:00 2001 From: jasquat Date: Wed, 10 May 2023 16:43:08 -0400 Subject: [PATCH 3/3] updated spiffworkflow w/ burnettk --- spiffworkflow-backend/poetry.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spiffworkflow-backend/poetry.lock b/spiffworkflow-backend/poetry.lock index b7c9d95d..fb1260e9 100644 --- a/spiffworkflow-backend/poetry.lock +++ b/spiffworkflow-backend/poetry.lock @@ -3121,7 +3121,7 @@ lxml = "*" type = "git" url = "https://github.com/sartography/SpiffWorkflow" reference = "main" -resolved_reference = "0a455cdd221137ec52d39801dd5ad6dabad4ed4f" +resolved_reference = "a844b34f9327a572d8f26110a01af21e22c548d1" [[package]] name = "sqlalchemy"