From c3fdbc0f69572f2f8e48e4cc6e576cc4d773c48f Mon Sep 17 00:00:00 2001 From: jasquat Date: Mon, 25 Sep 2023 16:03:46 -0400 Subject: [PATCH] remove pilot cypress tests and update others for admin in path removal w/ burnettk --- .../cypress/e2e/process_instances.cy.js | 2 +- .../pilot/NDR_PP1/consultingfees.cy.js | 1169 ------ .../cypress/pilot/NDR_PP1/equipment.cy.js | 3013 -------------- .../pilot/NDR_PP1/initiaterequest.cy.js | 2530 ------------ .../pilot/NDR_PP1/learninganddev.cy.js | 1984 --------- .../cypress/pilot/NDR_PP1/otherfees.cy.js | 1029 ----- .../pilot/NDR_PP1/softwarelicense.cy.js | 3562 ----------------- .../initiate_travelrequest.cy.js | 2341 ----------- .../RequestTravel_PP2/requesttravel.cy.js | 3411 ---------------- .../cypress/pilot/pp1.cy.js | 97 - .../cypress/support/commands.js | 4 +- 11 files changed, 3 insertions(+), 19139 deletions(-) delete mode 100644 spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js delete mode 100644 spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js delete mode 100644 spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js delete mode 100644 spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js delete mode 100644 spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js delete mode 100644 spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js delete mode 100644 spiffworkflow-frontend/cypress/pilot/RequestTravel_PP2/initiate_travelrequest.cy.js delete mode 100644 spiffworkflow-frontend/cypress/pilot/RequestTravel_PP2/requesttravel.cy.js delete mode 100644 spiffworkflow-frontend/cypress/pilot/pp1.cy.js diff --git a/spiffworkflow-frontend/cypress/e2e/process_instances.cy.js b/spiffworkflow-frontend/cypress/e2e/process_instances.cy.js index 61e03689..bfeaf91c 100644 --- a/spiffworkflow-frontend/cypress/e2e/process_instances.cy.js +++ b/spiffworkflow-frontend/cypress/e2e/process_instances.cy.js @@ -172,7 +172,7 @@ describe('process-instances', () => { }); it('can filter', () => { - cy.visit('/admin/process-instances/all'); + cy.visit('/process-instances/all'); cy.contains('All Process Instances'); cy.get('.process-instance-list-row-variant-all'); cy.assertAtLeastOneItemInPaginatedResults(); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js deleted file mode 100644 index ed114b69..00000000 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js +++ /dev/null @@ -1,1169 +0,0 @@ -const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype -) => { - 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') - .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.' - ) - ); - } 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 3 - cy.contains('Task: Review the Request', { timeout: 60000 }); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .clear() - .type( - "Providing additional info. 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 people for jobs of any size." - ); - - // 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(/^Continue$/) - // .click(); - // } - - cy.wait(10000); - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); -}; - -//Check if the process instance is completed successfully -const checkProcessInstanceCompleted = ( - username, - password, - processInstanceId -) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); - - cy.wait(1000); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(2000); - cy.get('#tag-1 > span').contains('complete'); -} - -// Consulting Fees Path - Without Files -describe('Consulting Fees Path - Without Files', () => { - Cypress._.times(1, () => { - // Budget owner approves the request - it('1.Budget owner approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('consult_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Consulting ==== Management consulting includes a broad range of activities, and the many firms and their members often define these practices quite differently. One way to categorize the activities is in terms of the professional’s area of expertise.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-12-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Embassar'); - 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('ambassadors'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'An ambassador is an official envoy, especially a high-ranking diplomat who represents a state.' - ); - 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('ETH'); - cy.get('#root_item_0_unit_price').type('1.15'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('consultants'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A consultant (from Latin: consultare "to deliberate") is a professional' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('freelancers'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Find & hire top freelancers, web developers & designers inexpensively. ' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('2.Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('consult_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Consulting is defined as the practise of providing a third party with expertise on a matter in exchange for a fee. The service may involve either advisory or implementation services.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('24-10-2032'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Consultancy.uk'); - 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('consultants'); - 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('Crypto'); - cy.get('#root_item_0_currency').select('DAI'); - cy.get('#root_item_0_unit_price').type('1500'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('consultants'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A consultant (from Latin: consultare "to deliberate") is a professional' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('freelancers'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Find & hire top freelancers, web developers & designers inexpensively. ' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('3.Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('consult_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Freelancing - Freelancing is doing specific work for clients without committing to full-time employment. Freelancers often take on multiple projects with different clients simultaneously. IRS considers freelancers to be self-employed individuals.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('05-04-2028'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Upwork'); - cy.get('#root_payment_method').select('Debit Card'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - - // item 0 - cy.get('#root_item_0_sub_category').select('freelancers'); - 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('1750'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('consultants'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A consultant (from Latin: consultare "to deliberate") is a professional' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('freelancers'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Find & hire top freelancers, web developers & designers inexpensively. ' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - -// Consulting Fees Path - With Files -describe.only('Consulting Fees Path - With Files', () => { - Cypress._.times(1, () => { - // Budget owner approves the request - it('4.Budget owner approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('consult_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Consulting ==== Management consulting includes a broad range of activities, and the many firms and their members often define these practices quite differently. One way to categorize the activities is in terms of the professional’s area of expertise.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('05-12-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Embassar'); - 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('ambassadors'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'An ambassador is an official envoy, especially a high-ranking diplomat who represents a state.' - ); - 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('ETH'); - cy.get('#root_item_0_unit_price').type('1.15'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('consultants'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A consultant (from Latin: consultare "to deliberate") is a professional' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('freelancers'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Find & hire top freelancers, web developers & designers inexpensively. ' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - 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.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(20000); - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('5.Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('consult_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Consulting is defined as the practise of providing a third party with expertise on a matter in exchange for a fee. The service may involve either advisory or implementation services.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('14-10-2029'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Consultancy.uk'); - 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('consultants'); - 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('Crypto'); - cy.get('#root_item_0_currency').select('DAI'); - cy.get('#root_item_0_unit_price').type('1500'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('consultants'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A consultant (from Latin: consultare "to deliberate") is a professional' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('freelancers'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Find & hire top freelancers, web developers & designers inexpensively. ' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - 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.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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('6.Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('consult_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Freelancing - Freelancing is doing specific work for clients without committing to full-time employment. Freelancers often take on multiple projects with different clients simultaneously. IRS considers freelancers to be self-employed individuals.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('05-04-2024'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Upwork'); - cy.get('#root_payment_method').select('Debit Card'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - // item 0 - cy.get('#root_item_0_sub_category').select('freelancers'); - 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('1750'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('consultants'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A consultant (from Latin: consultare "to deliberate") is a professional' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('freelancers'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Find & hire top freelancers, web developers & designers inexpensively. ' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - 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.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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js deleted file mode 100644 index 14dafa9e..00000000 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js +++ /dev/null @@ -1,3013 +0,0 @@ -const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype -) => { - 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') - .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. By contrast, software is the set of instructions that can be stored and run by hardware. Hardware is so-termed because it is "hard" or rigid with respect to changes, whereas software is "soft" END.' - ) - ); - } else if (approvaltype === 'escalateBO') { - cy.get('#root > label:nth-child(1)').click(); - cy.get('.field-boolean > label:nth-child(1)').click(); - cy.get('.cds--text-area__wrapper') - .find('#root') - .type(username.concat(' is escalating to Budget owner.')); - } 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 3 - cy.contains('Task: Review the Request', { timeout: 60000 }); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .clear() - .type( - 'Providing additional info. Computer hardware includes the physical parts of a computer, such as the case, central processing unit (CPU), random access memory (RAM), monitor, mouse, keyboard, computer data storage, graphics card, sound card' - ); - - // 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(/^Continue$/) - // .click(); - // } - - cy.wait(10000); - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); -}; - -//Check if the process instance is completed successfully -const checkProcessInstanceCompleted = ( - username, - password, - processInstanceId -) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); - - cy.wait(1000); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(2000); - cy.get('#tag-1 > span').contains('complete'); -} - -// Equipment Path - Without Files -describe('Equipment Path - Without Files', () => { - Cypress._.times(1, () => { - // Out of Policy. People Ops Partner Group and Budget owner approves the request - it('1.Out of Policy. People Ops Partner Group and Budget owner approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'By contrast, software is the set of instructions that can be stored and run by hardware. Hardware is so-termed because it is "hard" or rigid with respect to changes, whereas software is "soft" because it is easy to change..' - ); - 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('Mech Tech'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Hardware is typically directed by the software to execute any command or instruction' - ); - 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('5000'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('ledger'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A mainframe computer is a much larger computer that typically fills a room and may cost many hundred' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('yubikey'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'A supercomputer is superficially similar to a mainframe but is instead intended for extremely demand' - ); - cy.get('#root_item_2_qty').clear().type('6'); - 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.34'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('mic_and_head'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'The term supercomputer does not refer to a specific technology.' - ); - cy.get('#root_item_3_qty').clear().type('6'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('SNT'); - cy.get('#root_item_3_unit_price').type('2300'); - - 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( - 'The template for all modern computers is the Von Neumann architecture, detailed in a 1945 paper by Hungarian mathematician John von Neumann. This describes a design architecture for a electronic digital computer with subdivisions of a processing unit' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - cy.log('=====after logout ---'); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Out of Policy. People Ops Partner Group approves and Budget owner rejects the request - it('2.Out of Policy. People Ops Partner Group approves and Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'Electronic appliances and services related to the personal computer, including the PC (desktop or laptop), and communication between computers and the services required by intercommunication networks. These fundamentally include' - ); - 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('BestBUY'); - 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('yubikey'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Output devices are designed around the senses of human beings. For example, monitors display text' - ); - 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('3200'); - - 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( - 'When using computer hardware, an upgrade means adding new or additional hardware to a computer that improves its performance, increases its capacity, or adds new features. For example, \nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Out of Policy. People Ops Partner Group approves and Budget owner request for additional details - it('3.Out of Policy. People Ops Partner Group approves and Budget owner needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'Computer hardware includes the physical parts of a computer, such as the case, central processing unit (CPU), random access memory (RAM), monitor, mouse, keyboard, computer data storage, graphics card, sound card, speakers and motherboard.[1][2]' - ); - 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('Amazon.com'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Rather it indicates the fastest computations available at any given time. In mid-2011, the fastest' - ); - cy.get('#root_item_0_qty').clear().type('4'); - 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('4000'); - - 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 supercomputer is superficially similar to a mainframe but is instead intended for extremely demanding computational tasks. As of November 2021, the fastest supercomputer on the TOP500 supercomputer list is Fugaku, in Japan' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - // people ops approves second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - // budget owner approves second time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group approves the request - it('4.Within Policy. People Ops Partner Group approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'By contrast, software is the set of instructions that can be stored and run by hardware. Hardware is so-termed because it is "hard" or rigid with respect to changes, whereas software is "soft" because it is easy to change.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('15-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('EBAY'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Because computer parts contain hazardous materials, there is a growing movement to recycle ' - ); - 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('HKD'); - cy.get('#root_item_0_unit_price').type('1236'); - - 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( - 'Computer hardware contain dangerous chemicals such as lead, mercury, nickel, and cadmium. According to the EPA these e-wastes have a harmful effect on the environment unless they are disposed properly. \nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group rejects the request - it('5.Within Policy. People Ops Partner Group rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'The template for all modern computers is the Von Neumann architecture, detailed in a 1945 paper by Hungarian mathematician John von Neumann. This describes a design architecture for a electronic digital computer with subdivisions of a processing unit' - ); - 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('Best Buy'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Computer components contain many toxic substances, like dioxins, polychlorinated biphenyls (PCBs)' - ); - 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('320'); - - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group request additional info - it('6.Within Policy. People Ops Partner Group needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'The personal computer is one of the most common types of computer due to its versatility and relatively low price. Desktop personal computers have a monitor, a keyboard, a mouse, and a computer case. The computer case holds the motherboard' - ); - 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('Walmart'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'As computer hardware contain a wide number of metals inside, the United States Environmental' - ); - 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('CAD'); - cy.get('#root_item_0_unit_price').type('435'); - - 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( - 'The template for all modern computers is the Von Neumann architecture, detailed in a 1945 paper by Hungarian mathematician John von Neumann. \nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'needmoreinfo' - ); - - // requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - 'providemoreinfo' - ); - - // peopleops approves second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - // Within Policy. People Ops Partner Group and Budget owner approves the request - it('7.Within Policy. People Ops Partner Group and Budget owner approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'Laptops are designed for portability but operate similarly to desktop PCs.[5] They may use lower-power or reduced size components, with lower performance than a similarly priced desktop computer' - ); - 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("Fry's"); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Recycling a computer is made easier by a few of the national services, such as Dell and Apple.' - ); - 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('1200'); - - 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( - 'The template for all modern computers is the Von Neumann architecture, detailed in a 1945 paper by Hungarian mathematician John von Neumann. \nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'escalateBO' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group approves and Budget owner rejects the request - it('8.Within Policy. People Ops Partner Group approves and Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'The computer case encloses most of the components of the system. It provides mechanical support and protection for internal elements such as the motherboard, disk drives, and power supplies, and controls and directs the flow of cooling air over int. ' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('14-02-2026'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('BestBUY'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Because computer parts contain hazardous materials, there is a growing movement to recycle old' - ); - 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('300'); - - 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( - 'The personal computer is one of the most common types of computer due to its versatility and relatively low price. Desktop personal computers have a monitor, a keyboard, a mouse, and a computer case.\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'escalateBO' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group approves and Budget owner request for additional details - it('9.Within Policy. People Ops Partner Group approves and Budget owner needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'The motherboard is the main component of a computer. It is a board with integrated circuitry that connects the other parts of the computer including the CPU, the RAM, the disk drives (CD, DVD, hard disk, or any others) as well as any peripherals' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('15-02-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Amazon.com'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Recycling a computer is made easier by a few of the national services, such as Dell and Apple.' - ); - cy.get('#root_item_0_qty').clear().type('4'); - 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('400'); - - 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( - 'The personal computer is one of the most common types of computer due to its versatility and relatively low price. Desktop personal computers have a monitor, a keyboard, a mouse, and a computer case.\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'escalateBO' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - // people ops approves second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - -// Equipment Path - With Files -describe.only('Equipment Path - With Files', () => { - Cypress._.times(1, () => { - // Out of Policy. People Ops Partner Group and Budget owner approves the request - it('10.Out of Policy. People Ops Partner Group and Budget owner approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'Equipment most commonly refers to a set of tools or other objects commonly used to achieve a particular objective. Different jobs require different kinds of equipment.\nhttps://en.wikipedia.org/wiki/Equipment' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('15-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Mech Tech'); - cy.get('#root_payment_method').select('Debit Card'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - // item 0 - cy.get('#root_item_0_sub_category').select('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'When using computer hardware, an upgrade means adding new or additional hardware to a computer that' - ); - 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('12300'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('ledger'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A mainframe computer is a much larger computer that typically fills a room and may cost many hundred' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('yubikey'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'A supercomputer is superficially similar to a mainframe but is instead intended for extremely demand' - ); - cy.get('#root_item_2_qty').clear().type('6'); - 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('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('mic_and_head'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'The term supercomputer does not refer to a specific technology.' - ); - cy.get('#root_item_3_qty').clear().type('6'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('SNT'); - cy.get('#root_item_3_unit_price').type('2300'); - - 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( - 'The personal computer is one of the most common types of computer due to its versatility and relatively low price. Desktop personal computers have a monitor, a keyboard, a mouse, and a computer case.\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Out of Policy. People Ops Partner Group approves and Budget owner rejects the request - it('11.Out of Policy. People Ops Partner Group approves and Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'The motherboard is the main component of a computer. It is a board with integrated circuitry that connects the other parts of the computer including the CPU, the RAM, the disk drives (CD, DVD, hard disk, or any others) as well as any peripherals' - ); - 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('BestBUY'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Because computer parts contain hazardous materials, there is a growing movement to recycle old' - ); - 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('3000'); - - 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( - 'The personal computer is one of the most common types of computer due to its versatility and relatively low price. Desktop personal computers have a monitor, a keyboard, a mouse, and a computer case.\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Out of Policy. People Ops Partner Group approves and Budget owner request for additional details - it('12.Out of Policy. People Ops Partner Group approves and Budget owner needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'The CPU (central processing unit), which performs most of the calculations which enable a computer to function, and is referred to as the brain of the computer.\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - 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('Amazon.com'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Because computer parts contain hazardous materials, there is a growing movement to recycle old' - ); - cy.get('#root_item_0_qty').clear().type('4'); - 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('4000'); - - 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( - 'The personal computer is one of the most common types of computer due to its versatility and relatively low price. Desktop personal computers have a monitor, a keyboard, a mouse, and a computer case.\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - // people ops approves second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - // budget owner approves second time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group approves the request - it('13.Within Policy. People Ops Partner Group approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'An expansion card in computing is a printed circuit board that can be inserted into an expansion slot of a computer motherboard or backplane to add functionality to a computer system via the expansion bus. Expansion cards can be used to obtain' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('15-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Amazon'); - cy.get('#root_payment_method').select('Debit Card'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Recycling a computer is made easier by a few of the national services, such as Dell and Apple.' - ); - 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('CHF'); - cy.get('#root_item_0_unit_price').type('240'); - - 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( - 'The personal computer is one of the most common types of computer due to its versatility and relatively low price. Desktop personal computers have a monitor, a keyboard, a mouse, and a computer case.\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group rejects the request - it('14.Within Policy. People Ops Partner Group rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'Storage device is any computing hardware and digital media that is used for storing, porting and extracting data files and objects. It can hold and store information both temporarily and permanently and can be internal or external to a computer.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('29-11-2023'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Best Buy'); - 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('ledger'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'The central processing unit contains many toxic materials. It contains lead and chromium in metal' - ); - 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('CNY'); - cy.get('#root_item_0_unit_price').type('1560'); - - 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( - 'The template for all modern computers is the Von Neumann architecture, detailed in a 1945 paper by Hungarian mathematician John von Neumann..\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group request additional info - it('15.Within Policy. People Ops Partner Group needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'Data is stored by a computer using a variety of media. Hard disk drives (HDDs) are found in virtually all older computers, due to their high capacity and low cost, but solid-state drives (SSDs) are faster and more power efficient.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('12-11-2024'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type("Fry's"); - cy.get('#root_payment_method').select('Debit Card'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('yubikey'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Data is stored by a computer using a variety of media. Hard disk drives (HDDs) are found' - ); - 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('COP'); - cy.get('#root_item_0_unit_price').type('1230'); - - 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( - 'The template for all modern computers is the Von Neumann architecture, detailed in a 1945 paper by Hungarian mathematician John von Neumann..\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'needmoreinfo' - ); - - // requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - 'providemoreinfo' - ); - - // people ops approves second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - // Within Policy. People Ops Partner Group and Budget owner approves the request - it('16.Within Policy. People Ops Partner Group and Budget owner approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'To transfer data between computers, an external flash memory device (such as a memory card or USB flash drive) or optical disc (such as a CD-ROM, DVD-ROM or BD-ROM) may be used. ' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('15-12-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Amazon.com'); - 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('mic_and_head'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Data is stored by a computer using a variety of media. Hard disk drives (HDDs) are found' - ); - 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('ETB'); - cy.get('#root_item_0_unit_price').type('3200'); - - 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( - 'The template for all modern computers is the Von Neumann architecture, detailed in a 1945 paper by Hungarian mathematician John von Neumann..\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'escalateBO' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group approves and Budget owner rejects the request - it('17.Within Policy. People Ops Partner Group approves and Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'Input and output devices are typically housed externally to the main computer chassis. The following are either standard or very common to many computer systems.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('17-02-2026'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('BestBUY'); - 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('mic_and_head'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'The central processing unit contains many toxic materials. It contains lead and chromium in metal' - ); - 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('1'); - - 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( - 'The template for all modern computers is the Von Neumann architecture, detailed in a 1945 paper by Hungarian mathematician John von Neumann..\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'escalateBO' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Within Policy. People Ops Partner Group approves and Budget owner request for additional details - it('18.Within Policy. People Ops Partner Group approves and Budget owner needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('equip'); - cy.get('#root_purpose') - .clear() - .type( - 'Input devices allow the user to enter information into the system, or control its operation. Most personal computers have a mouse and keyboard, but laptop systems typically use a touchpad instead of a mouse. Other input devices include webcams, mic' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('16-02-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Amazon.com'); - 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('laptops'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Because computer parts contain hazardous materials, there is a growing movement to recycle old' - ); - cy.get('#root_item_0_qty').clear().type('4'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('GBP'); - cy.get('#root_item_0_unit_price').type('420'); - - 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( - 'The personal computer is one of the most common types of computer due to its versatility and relatively low price. Desktop personal computers have a monitor, a keyboard, a mouse, and a computer case.\nhttps://en.wikipedia.org/wiki/Computer_hardware' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'escalateBO' - ); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - // people ops escalate to BO second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'escalateBO' - ); - - // budget owner approves second time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js deleted file mode 100644 index ba6a796b..00000000 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js +++ /dev/null @@ -1,2530 +0,0 @@ -const submitWithUserSpecialChars = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype -) => { - 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') - .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. Providing additional info with Special chars <>?,./ afsfsf : sf; sdf"sfs" fdsf\'sdf sfds{ sfsf [ s} } \s ss !@#$%^&*()_+ sff =-~ ` END.'), { parseSpecialCharSequences: false }); - } 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.' - ) - ); - } 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 3 - cy.contains('Task: Review the Request', { timeout: 60000 }); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .clear() - .type( - 'Providing additional info with Special chars <>?,./ afsfsf : sf; sdf"sfs" fdsf\'sdf sfds{ sfsf [ s} } \s ss !@#$%^&*()_+ sff =-~ ` END.,', { parseSpecialCharSequences: false } - ); - - // cy.contains('Submit the Request').click(); - // cy.get('input[value="Submit the Request"]').click(); - } else { - } - - - cy.contains( - 'Purpose is to test all the special characters work in the request. ~!@#$%^&*()_+`-= {}[]\ and ;\',./:"<>? end.' - ); - cy.contains( - /^Consulting Fees$/ - ); - cy.contains( - /^Medium$/ - ); - cy.contains( - /^24-10-2032$/ - ); - cy.contains( - /^Consultancy.uk$/ - ); - cy.contains( - /^Crypto Transfer$/ - ); - cy.contains( - 'Special char test ,./;\'[]\=-0987654321`~!@#$%^&*()_+{}:"<>? end.' - ); - cy.contains( - /^Consultants$/ - ); - cy.contains( - /^23$/ - ); - cy.contains( - /^SNT$/ - ); - cy.contains( - /^1,915.0000$/ - ); - cy.contains( - 'Special char test 2 +_=)(*&^%$#@!~`?> {g} [a]end.' - ); - cy.contains( - /^Freelancers$/ - ); - cy.contains( - /^15$/ - ); - cy.contains( - /^AED$/ - ); - cy.contains( - /^4,537.25$/ - ); - cy.contains( - 'Test Special chars afssfsfs,asfdf. sfsf? sfd/sfs f:sfsf " sfsdf; SDFfsd\' sfsdf{sfsfs} sfsdf[ sfsdf] fsfsfd\ sfsd sfsdf=S dfs+ sfd- sfsdf_ sfsfd (sfsd )sfsfsd * sf&sfsfs ^ sfs % sf $ ss# s@ sf! sfd` ss~ END.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - // if (expectAdditionalApprovalInfoPage) { - // cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); - - // cy.get('button') - // .contains(/^Continue$/) - // .click(); - // } - - cy.wait(5000); - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); -}; - -//Check if the process instance is completed successfully -const checkProcessInstanceCompletedSpecialChars = ( - username, - password, - processInstanceId -) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); - - cy.wait(1000); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(2000); - cy.get('#tag-1 > span').contains('complete'); - - cy.contains( - /^Process Recap$/ - ); - cy.contains( - /^Approval Status: Approved$/ - ); - - cy.contains( - 'Purpose is to test all the special characters work in the request. ~!@#$%^&*()_+`-= {}[]\ and ;\',./:"<>? end.' - ); - cy.contains( - /^Consulting Fees$/ - ); - cy.contains( - /^Medium$/ - ); - cy.contains( - /^24-10-2032$/ - ); - cy.contains( - /^Consultancy.uk$/ - ); - cy.contains( - /^Crypto Transfer$/ - ); - cy.contains( - 'Special char test ,./;\'[]\=-0987654321`~!@#$%^&*()_+{}:"<>? end.' - ); - cy.contains( - /^Consultants$/ - ); - cy.contains( - /^23$/ - ); - cy.contains( - /^SNT$/ - ); - cy.contains( - /^1,915.0000$/ - ); - cy.contains( - 'Special char test 2 +_=)(*&^%$#@!~`?> {g} [a]end.' - ); - cy.contains( - /^Freelancers$/ - ); - cy.contains( - /^15$/ - ); - cy.contains( - /^AED$/ - ); - cy.contains( - /^4,537.25$/ - ); - cy.contains( - 'Test Special chars afssfsfs,asfdf. sfsf? sfd/sfs f:sfsf " sfsdf; SDFfsd\' sfsdf{sfsfs} sfsdf[ sfsdf] fsfsfd\ sfsd sfsdf=S dfs+ sfd- sfsdf_ sfsfd (sfsd )sfsfsd * sf&sfsfs ^ sfs % sf $ ss# s@ sf! sfd` ss~ END.' - ); - cy.contains( - 'Providing additional info with Special chars <>?,./ afsfsf : sf; sdf"sfs" fdsf\'sdf sfds{ sfsf [ s} } \s ss !@#$%^&*()_+ sff =-~ ` END.' - ); - cy.contains( - 'Budget Owner ' - ); -} - -// Software and License - Without Files -describe('Initiate a Request - Without Files', () => { - Cypress._.times(1, () => { - // Submit a Software and License request - Without Files - it('1.Submit a Software and License request', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - }); - }); - - // Submit a Software and License request - Without Files and with mandatory fields only - it('2.Submit a Software and License request - Without Files and with mandatory fields only', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - }); - }); - - // Edit a Software and License request - Without Files - it('3.Edit a Software and License request', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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.2456'); - - 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,\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows' - ); - - // cy.contains('Edit the Request').click(); - - // cy.get('input[value="Edit the Request"]').click(); - - cy.get('button') - .contains(/^Edit Request$/) - .click(); - - // Form 1 - cy.contains('Task: Submit Details', { timeout: 60000 }); - - cy.contains('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.contains('High'); - cy.contains('25-11-2025'); - cy.contains('Microsoft'); - cy.contains('Reimbursement'); - cy.contains('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); - cy.contains('2'); - cy.contains('Crypto'); - cy.contains('SNT'); - cy.contains('1915.2456'); - cy.contains('A software license is a document that provides legally binding guidelines for the use and distri END'); - cy.contains('1'); - cy.contains('Fiat'); - cy.contains('AED'); - cy.contains('4500'); - - cy.wait(2000); - 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('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,\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows', { timeout: 1000 }); - - cy.get('.cds--text-area__wrapper').find('#root').type('EDITING INFO'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.logout(); - cy.wait(2000); - }); - }); - - // Save and Close a Software and License request 1 - Without Files - it('4.Save and Close a Software and License request 1', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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(/^Save and Close$/) - .click(); - - // cy.get('button') - // .contains(/^Return to Home$/) - // .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Save and Close a Software and License request 2 - Without Files - it('5.Save and Close a Software and License request 2', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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(/^Save and Close$/) - .click(); - - // cy.get('button') - // .contains(/^Return to Home$/) - // .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Save and Close a Software and License request 3 - Without Files - it('6.Save and Close a Software and License request 3', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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.get('button') - .contains(/^Save and Close$/) - .click(); - - // cy.get('button') - // .contains(/^Return to Home$/) - // .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Cancel a Software and License request 1- Without Files - it('7.Cancel a Software and License request 1', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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('#root-Yes').click(); - - cy.get('button') - .contains(/^Cancel Request$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Cancel a Software and License request 2- Without Files - it('8.Cancel a Software and License request 2', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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('Cancel the Request').click(); - - // cy.get('input[value="Cancel the Request"]').click(); - - cy.get('button') - .contains(/^Cancel Request$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Arrange items order - it('9.Arrange items order', () => { - const username = Cypress.env('requestor_username'); - const 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(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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('consult_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Consulting ==== Management consulting includes a broad range of activities, and the many firms and their members often define these practices quite differently. One way to categorize the activities is in terms of the professional’s area of expertise.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-12-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Embassar'); - 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('ambassadors'); - cy.get('#root_item_0_item_name') - .clear() - .type( - '1. An ambassador is an official envoy, especially a high-ranking diplomat who represents a.' - ); - 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('ETH'); - cy.get('#root_item_0_unit_price').type('1.15'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('consultants'); - cy.get('#root_item_1_item_name') - .clear() - .type( - '2. A consultant (from Latin: consultare "to deliberate") is a professional' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('freelancers'); - cy.get('#root_item_2_item_name') - .clear() - .type( - '3. Find & hire top freelancers, web developers & designers inexpensively. ' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('consultants'); - cy.get('#root_item_3_item_name') - .clear() - .type( - '4. The term supercomputer does not refer to a specific technology.' - ); - cy.get('#root_item_3_qty').clear().type('6'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('DAI'); - cy.get('#root_item_3_unit_price').type('1500.1234'); - - cy.get('#root_item > 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').click(); - cy.get('#root_item > 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').click(); - - cy.wait(2000); - - cy.get('#root_item > div.row.array-item-list > div:nth-child(1) > 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-down').click(); - cy.get('#root_item > 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-down').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - }); - }); - - // Delete items - it('10.Delete items', () => { - const username = Cypress.env('requestor_username'); - const 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(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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('consult_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Consulting ==== Management consulting includes a broad range of activities, and the many firms and their members often define these practices quite differently. One way to categorize the activities is in terms of the professional’s area of expertise.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-12-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Embassar'); - 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('ambassadors'); - cy.get('#root_item_0_item_name') - .clear() - .type( - '1. An ambassador is an official envoy, especially a high-ranking diplomat who represents a.' - ); - 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('ETH'); - cy.get('#root_item_0_unit_price').type('1.15'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('consultants'); - cy.get('#root_item_1_item_name') - .clear() - .type( - '2. A consultant (from Latin: consultare "to deliberate") is a professional' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('freelancers'); - cy.get('#root_item_2_item_name') - .clear() - .type( - '3. Find & hire top freelancers, web developers & designers inexpensively. ' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('consultants'); - cy.get('#root_item_3_item_name') - .clear() - .type( - '4. The term supercomputer does not refer to a specific technology.' - ); - cy.get('#root_item_3_qty').clear().type('6'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('DAI'); - cy.get('#root_item_3_unit_price').type('1500.1234'); - - //delete first and third items - cy.get('#root_item > 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-danger.array-item-remove').click(); - cy.get('#root_item > div.row.array-item-list > div:nth-child(1) > 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-danger.array-item-remove').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - }); - }); - }); -}); - -// Form validation - Software and License - Without Files -describe('Form validation', () => { - - //Special character check - it('11.Special character check', () => { - const username = Cypress.env('requestor_username'); - const 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.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); - const projectId = Cypress.env('project_id'); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('consult_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Purpose is to test all the special characters work in the request. ~!@#$%^&*()_+`-= {}[]\ and ;\',./:"<>? end. | this text goes missing', { parseSpecialCharSequences: false } - ); - - //.type( - // 'Purpose is to test all the special characters work in the request. Test Special chars ~!@#$%^&*()_+`-= {}|[]\ and ;\',./:"<>? end.', { parseSpecialCharSequences: false } - //); - - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('24-10-2032'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Consultancy.uk'); - cy.get('#root_payment_method').select('Crypto Transfer'); - - // item 0 - cy.get('#root_item_0_sub_category').select('consultants'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Special char test ,./;\'[]\=-0987654321`~!@#$%^&*()_+{}:"<>? end.', { parseSpecialCharSequences: false } - ); - //.type( - // 'Special char test ,./;\'[]\=-0987654321`~!@#$%^&*()_+{}|:"<>? end.', { parseSpecialCharSequences: false } - // ); - cy.get('#root_item_0_qty').clear().type('23'); - 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('freelancers'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Special char test 2 +_=)(*&^%$#@!~`?> {g} [a]end.', { parseSpecialCharSequences: false } - ); - //.type( - // 'Special char test 2 +_=)(*&^%$#@!~`?> {g} [a]end.', { parseSpecialCharSequences: false } - //); - 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('AED'); - cy.get('#root_item_1_unit_price').type('4537.25'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - - cy.contains( - 'Purpose is to test all the special characters work in the request. ~!@#$%^&*()_+`-= {}[]\ and ;\',./:"<>? end.' - ); - cy.contains( - /^Consulting Fees$/ - ); - cy.contains( - /^Medium$/ - ); - cy.contains( - /^24-10-2032$/ - ); - cy.contains( - /^Consultancy.uk$/ - ); - cy.contains( - /^Crypto Transfer$/ - ); - cy.contains( - 'Special char test ,./;\'[]\=-0987654321`~!@#$%^&*()_+{}:"<>? end.' - ); - cy.contains( - /^Consultants$/ - ); - cy.contains( - /^23$/ - ); - cy.contains( - /^SNT$/ - ); - cy.contains( - /^1,915.0000$/ - ); - cy.contains( - 'Special char test 2 +_=)(*&^%$#@!~`?> {g} [a]end.' - ); - cy.contains( - /^Freelancers$/ - ); - cy.contains( - /^15$/ - ); - cy.contains( - /^AED$/ - ); - cy.contains( - /^4,537.25$/ - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'Test Special chars afssfsfs,asfdf. sfsf? sfd/sfs f:sfsf " sfsdf; SDFfsd\' sfsdf{sfsfs} sfsdf[ sfsdf] fsfsfd\ sfsd sfsdf=S dfs+ sfd- sfsdf_ sfsfd (sfsd )sfsfsd * sf&sfsfs ^ sfs % sf $ ss# s@ sf! sfd` ss~ END.', { parseSpecialCharSequences: false } - ); - //.type( - // 'Test Special chars afssfsfs,asfdf. sfsf? sfd/sfs f:sfsf " sfsdf; SDFfsd\' sfsdf{sfsfs} sfsdf[ sfsdf] fsfsfd\ sfsd| sfsdf=S dfs+ sfd- sfsdf_ sfsfd (sfsd )sfsfsd * sf&sfsfs ^ sfs % sf $ ss# s@ sf! sfd` ss~ END.', { parseSpecialCharSequences: false } - //); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUserSpecialChars( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - checkProcessInstanceCompletedSpecialChars(username, password, processInstanceId); - }); - }); - - //Check field max lengths - it('12.Check field max lengths', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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. This is now more than 250 characters' - ); - 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. This is now more than 100 characters' - ); - 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('must NOT have more than 250 characters'); - cy.contains('Name must NOT have more than 100 characters'); - - cy.get('#root_purpose') - .clear() - .type( - 'A 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_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_1_item_name') - .clear() - .type( - 'A software license is a document that provides legally binding guidelines for the use and distri END' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - cy.wait(6000); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'test 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. This is now more than 250 characters.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - cy.wait(2000); - - cy.contains('must NOT have more than 250 characters'); - cy.get('.cds--text-area__wrapper') - .find('#root') - .clear() - .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 accessosar Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - }); - }); - -}); - -// Software and License - With Files -describe('Initiate a Request - With Files', () => { - Cypress._.times(1, () => { - // Submit a Software and License request - Without Files - it('13.Submit a Software and License request - With Files', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - }); - }); - - // Submit a Software and License request - With Files and Multiple items - it('14.Submit a Software and License request - With Files and Multiple items', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - }); - }); - - // Edit a Software and License request - With Files - it('15.Edit a Software and License request - With Files', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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.2456'); - - 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.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('Edit the Request').click(); - - // cy.get('input[value="Edit the Request"]').click(); - - cy.get('button') - .contains(/^Edit Request$/) - .click(); - - // Form 1 - cy.contains('Task: Submit Details', { timeout: 60000 }); - - cy.contains('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.contains('High'); - cy.contains('25-11-2025'); - cy.contains('Microsoft'); - cy.contains('Reimbursement'); - cy.contains('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); - cy.contains('2'); - cy.contains('Crypto'); - cy.contains('SNT'); - cy.contains('1915.2456'); - cy.contains('A software license is a document that provides legally binding guidelines for the use and distri END'); - cy.contains('1'); - cy.contains('Fiat'); - cy.contains('AED'); - cy.contains('4500'); - - cy.wait(2000); - 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('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,\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows', { timeout: 1000 }); - cy.contains('lorem-ipsum.pdf'); - cy.contains('png-5mb-1.png'); - cy.contains('Free_Test_Data_1MB_PDF.pdf'); - cy.contains('png-5mb-2.png'); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'EDITING INFO : 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, 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - - cy.logout(); - cy.wait(2000); - }); - }); - - // Save and Close a Software and License request 1 - With Files - it('16.Save and Close a Software and License request 1 - With Files', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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.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(2000); - - cy.get('button') - .contains(/^Save and Close$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Cancel a Software and License request - With Files - it('17.Cancel a Software and License request - With Files', () => { - const username = Cypress.env('requestor_username'); - const 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('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.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); - const 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.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('Cancel the Request').click(); - - // cy.get('input[value="Cancel the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - }); - }); - }); -}); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js deleted file mode 100644 index 53cf80e9..00000000 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js +++ /dev/null @@ -1,1984 +0,0 @@ -const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype -) => { - 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') - .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. The term, learning and development, encompasses any professional development a business provides to its employees END.' - ) - ); - } 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 3 - cy.contains('Task: Review the Request', { timeout: 60000 }); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .clear() - .type( - 'Providing additional info. Learning and development (L&D) is a function within an organization that is responsible for empowering employees’ growth and developing their knowledge, skills, and capabilities to drive better business performance.' - ); - - // 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(/^Continue$/) - // .click(); - // } - - cy.wait(10000); - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - -}; - -//Check if the process instance is completed successfully -const checkProcessInstanceCompleted = ( - username, - password, - processInstanceId -) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); - - cy.wait(1000); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(2000); - cy.get('#tag-1 > span').contains('complete'); -} - -// Learning and Development Path - Without Files -describe('Learning and Development Path - Without Files', () => { - Cypress._.times(1, () => { - // People Ops Partner Group approves the request - it('1.Books Only. People Ops Partner Group approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'A L&D strategy should be aligned to the organization’s business strategy and goals with the aim of developing the workforce’s capability and driving business results.' - ); - 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('AIHR'); - cy.get('#root_payment_method').select('Debit Card'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('books'); - 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('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( - 'A L&D strategy should be aligned to the organization’s business strategy and goals with the aim of developing the workforce’s capability and driving business results.' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // People Ops Partner Group rejects the request - it('2.Books Only. People Ops Partner Group rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'Learning and development (L&D) is a function within an organization that is responsible for empowering employees’ growth and developing their knowledge, skills, and capabilities to drive better business performance. ' - ); - 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('EYK Books'); - 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('books'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'The role of the L&D function has evolved to meet the demands of digital transformation and a modern.' - ); - 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( - 'The function may be organized centrally, either independently or sitting under human resources (HR); decentralized throughout different business units; or be a hybrid (sometimes referred to as federated) structure.' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // People Ops Partner Group request for additional details - it('3.Books Only. People Ops Partner Group needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'A comprehensive collection of the concepts, definitions, and methodologies for the profession can be found in the. \nhttps://www.aihr.com/blog/learning-and-development/' - ); - 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('BOUNTY'); - 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('books'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'There are many different roles that make up a learning and development team or fall under the umbrel' - ); - 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( - 'Current and aspiring talent development professionals can enhance their skills with the various professional education courses offered by ATD Education \nhttps://www.aihr.com/blog/learning-and-development/' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'needmoreinfo' - ); - - // requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - 'providemoreinfo' - ); - - // people ops approves second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner approves and People Ops Partner Group approves the request - it('4.NOT Books Only. Budget owner approves and People Ops Partner Group approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'In 2019, the Association for Talent Development (ATD) conducted a competency study to assess needed talent development capabilities. The research found that the knowledge, skills, and attitudes (KSAs) of effective talent development professionals' - ); - 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('Lynda.com'); - 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('on_conf'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'The goal of learning and development is to develop or change the behavior of individuals or groups' - ); - 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('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('course'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'The goal of learning and development is to change the behavior of individuals or groups for better' - ); - cy.get('#root_item_1_qty').clear().type('1'); - cy.get('#root_item_1_currency_type').select('Crypto'); - cy.get('#root_item_1_currency').select('DAI'); - cy.get('#root_item_1_unit_price').type('2450'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('books'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'A L&D strategy should be aligned to the organization’s business strategy' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - 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( - 'Learning and development is a systematic process to enhance an employee’s skills, knowledge, and competency, resulting in better performance in a work setting. \nhttps://www.aihr.com/blog/learning-and-development/' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('5.NOT Books Only. Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'Learning and development is a systematic process to enhance an employee’s skills, knowledge, and competency, resulting in better performance in a work setting. \nhttps://www.aihr.com/blog/learning-and-development/' - ); - 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('Udemy Courses'); - 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('course'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'There are many different roles that make up a learning and development team or fall under the' - ); - 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( - 'A L&D strategy should be aligned to the organization’s business strategy and goals with the aim of developing the workforce’s capability and driving business results.' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('6.NOT Books Only. Budget owner needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'Research found that the knowledge, skills, and attitudes (KSAs) of effective talent development professionals, at every level of their career, fell into three major domains of practice.' - ); - 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('Conference LTD'); - 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('on_conf'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Learning and development is a systematic process to enhance an employee’s skills' - ); - 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( - 'Learning and development is a systematic process to enhance an employee’s skills, knowledge, and competency, resulting in better performance in a work setting. \nhttps://www.aihr.com/blog/learning-and-development/' - ); - - // cy.contains('Submit the Request').click(); - - // cy.get('input[value="Submit the Request"]').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - -// Learning and Development Path - With Files -describe.only('Learning and Development Path - With Files', () => { - Cypress._.times(1, () => { - // People Ops Partner Group approves the request - it('7.Books Only. People Ops Partner Group approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'Learning and development is a systematic process to enhance an employee’s skills, knowledge, and competency, resulting in better performance in a work setting. \nhttps://www.aihr.com/blog/learning-and-development/' - ); - 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('Training Industry'); - 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('books'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'A L&D strategy should be aligned to the organization’s business strategy and goals' - ); - 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( - 'A L&D strategy should be aligned to the organization’s business strategy and goals with the aim of developing the workforce’s capability and driving business results.' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // People Ops Partner Group rejects the request - it('8.Books Only. People Ops Partner Group rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'The goal of learning and development is to develop or change the behavior of individuals or groups for the better, sharing knowledge and insights that enable them to do their work better, or cultivate attitudes that help them perform better' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('04-02-2026'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('EYK Books'); - 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('books'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'There are many different roles that make up a learning and development team or fall' - ); - 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( - 'Learning and development is a systematic process to enhance an employee’s skills, knowledge, and competency, resulting in better performance in a work setting. \nhttps://www.aihr.com/blog/learning-and-development/' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // People Ops Partner Group request for additional details - it('9.Books Only. People Ops Partner Group needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'A L&D strategy should be aligned to the organization’s business strategy and goals with the aim of developing the workforce’s capability and driving business results.' - ); - 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('Conference LTD'); - 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('books'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Learning and development is a systematic process to enhance an employee’s skills' - ); - 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( - 'Learning, training, and development are often used interchangeably. However, there are subtle differences between these concepts, which are shown in the table below. \nhttps://www.aihr.com/blog/learning-and-development/' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'needmoreinfo' - ); - - // requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - 'providemoreinfo' - ); - - // people ops approves second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner approves and People Ops Partner Group approves the request - it('10.NOT Books Only. Budget owner approves and People Ops Partner Group approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'Learning and development is a systematic process to enhance an employee’s skills, knowledge, and competency, resulting in better performance in a work setting. \nhttps://www.aihr.com/blog/learning-and-development/' - ); - 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('The Leadership Laboratory'); - 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('on_conf'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'There are many different roles that make up a learning and development team' - ); - 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('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('course'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'The goal of learning and development is to change the behavior of individuals or groups for better' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('1355'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('books'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'A L&D strategy should be aligned to the organization’s business strategy' - ); - cy.get('#root_item_2_qty').clear().type('6'); - cy.get('#root_item_2_currency_type').select('Crypto'); - cy.get('#root_item_2_currency').select('SNT'); - cy.get('#root_item_2_unit_price').type('2300'); - - 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 L&D strategy should be aligned to the organization’s business strategy and goals with the aim of developing the workforce’s capability and driving business results.' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('11.NOT Books Only. Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'The goal of learning and development is to develop or change the behavior of individuals or groups for the better, sharing knowledge and insights that enable them to do their work better, or cultivate attitudes that help them perform better' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('14-02-2026'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Lynda.com'); - 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('course'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'The goal of learning and development is to develop or change the behavior of individuals or groups' - ); - 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( - 'Learning and development is a systematic process to enhance an employee’s skills, knowledge, and competency, resulting in better performance in a work setting. \nhttps://www.aihr.com/blog/learning-and-development/' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('12.NOT Books Only. Budget owner needs more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('learn_and_dev'); - cy.get('#root_purpose') - .clear() - .type( - 'Learning, training, and development are often used interchangeably. However, there are subtle differences between these concepts, which are shown in the table below. ' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('15-02-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Conference LTD'); - 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('on_conf'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'There are many different roles that make up a learning and development team' - ); - 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 L&D strategy should be aligned to the organization’s business strategy and goals with the aim of developing the workforce’s capability and driving business results.' - ); - - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js deleted file mode 100644 index 78eed1a9..00000000 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js +++ /dev/null @@ -1,1029 +0,0 @@ -const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype -) => { - 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') - .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. Coworking is not only about providing a physical place, but also about establishing a community. Its rapid growth has been seen as a possible way for city planners to address.' - ) - ); - } 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 3 - cy.contains('Task: Review the Request', { timeout: 60000 }); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .clear() - .type( - 'Providing additional info. Coworking tends to fall into two sides: Those that are real-estate-centric (all about selling desks and offices first) while others are community-centric (focused on building community that happens to also have offices)' - ); - - // 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(/^Continue$/) - // .click(); - // } - - cy.wait(10000); - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); -}; - -//Check if the process instance is completed successfully -const checkProcessInstanceCompleted = ( - username, - password, - processInstanceId -) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); - - cy.wait(1000); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(2000); - cy.get('#tag-1 > span').contains('complete'); -} - -describe('Other Fees Path - Without Files', () => { - Cypress._.times(1, () => { - // Budget owner approves the request - it('1.Budget owner approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('other_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Other Fees and Expenses means, collectively, all fees and expenses payable to Lenders under the Loan Documents, other than principal, interest and default interest/penalty amounts.' - ); - 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('ABC CO'); - 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('bounties'); - 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('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('coworking'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A consultant (from Latin: consultare "to deliberate") is a professional' - ); - cy.get('#root_item_1_qty').clear().type('1'); - 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('1355'); - - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('2.Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('other_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Other Fees and Expenses means, collectively, all fees and expenses payable to Lenders under the Loan Documents, other than principal, interest and default interest/penalty amounts.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('24-02-2036'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('CO-WORK ENG'); - 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('coworking'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Coworking is an arrangement in which workers for different companies share an office space' - ); - 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( - '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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('3.Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('other_fees'); - cy.get('#root_purpose') - .clear() - .type( - ' It allows cost savings and convenience through the use of common infrastructures, such as equipment, utilities and receptionist and custodial services, and in some cases refreshments and parcel services.\nhttps://en.wikipedia.org/wiki/Coworking' - ); - 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('Bounty 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('bounties'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Coworking is not only about providing a physical place, but also about establishing a community.' - ); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - -describe.only('Other Fees Path - With Files', () => { - Cypress._.times(1, () => { - // Budget owner approves the request - it('4.Budget owner approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('other_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'It allows cost savings and convenience through the use of common infrastructures, such as equipment, utilities and receptionist and custodial services, and in some cases refreshments and parcel acceptance services' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('15-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 }); -*/ - // item 0 - cy.get('#root_item_0_sub_category').select('bounties'); - 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('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('coworking'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'A consultant (from Latin: consultare "to deliberate") is a professional' - ); - cy.get('#root_item_1_qty').clear().type('1'); - cy.get('#root_item_1_currency_type').select('Crypto'); - cy.get('#root_item_1_currency').select('DAI'); - cy.get('#root_item_1_unit_price').type('4250'); - - 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.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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('5.Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('other_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'Other Fees and Expenses means, collectively, all fees and expenses payable to Lenders under the Loan Documents, other than principal, interest and default interest/penalty amounts.' - ); - 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('CO-WORK ENG'); - 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('coworking'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Coworking is not only about providing a physical place, but also about establishing a community' - ); - 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( - '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.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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('6.Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('other_fees'); - cy.get('#root_purpose') - .clear() - .type( - 'It allows cost savings and convenience through the use of common infrastructures, such as equipment, utilities and receptionist and custodial services, and in some cases refreshments and parcel services.\nhttps://en.wikipedia.org/wiki/Coworking' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('12-02-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('BOUNTY'); - 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('bounties'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Coworking is distinct from business accelerators, business incubators, and executive suites.' - ); - 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.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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js deleted file mode 100644 index ca06d16e..00000000 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js +++ /dev/null @@ -1,3562 +0,0 @@ -const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype -) => { - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); - - cy.log('=======visit find by id : '); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Tasks I can complete', { timeout: 60000 }); - - cy.get('.cds--btn').contains(/^Go$/).click(); - - // 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 3 - 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.contains('Submit the Request').click(); - // cy.get('input[value="Submit the Request"]').click(); - } else { - } - - cy.get('button') - .contains(/^Submit$/) - .click(); - - if (expectAdditionalApprovalInfoPage === 'Task: Update Application Landscape') { - cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); - - cy.get('button') - .contains(/^Continue$/) - .click(); - } - - cy.wait(10000); - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); -}; - -//Check if the process instance is completed successfully -const checkProcessInstanceCompleted = ( - username, - password, - processInstanceId -) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); - - cy.wait(1000); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(2000); - cy.get('#tag-1 > span').contains('complete'); -} - -// Software and Licenses Path - Without Files -describe('Software and Licenses Path - Without Files', () => { - Cypress._.times(1, () => { - // Everyone approves with CP - it('1.Everyone approves with CP', () => { - const username = Cypress.env('requestor_username'); - const 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.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); - const projectId = Cypress.env('project_id'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'cpapproved' - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - it('2.Everyone approves', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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('COP'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const 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' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('3.Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('4.Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'cpapproved' - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Infra reject the request - it('5.Infra rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'approve' - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - 'approve' - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - - -// Software and Licenses Path - With Files -describe.only('Software and Licenses Path - With Files', () => { - Cypress._.times(1, () => { - // Everyone approves with CP - it('6.Everyone approves with CP', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'cpapproved' - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - it('7.Everyone approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const 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' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('8.Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('9.Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'cpapproved' - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Infra rejects the request - it('10.Infra Rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const 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('COP'); - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'approve' - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - 'approve' - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - -// Software and Licenses Path - With Files and Multiple items -describe.only('Software and Licenses Path - With Files and Multiple items', () => { - Cypress._.times(1, () => { - // Everyone approves with CP - it('11.Everyone approves with CP', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'cpapproved' - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - it('12.Everyone approves', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const 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' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('13.Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('14.Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('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); - const 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'cpapproved' - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Infra rejects the request - it('15.Infra Rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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(); - - - 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('GBP'); - 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('SGD'); - 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(20000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'approve' - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - 'approve' - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - -// 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('16.Everyone approves with CP', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'cpapproved' - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - it('17.Everyone approves', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const 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' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner rejects the request - it('18.Budget owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('19.Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'cpapproved' - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Infra reject the request - it('20.Infra rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.get('input#root-procurement').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains('Request Goods or Services', { timeout: 60000 }); - - 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); - const projectId = Cypress.env('project_id'); - 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.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const ppgbasmeUsername = Cypress.env('ppgbasme_username'); - const ppgbasmePassword = Cypress.env('ppgbasme_password'); - const securitysmeUsername = Cypress.env('securitysme_username'); - const securitysmePassword = Cypress.env('securitysme_password'); - const infrasmeUsername = Cypress.env('infrasme_username'); - const infrasmePassword = Cypress.env('infrasme_password'); - const legalsmeUsername = Cypress.env('legalsme_username'); - const legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - 'approve' - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - 'approve' - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); diff --git a/spiffworkflow-frontend/cypress/pilot/RequestTravel_PP2/initiate_travelrequest.cy.js b/spiffworkflow-frontend/cypress/pilot/RequestTravel_PP2/initiate_travelrequest.cy.js deleted file mode 100644 index 692434cd..00000000 --- a/spiffworkflow-frontend/cypress/pilot/RequestTravel_PP2/initiate_travelrequest.cy.js +++ /dev/null @@ -1,2341 +0,0 @@ -const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype -) => { - 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') - .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.' - ) - ); - } 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 3 - cy.contains('Task: Review the Request', { timeout: 60000 }); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .clear() - .type( - "Providing additional info. 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 people for jobs of any size." - ); - - // 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(/^Continue$/) - .click(); - } - - cy.wait(5000); - //cy.get('button').contains('Return to Home', { timeout: 60000 }); - cy.logout(); -}; - -//Check if the process instance is completed successfully -const checkProcessInstanceCompleted = ( - username, - password, - processInstanceId -) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); - - cy.wait(1000); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(2000); - cy.get('#tag-1 > span').contains('complete'); -} - -// Request Travel - Without Files -describe.only('Request Travel - Without Files', () => { - Cypress._.times(1, () => { - // Initiate request - Team Event - Without Files - it('Initiate request - Team Event - Without Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Before you start planning your trip, make sure to check your company’s rules, procedures, and do’s & don’ts when it comes to corporate travel. Here you’ll find more information about corporate travel policies, which include things such as where to ..' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('team_event'); - //cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Great Guac Off is one of the best team building events. Participants compete in teams to perfect it.'); - - cy.get('#root_event_destination').clear('Tabaquite'); - cy.get('#root_event_destination').type('Tabaquite'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('o'); - cy.get('#root_departure_from').type('o'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('h'); - cy.get('#root_return_to').type('h'); - cy.get('#downshift-2-item-1 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Our staff can facilitate your accommodation needs from a range of Home-stay options and can also.' - ); - cy.get('#root_item_0_qty').clear().type('7'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('ETH'); - cy.get('#root_item_0_unit_price').type('1.15'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('2300'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Ensure a quality, cost effective and safe integrated transport system and services that will provi.' - ); - cy.get('#root_item_2_qty').clear().type('9'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('AUD'); - cy.get('#root_item_2_unit_price').type('1205.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'Book Your Tickets In Advance And Get A Chance To Experience Unlimited Rides On 1 Day. Experience....' - ); - cy.get('#root_item_3_qty').clear().type('18'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('SNT'); - cy.get('#root_item_3_unit_price').type('430.50'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A host brings all the ingredients, leads groups through mini-games, and encourages participants to taunt or cheer. This cookless cook-off is available in various venues. https://teambuilding.com/blog/team-building-events' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - }); - }); - // Initiate request - Conference - Without Files and with mandatory fields only - it('Initiate request - Conference - Without Files and with mandatory fields only', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Before you start planning your trip, make sure to check your company’s rules, procedures, and do’s & don’ts when it comes to corporate travel. Here you’ll find more information about corporate travel policies, which include things such as where to ..' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Great Guac Off is one of the best team building events. Participants compete in teams to perfect it.'); - - cy.get('#root_event_destination').clear('y'); - cy.get('#root_event_destination').type('yellow'); - cy.get('#downshift-0-item-3 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('c'); - cy.get('#root_departure_from').type('colombo'); - cy.get('#downshift-1-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('s'); - cy.get('#root_return_to').type('spring'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Our staff can facilitate your accommodation needs from a range of Home-stay options and can also.' - ); - cy.get('#root_item_0_qty').clear().type('7'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('ETH'); - cy.get('#root_item_0_unit_price').type('1.15'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('2300'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Ensure a quality, cost effective and safe integrated transport system and services that will provi.' - ); - cy.get('#root_item_2_qty').clear().type('9'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('AUD'); - cy.get('#root_item_2_unit_price').type('1205.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'Book Your Tickets In Advance And Get A Chance To Experience Unlimited Rides On 1 Day. Experience....' - ); - cy.get('#root_item_3_qty').clear().type('18'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('SNT'); - cy.get('#root_item_3_unit_price').type('430.50'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A host brings all the ingredients, leads groups through mini-games, and encourages participants to taunt or cheer. This cookless cook-off is available in various venues. https://teambuilding.com/blog/team-building-events' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - }); - }); - // Edit request - Meetup - Without Files - it('Edit request - Meetup - Without Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Happy hours are a go-to team social event. These gatherings involve heading to a local watering hole, setting up a bar in the office, and socializing over drinks and snacks.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('27-02-2024'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('26-02-2024'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('04-03-2024'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('The most common times for happy hours -directly after work or during the final hours of the workday.'); - - cy.get('#root_event_destination').clear('s'); - cy.get('#root_event_destination').type('sydney'); - cy.get('#downshift-0-item-2 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('o'); - cy.get('#root_departure_from').type('oslo'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('ch'); - cy.get('#root_return_to').type('chica'); - cy.get('#downshift-2-item-1 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Entertainment ideas include answering icebreaker questions, playing pool or board games.' - ); - cy.get('#root_item_0_qty').clear().type('9'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('CHF'); - cy.get('#root_item_0_unit_price').type('140.65'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'You could assign a theme or leave the event more free-form encourage teammates to chat with peers.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('CNY'); - cy.get('#root_item_1_unit_price').type('5689'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Edit Request$/) - .click(); - - // Form 1 - cy.contains('Task: Submit Details', { timeout: 60000 }); - cy.wait(2000); - cy.get('button') - .contains(/^Submit$/) - .click(); - - // Form 2 - cy.contains('Task: Review the Request', { timeout: 60000 }); - - cy.get('.cds--text-area__wrapper').find('#root').type('EDITING INFO'); - }); - }); - // Save and Close All fields Form 1 - All Hands - Without Files - it('Save and Close All fields - All Hands - Without Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Scavenger hunts are among the most high-energy team building events. These games are customizable to fit various venues and occasions.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core2 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Most scavenger hunts involve players getting into groups and racing against each other to find clue.'); - - cy.get('#root_event_destination').clear('h'); - cy.get('#root_event_destination').type('houst'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('ma'); - cy.get('#root_departure_from').type('madrid'); - cy.get('#downshift-1-item-5 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('ma'); - cy.get('#root_return_to').type('madrid'); - cy.get('#downshift-2-item-5 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Examples might include “find a statue that reminds you of your boss,” ' - ); - cy.get('#root_item_0_qty').clear().type('12'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('DAI'); - cy.get('#root_item_0_unit_price').type('986'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - '“show the oldest coin within your group’s wallets,” or “recreate the Crossing of the Delaware in.”' - ); - cy.get('#root_item_1_qty').clear().type('4'); - 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.05'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'typically, scavenger hunts have a theme and a time limit.' - ); - cy.get('#root_item_2_qty').clear().type('5'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('NZD'); - cy.get('#root_item_2_unit_price').type('976.75'); - - cy.get('button') - .contains(/^Save and Close$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - - }); - }); - - // Save and Close Few fields Form 1 - Meetup - Without Files - it('Save and Close Few fields - Meetup - Without Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Escape rooms are one of the most popular team building events for small groups. In these games, participants usually enter a locked themed room and have a limited time to find clues and solve a mystery to escape and win the game.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('12-11-2024'); - cy.get('body').click(); - //cy.get('#root_core_contributor').clear().type('Core3 Contributor'); - cy.get('#root_start_date').clear().type('10-11-2024'); - cy.get('body').click(); - //cy.get('#root_end_date').clear().type('14-11-2024'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - //cy.get('#root_event_name').clear().type('These challenges require team members to collaborate, communicate clearly, think critically.'); - - cy.get('#root_event_destination').clear('me'); - cy.get('#root_event_destination').type('melbo'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - //cy.get('#root_departure_from').clear('c'); - //cy.get('#root_departure_from').type('copen'); - //cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('l'); - cy.get('#root_return_to').type('london'); - cy.get('#downshift-2-item-2 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Entertainment venues like malls often host these attractions, and there are usually at least one.' - ); - 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('COP'); - //cy.get('#root_item_0_unit_price').type('3489'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - - - cy.get('button') - .contains(/^Save and Close$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Save and Close Form 2 - Team Event - Without Files - it('Save and Close Form 2 - Team Event - Without Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Beach parties are a beloved summertime activity for work. These events allow employees to get out of the office and enjoy fresh air and sunshine.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('17-12-2023'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core4 Contributor'); - cy.get('#root_start_date').clear().type('06-12-2023'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('24-12-2023'); - cy.get('body').click(); - cy.get('#root_event_type').select('team_event'); - //cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('You can take your staff on a trip to the beach.'); - - cy.get('#root_event_destination').clear('b'); - cy.get('#root_event_destination').type('bergen'); - cy.get('#downshift-0-item-9 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear(); - cy.get('#root_departure_from').type('bern'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('B'); - cy.get('#root_return_to').type('Bern'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Create a beach-like atmosphere in your party space by handing out leis and serving tropical drinks.' - ); - cy.get('#root_item_0_qty').clear().type('3'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('ETH'); - cy.get('#root_item_0_unit_price').type('0.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Some ideas include putting up a volleyball net, handing out branded beach balls and sunglasses.' - ); - 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('EUR'); - cy.get('#root_item_1_unit_price').type('235'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'As a bonding exercise you can ask teammates to submit photos of their favorite beach or dream beach.' - ); - cy.get('#root_item_2_qty').clear().type('9'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('GBP'); - cy.get('#root_item_2_unit_price').type('765.35'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'Beach parties are a beloved summertime activity for work' - ); - cy.get('#root_item_3_qty').clear().type('25'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('DAI'); - cy.get('#root_item_3_unit_price').type('245'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'You can take your staff on a trip to the beach or create a beach-like atmosphere in your party space by handing out leis and serving tropical drinks. Some ideas include putting up a volleyball net, handing out branded beach balls and sunglasses.' - ); - - cy.get('button') - .contains(/^Save and Close$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Cancel request Form 1 - Conference - Without Files - it('Cancel request Form 1 - Conference - Without Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('High'); - //cy.get('#root_period').clear().type('30-03-2026'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core5 Contributor'); - //cy.get('#root_start_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('01-04-2026'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - //cy.get('#root_event_destination').clear('mi'); - //cy.get('#root_event_destination').type('miami'); - //cy.get('#downshift-0-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('mi'); - cy.get('#root_departure_from').type('milano'); - cy.get('#downshift-1-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('z'); - cy.get('#root_return_to').type('z'); - cy.get('#downshift-2-item-3 > .cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('8'); - //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('2680'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - //Item 1 is not filled - - cy.get('button') - .contains(/^Cancel Request$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Cancel request Form 2 - Conference - Without Files - it('Cancel request Form 2 - Conference - Without Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core2 Contributor'); - cy.get('#root_start_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('Zürich'); - cy.get('#root_event_destination').type('Zürich'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('t'); - cy.get('#root_departure_from').type('trondh'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('S'); - cy.get('#root_return_to').type('New york'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('12'); - 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('2355.25'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('HKD'); - cy.get('#root_item_1_unit_price').type('4325'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Cancel Request$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Arrange items order - it('Arrange items order', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('05-11-2027'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('30-10-2027'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('07-11-2027'); - cy.get('body').click(); - cy.get('#root_event_type').select('team_event'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('st'); - cy.get('#root_event_destination').type('stockh'); - cy.get('#downshift-0-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('s'); - cy.get('#root_departure_from').type('san die'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('s'); - cy.get('#root_return_to').type('san diego'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - '1.Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.' - ); - cy.get('#root_item_0_qty').clear().type('12'); - 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('1450.32'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - '2.Now you have all you need for your seamless flight. With a variety of services such as Ticket.' - ); - 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('AED'); - cy.get('#root_item_1_unit_price').type('1980'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - '3. Typically, scavenger hunts have a theme and a time limit.' - ); - cy.get('#root_item_2_qty').clear().type('5'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('NZD'); - cy.get('#root_item_2_unit_price').type('976.75'); - - cy.get('#root_item > 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').click(); - cy.get('#root_item > 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').click(); - - cy.wait(2000); - - cy.get('#root_item > div.row.array-item-list > div:nth-child(1) > 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-down').click(); - cy.get('#root_item > 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-down').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Delete items - it('Delete items', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Scavenger hunts are among the most high-energy team building events. These games are customizable to fit various venues and occasions.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core2 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Most scavenger hunts involve players getting into groups and racing against each other to find clue.'); - - cy.get('#root_event_destination').clear('h'); - cy.get('#root_event_destination').type('houst'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('ma'); - cy.get('#root_departure_from').type('madrid'); - cy.get('#downshift-1-item-5 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('ma'); - cy.get('#root_return_to').type('madrid'); - cy.get('#downshift-2-item-5 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - '1.Examples might include “find a statue that reminds you of your boss” ' - ); - cy.get('#root_item_0_qty').clear().type('12'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('DAI'); - cy.get('#root_item_0_unit_price').type('986'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - '2.“show the oldest coin within your group’s wallets,” or “recreate the Crossing of the Delaware in.”' - ); - cy.get('#root_item_1_qty').clear().type('4'); - 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.05'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - '3. Typically, scavenger hunts have a theme and a time limit.' - ); - cy.get('#root_item_2_qty').clear().type('5'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('NZD'); - cy.get('#root_item_2_unit_price').type('976.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - '4.Beach parties are a beloved summertime activity for work.' - ); - cy.get('#root_item_3_qty').clear().type('25'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('DAI'); - cy.get('#root_item_3_unit_price').type('245'); - - //delete first and third items - cy.get('#root_item > 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-danger.array-item-remove').click(); - cy.get('#root_item > div.row.array-item-list > div:nth-child(1) > 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-danger.array-item-remove').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - '4.At the end of the game, the group that completes the most tasks or finds the most items wins the game and earns prize.' - ); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - -// Form validation -describe('Form validation', () => { - - //Special character check - it('Special character check', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Purpose is to test all the special characters work in the request. ~!@#$%^&*()_+`-= {}[]\a and ;\',./:"<>? end. | this text goes missing', { parseSpecialCharSequences: false } - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core2 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Special char test ,./;\'[]\b=-0987654321`~!@#$%^&*()_+{}:"<>? end.', { parseSpecialCharSequences: false }); - - cy.get('#root_event_destination').clear('Tromsø'); - cy.get('#root_event_destination').type('Tromsø'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('Ålesund'); - cy.get('#root_departure_from').type('Ålesund'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('Neuchâtel'); - cy.get('#root_return_to').type('Neuchâtel'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Special char test ,./;\'[]\=-0987654321`~!@#$%^&*()_+{}:"<>? end.', { parseSpecialCharSequences: false } - ); - cy.get('#root_item_0_qty').clear().type('12'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('DAI'); - cy.get('#root_item_0_unit_price').type('986'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'Test Special chars afssfsfs,asfdf. sfsf? sfd/sfs f:sfsf " sfsdf; SDFfsd\' sfsdf{sfsfs} sfsdf[ sfsdf] fsfsfd\ sfsd sfsdf=S dfs+ sfd- sfsdf_ sfsfd (sfsd )sfsfsd * sf&sfsfs ^ sfs % sf $ ss# s@ sf! sfd` ss~ END.', { parseSpecialCharSequences: false } - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - - //Check field max lengths - it('Check field max lengths', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'It’s easy to keep connected with others during online events. Online events are virtual, accessible, entertaining, and a great way to make new friends. Meetup has online events on topics like gaming, music, technology, networking, wellness, or whatever.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('27-02-2024'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('26-02-2024'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('04-03-2024'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('The most common times for happy hours -directly after work or during the final hours of the workday..'); - - cy.get('#root_event_destination').clear('s'); - cy.get('#root_event_destination').type('sydney'); - cy.get('#downshift-0-item-2 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('o'); - cy.get('#root_departure_from').type('oslo'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('ch'); - cy.get('#root_return_to').type('chica'); - cy.get('#downshift-2-item-1 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Entertainment ideas include answering icebreaker questions, playing pool or board games.1234567890123' - ); - cy.get('#root_item_0_qty').clear().type('9'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('CHF'); - cy.get('#root_item_0_unit_price').type('140.654'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'You could assign a theme or leave the event more free-form encourage teammates to chat with peers...' - ); - cy.get('#root_item_1_qty').clear().type('4'); - cy.get('#root_item_1_currency_type').select('Crypto'); - cy.get('#root_item_1_currency').select('DAI'); - cy.get('#root_item_1_unit_price').type('5689.1234'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'It’s easy to keep connected with others during online events. Online events are virtual, accessible, entertaining, and a great way to make new friends. Meetup has online events on topics like gaming, music, technology, networking, wellness, or whatever you’re looking for!' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); -}); - -// Request Travel - With Files -describe('Request Travel - With Files', () => { - Cypress._.times(1, () => { - // Initiate request - Team Event - With Files - it('Initiate request - Team Event - With Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Before you start planning your trip, make sure to check your company’s rules, procedures, and do’s & don’ts when it comes to corporate travel. Here you’ll find more information about corporate travel policies, which include things such as where to ..' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('team_event'); - //cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Great Guac Off is one of the best team building events. Participants compete in teams to perfect it.'); - - cy.get('#root_event_destination').clear('y'); - cy.get('#root_event_destination').type('yellow'); - cy.get('#downshift-0-item-3 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('c'); - cy.get('#root_departure_from').type('colombo'); - cy.get('#downshift-1-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('s'); - cy.get('#root_return_to').type('spring'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Our staff can facilitate your accommodation needs from a range of Home-stay options and can also.' - ); - cy.get('#root_item_0_qty').clear().type('7'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('ETH'); - cy.get('#root_item_0_unit_price').type('1.15'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('2300'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Ensure a quality, cost effective and safe integrated transport system and services that will provi.' - ); - cy.get('#root_item_2_qty').clear().type('9'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('AUD'); - cy.get('#root_item_2_unit_price').type('1205.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'Book Your Tickets In Advance And Get A Chance To Experience Unlimited Rides On 1 Day. Experience....' - ); - cy.get('#root_item_3_qty').clear().type('18'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('SNT'); - cy.get('#root_item_3_unit_price').type('430.50'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A host brings all the ingredients, leads groups through mini-games, and encourages participants to taunt or cheer. This cookless cook-off is available in various venues. https://teambuilding.com/blog/team-building-events' - ); - - 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.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - }); - }); - - // Edit request - Meetup - With Files - it('Edit request - Meetup - With Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Happy hours are a go-to team social event. These gatherings involve heading to a local watering hole, setting up a bar in the office, and socializing over drinks and snacks.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('27-02-2024'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('26-02-2024'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('04-03-2024'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('The most common times for happy hours -directly after work or during the final hours of the workday.'); - - cy.get('#root_event_destination').clear('s'); - cy.get('#root_event_destination').type('sydney'); - cy.get('#downshift-0-item-2 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('o'); - cy.get('#root_departure_from').type('oslo'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('ch'); - cy.get('#root_return_to').type('chica'); - cy.get('#downshift-2-item-1 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Entertainment ideas include answering icebreaker questions, playing pool or board games.' - ); - cy.get('#root_item_0_qty').clear().type('9'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('CHF'); - cy.get('#root_item_0_unit_price').type('140.65'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'You could assign a theme or leave the event more free-form encourage teammates to chat with peers.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('CNY'); - cy.get('#root_item_1_unit_price').type('5689'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - 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.get('button') - .contains(/^Edit Request$/) - .click(); - - // Form 1 - cy.contains('Task: Submit Details', { timeout: 60000 }); - cy.wait(2000); - cy.get('button') - .contains(/^Submit$/) - .click(); - - // Form 2 - cy.contains('Task: Review the Request', { timeout: 60000 }); - - cy.get('.cds--text-area__wrapper').find('#root').type('EDITING INFO'); - }); - }); - - // Save and Close Form 2 - Team Event - With Files - it('Save and Close Form 2 - Team Event - With Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Beach parties are a beloved summertime activity for work. These events allow employees to get out of the office and enjoy fresh air and sunshine.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('17-12-2023'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core4 Contributor'); - cy.get('#root_start_date').clear().type('06-12-2023'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('24-12-2023'); - cy.get('body').click(); - cy.get('#root_event_type').select('team_event'); - //cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('You can take your staff on a trip to the beach.'); - - cy.get('#root_event_destination').clear('b'); - cy.get('#root_event_destination').type('bergen'); - cy.get('#downshift-0-item-9 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear(); - cy.get('#root_departure_from').type('bern'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('B'); - cy.get('#root_return_to').type('Bern'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Create a beach-like atmosphere in your party space by handing out leis and serving tropical drinks.' - ); - cy.get('#root_item_0_qty').clear().type('3'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('ETH'); - cy.get('#root_item_0_unit_price').type('0.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Some ideas include putting up a volleyball net, handing out branded beach balls and sunglasses.' - ); - 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('EUR'); - cy.get('#root_item_1_unit_price').type('235'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'As a bonding exercise you can ask teammates to submit photos of their favorite beach or dream beach.' - ); - cy.get('#root_item_2_qty').clear().type('9'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('GBP'); - cy.get('#root_item_2_unit_price').type('765.35'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'Beach parties are a beloved summertime activity for work' - ); - cy.get('#root_item_3_qty').clear().type('25'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('DAI'); - cy.get('#root_item_3_unit_price').type('245'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'You can take your staff on a trip to the beach or create a beach-like atmosphere in your party space by handing out leis and serving tropical drinks. Some ideas include putting up a volleyball net, handing out branded beach balls and sunglasses.' - ); - - 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.get('button') - .contains(/^Save and Close$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - }); - }); - - // Cancel request Form 2 - Conference - With Files - it('Cancel request Form 2 - Conference - With Files', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core2 Contributor'); - cy.get('#root_start_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('Zürich'); - cy.get('#root_event_destination').type('Zürich'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('t'); - cy.get('#root_departure_from').type('trondh'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('S'); - cy.get('#root_return_to').type('New york'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('12'); - 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('2355.25'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('HKD'); - cy.get('#root_item_1_unit_price').type('4325'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - 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.get('button') - .contains(/^Cancel Request$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - }); - }); - }); -}); \ No newline at end of file diff --git a/spiffworkflow-frontend/cypress/pilot/RequestTravel_PP2/requesttravel.cy.js b/spiffworkflow-frontend/cypress/pilot/RequestTravel_PP2/requesttravel.cy.js deleted file mode 100644 index d53ef385..00000000 --- a/spiffworkflow-frontend/cypress/pilot/RequestTravel_PP2/requesttravel.cy.js +++ /dev/null @@ -1,3411 +0,0 @@ -const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype -) => { - 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') - .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.' - ) - ); - } 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 3 - cy.contains('Task: Review the Request', { timeout: 60000 }); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .clear() - .type( - "Providing additional info. 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 people for jobs of any size." - ); - - // 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(/^Continue$/) - .click(); - } - - cy.wait(5000); - //cy.get('button').contains('Return to Home', { timeout: 60000 }); - cy.logout(); -}; - -//Check if the process instance is completed successfully -const checkProcessInstanceCompleted = ( - username, - password, - processInstanceId -) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); - - cy.wait(1000); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(2000); - cy.get('#tag-1 > span').contains('complete'); -} - -// Request Travel - Without Files -describe('Request Travel - Without Files', () => { - Cypress._.times(1, () => { - // Everyone approves the request - Team Event - it('Everyone approves - Team Event', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Before you start planning your trip, make sure to check your company’s rules, procedures, and do’s & don’ts when it comes to corporate travel. Here you’ll find more information about corporate travel policies, which include things such as where to ..' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('team_event'); - //cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Great Guac Off is one of the best team building events. Participants compete in teams to perfect it.'); - - cy.get('#root_event_destination').clear('y'); - cy.get('#root_event_destination').type('yellow'); - cy.get('#downshift-0-item-3 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('c'); - cy.get('#root_departure_from').type('colombo'); - cy.get('#downshift-1-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('s'); - cy.get('#root_return_to').type('spring'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Our staff can facilitate your accommodation needs from a range of Home-stay options and can also.' - ); - cy.get('#root_item_0_qty').clear().type('7'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('ETH'); - cy.get('#root_item_0_unit_price').type('1.15'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('2300'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Ensure a quality, cost effective and safe integrated transport system and services that will provi.' - ); - cy.get('#root_item_2_qty').clear().type('9'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('AUD'); - cy.get('#root_item_2_unit_price').type('1205.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'Book Your Tickets In Advance And Get A Chance To Experience Unlimited Rides On 1 Day. Experience....' - ); - cy.get('#root_item_3_qty').clear().type('18'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('SNT'); - cy.get('#root_item_3_unit_price').type('430.50'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A host brings all the ingredients, leads groups through mini-games, and encourages participants to taunt or cheer. This cookless cook-off is available in various venues. https://teambuilding.com/blog/team-building-events' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - Conference - it('Everyone approves - Conference', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('05-11-2027'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('30-10-2027'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('07-11-2027'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('st'); - cy.get('#root_event_destination').type('stockh'); - cy.get('#downshift-0-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('s'); - cy.get('#root_departure_from').type('san die'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('s'); - cy.get('#root_return_to').type('san diego'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('12'); - 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('1450.32'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - 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('AED'); - cy.get('#root_item_1_unit_price').type('1980'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - Meetup - it('Everyone approves - Meetup', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Happy hours are a go-to team social event. These gatherings involve heading to a local watering hole, setting up a bar in the office, and socializing over drinks and snacks.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('27-02-2024'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('26-02-2024'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('04-03-2024'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('The most common times for happy hours -directly after work or during the final hours of the workday.'); - - cy.get('#root_event_destination').clear('s'); - cy.get('#root_event_destination').type('sydney'); - cy.get('#downshift-0-item-2 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('o'); - cy.get('#root_departure_from').type('oslo'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('ch'); - cy.get('#root_return_to').type('chica'); - cy.get('#downshift-2-item-1 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Entertainment ideas include answering icebreaker questions, playing pool or board games.' - ); - cy.get('#root_item_0_qty').clear().type('9'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('CHF'); - cy.get('#root_item_0_unit_price').type('140.65'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'You could assign a theme or leave the event more free-form encourage teammates to chat with peers.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('CNY'); - cy.get('#root_item_1_unit_price').type('5689'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - All Hands - it('Everyone approves - All Hands', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Scavenger hunts are among the most high-energy team building events. These games are customizable to fit various venues and occasions.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core2 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Most scavenger hunts involve players getting into groups and racing against each other to find clue.'); - - cy.get('#root_event_destination').clear('h'); - cy.get('#root_event_destination').type('houst'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('ma'); - cy.get('#root_departure_from').type('madrid'); - cy.get('#downshift-1-item-5 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('ma'); - cy.get('#root_return_to').type('madrid'); - cy.get('#downshift-2-item-5 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Examples might include “find a statue that reminds you of your boss,” ' - ); - cy.get('#root_item_0_qty').clear().type('12'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('DAI'); - cy.get('#root_item_0_unit_price').type('986'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - '“show the oldest coin within your group’s wallets,” or “recreate the Crossing of the Delaware in.”' - ); - cy.get('#root_item_1_qty').clear().type('4'); - 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.05'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'typically, scavenger hunts have a theme and a time limit.' - ); - cy.get('#root_item_2_qty').clear().type('5'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('NZD'); - cy.get('#root_item_2_unit_price').type('976.75'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'At the end of the game, the group that completes the most tasks or finds the most items wins the game and earns a prize.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budges Owner rejects the request - it('Budges Owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Escape rooms are one of the most popular team building events for small groups. In these games, participants usually enter a locked themed room and have a limited time to find clues and solve a mystery to escape and win the game.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('12-11-2024'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core3 Contributor'); - cy.get('#root_start_date').clear().type('10-11-2024'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('14-11-2024'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('These challenges require team members to collaborate, communicate clearly, think critically.'); - - cy.get('#root_event_destination').clear('me'); - cy.get('#root_event_destination').type('melbo'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('c'); - cy.get('#root_departure_from').type('copen'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('l'); - cy.get('#root_return_to').type('london'); - cy.get('#downshift-2-item-2 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Entertainment venues like malls often host these attractions, and there are usually at least one.' - ); - 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('COP'); - cy.get('#root_item_0_unit_price').type('3489'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'You could assign a theme or leave the event more free-form encourage teammates to chat with peers.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - 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('5977'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'reject' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // People Ops rejects the request - it('People Ops rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Beach parties are a beloved summertime activity for work. These events allow employees to get out of the office and enjoy fresh air and sunshine.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('17-12-2023'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core4 Contributor'); - cy.get('#root_start_date').clear().type('06-12-2023'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('24-12-2023'); - cy.get('body').click(); - cy.get('#root_event_type').select('team_event'); - //cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('You can take your staff on a trip to the beach.'); - - cy.get('#root_event_destination').clear('b'); - cy.get('#root_event_destination').type('bergen'); - cy.get('#downshift-0-item-9 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear(); - cy.get('#root_departure_from').type('bern'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('B'); - cy.get('#root_return_to').type('Bern'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Create a beach-like atmosphere in your party space by handing out leis and serving tropical drinks.' - ); - cy.get('#root_item_0_qty').clear().type('3'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('ETH'); - cy.get('#root_item_0_unit_price').type('0.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Some ideas include putting up a volleyball net, handing out branded beach balls and sunglasses.' - ); - 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('EUR'); - cy.get('#root_item_1_unit_price').type('235'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'As a bonding exercise you can ask teammates to submit photos of their favorite beach or dream beach.' - ); - cy.get('#root_item_2_qty').clear().type('9'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('GBP'); - cy.get('#root_item_2_unit_price').type('765.35'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'Beach parties are a beloved summertime activity for work' - ); - cy.get('#root_item_3_qty').clear().type('25'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('DAI'); - cy.get('#root_item_3_unit_price').type('245'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'You can take your staff on a trip to the beach or create a beach-like atmosphere in your party space by handing out leis and serving tropical drinks. Some ideas include putting up a volleyball net, handing out branded beach balls and sunglasses.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'reject' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('30-03-2026'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core5 Contributor'); - cy.get('#root_start_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('01-04-2026'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('mi'); - cy.get('#root_event_destination').type('miami'); - cy.get('#downshift-0-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('mi'); - cy.get('#root_departure_from').type('milano'); - cy.get('#downshift-1-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('z'); - cy.get('#root_return_to').type('z'); - cy.get('#downshift-2-item-3 > .cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('8'); - 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('2680'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - cy.get('#root_item_1_qty').clear().type('3'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('SGD'); - cy.get('#root_item_1_unit_price').type('685'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // People Ops request for additional details - it('People Ops need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core2 Contributor'); - cy.get('#root_start_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('Zürich'); - cy.get('#root_event_destination').type('Zürich'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('t'); - cy.get('#root_departure_from').type('trondh'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('S'); - cy.get('#root_return_to').type('New york'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('12'); - 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('2355.25'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('HKD'); - cy.get('#root_item_1_unit_price').type('4325'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - 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' - ); - - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details in first round and People Ops request for additional details in second round - it('Budget owner and People Ops need more info in two rounds', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('31-10-2024'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core10 Contributor'); - cy.get('#root_start_date').clear().type('29-10-2024'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('05-01-2025'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('t'); - cy.get('#root_event_destination').type('tokyo'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('b'); - cy.get('#root_departure_from').type('beij'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('s'); - cy.get('#root_return_to').type('shanghai'); - cy.get('.cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('3'); - 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('2680'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - cy.get('#root_item_1_qty').clear().type('8'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('USD'); - cy.get('#root_item_1_unit_price').type('680.50'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'needmoreinfo' - ); - - // requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - 'providemoreinfo' - ); - - // budget owner approves third time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - // people ops approves third time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details and People Ops rejects - it('Budget owner request for additional details and People Ops rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('30-03-2026'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core5 Contributor'); - cy.get('#root_start_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('01-04-2026'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('mi'); - cy.get('#root_event_destination').type('miami'); - cy.get('#downshift-0-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('mi'); - cy.get('#root_departure_from').type('milano'); - cy.get('#downshift-1-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('z'); - cy.get('#root_return_to').type('z'); - cy.get('#downshift-2-item-3 > .cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('8'); - 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('2680'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - 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('AED'); - cy.get('#root_item_1_unit_price').type('1980'); - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(6000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - -// Request Travel - With Files -describe.only('Request Travel - With Files', () => { - Cypress._.times(1, () => { - // Everyone approves the request - Team Event - it('Everyone approves - Team Event', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Before you start planning your trip, make sure to check your company’s rules, procedures, and do’s & don’ts when it comes to corporate travel. Here you’ll find more information about corporate travel policies, which include things such as where to ..' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('team_event'); - //cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Great Guac Off is one of the best team building events. Participants compete in teams to perfect it.'); - - cy.get('#root_event_destination').clear('y'); - cy.get('#root_event_destination').type('yellow'); - cy.get('#downshift-0-item-3 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('c'); - cy.get('#root_departure_from').type('colombo'); - cy.get('#downshift-1-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('s'); - cy.get('#root_return_to').type('spring'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Our staff can facilitate your accommodation needs from a range of Home-stay options and can also.' - ); - cy.get('#root_item_0_qty').clear().type('7'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('ETH'); - cy.get('#root_item_0_unit_price').type('1.15'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - 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('CAD'); - cy.get('#root_item_1_unit_price').type('2300'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'Ensure a quality, cost effective and safe integrated transport system and services that will provi.' - ); - cy.get('#root_item_2_qty').clear().type('9'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('AUD'); - cy.get('#root_item_2_unit_price').type('1205.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'Book Your Tickets In Advance And Get A Chance To Experience Unlimited Rides On 1 Day. Experience....' - ); - cy.get('#root_item_3_qty').clear().type('18'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('SNT'); - cy.get('#root_item_3_unit_price').type('430.50'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A host brings all the ingredients, leads groups through mini-games, and encourages participants to taunt or cheer. This cookless cook-off is available in various venues. https://teambuilding.com/blog/team-building-events' - ); - - 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(2000); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - Conference - it('Everyone approves - Conference', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('05-11-2027'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('30-10-2027'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('07-11-2027'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('st'); - cy.get('#root_event_destination').type('stockh'); - cy.get('#downshift-0-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('s'); - cy.get('#root_departure_from').type('san die'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('s'); - cy.get('#root_return_to').type('san diego'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('12'); - 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('1450.32'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - 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('AED'); - cy.get('#root_item_1_unit_price').type('1980'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - 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(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.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - Meetup - it('Everyone approves - Meetup', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Happy hours are a go-to team social event. These gatherings involve heading to a local watering hole, setting up a bar in the office, and socializing over drinks and snacks.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('27-02-2024'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core1 Contributor'); - cy.get('#root_start_date').clear().type('26-02-2024'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('04-03-2024'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('The most common times for happy hours -directly after work or during the final hours of the workday.'); - - cy.get('#root_event_destination').clear('s'); - cy.get('#root_event_destination').type('sydney'); - cy.get('#downshift-0-item-2 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('o'); - cy.get('#root_departure_from').type('oslo'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('ch'); - cy.get('#root_return_to').type('chica'); - cy.get('#downshift-2-item-1 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Entertainment ideas include answering icebreaker questions, playing pool or board games.' - ); - cy.get('#root_item_0_qty').clear().type('9'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('CHF'); - cy.get('#root_item_0_unit_price').type('140.65'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'You could assign a theme or leave the event more free-form encourage teammates to chat with peers.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('CNY'); - cy.get('#root_item_1_unit_price').type('5689'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - 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.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Everyone approves the request - All Hands - it('Everyone approves - All Hands', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Scavenger hunts are among the most high-energy team building events. These games are customizable to fit various venues and occasions.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('17-09-2028'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core2 Contributor'); - cy.get('#root_start_date').clear().type('14-09-2028'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('20-09-2028'); - cy.get('body').click(); - cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Most scavenger hunts involve players getting into groups and racing against each other to find clue.'); - - cy.get('#root_event_destination').clear('h'); - cy.get('#root_event_destination').type('houst'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('ma'); - cy.get('#root_departure_from').type('madrid'); - cy.get('#downshift-1-item-5 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('ma'); - cy.get('#root_return_to').type('madrid'); - cy.get('#downshift-2-item-5 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Examples might include “find a statue that reminds you of your boss,” ' - ); - cy.get('#root_item_0_qty').clear().type('12'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('DAI'); - cy.get('#root_item_0_unit_price').type('986'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - '“show the oldest coin within your group’s wallets,” or “recreate the Crossing of the Delaware in.”' - ); - cy.get('#root_item_1_qty').clear().type('4'); - 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.05'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'typically, scavenger hunts have a theme and a time limit.' - ); - cy.get('#root_item_2_qty').clear().type('5'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('NZD'); - cy.get('#root_item_2_unit_price').type('976.75'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'At the end of the game, the group that completes the most tasks or finds the most items wins the game and earns a prize.' - ); - - 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(['sampletext.txt']); - 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(2000); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budges Owner rejects the request - it('Budges Owner rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Escape rooms are one of the most popular team building events for small groups. In these games, participants usually enter a locked themed room and have a limited time to find clues and solve a mystery to escape and win the game.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('12-11-2024'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core3 Contributor'); - cy.get('#root_start_date').clear().type('10-11-2024'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('14-11-2024'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('These challenges require team members to collaborate, communicate clearly, think critically.'); - - cy.get('#root_event_destination').clear('me'); - cy.get('#root_event_destination').type('melbo'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('c'); - cy.get('#root_departure_from').type('copen'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('l'); - cy.get('#root_return_to').type('london'); - cy.get('#downshift-2-item-2 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Entertainment venues like malls often host these attractions, and there are usually at least one.' - ); - 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('COP'); - cy.get('#root_item_0_unit_price').type('3489'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'You could assign a theme or leave the event more free-form encourage teammates to chat with peers.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - 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('5977'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get('input[type=file]').attachFile(['sampletext.txt']); - cy.wait(2000); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'reject' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // People Ops rejects the request - it('People Ops rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Beach parties are a beloved summertime activity for work. These events allow employees to get out of the office and enjoy fresh air and sunshine.' - ); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('17-12-2023'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core4 Contributor'); - cy.get('#root_start_date').clear().type('06-12-2023'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('24-12-2023'); - cy.get('body').click(); - cy.get('#root_event_type').select('team_event'); - //cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('You can take your staff on a trip to the beach.'); - - cy.get('#root_event_destination').clear('b'); - cy.get('#root_event_destination').type('bergen'); - cy.get('#downshift-0-item-9 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear(); - cy.get('#root_departure_from').type('bern'); - cy.get('#downshift-1-item-0 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('B'); - cy.get('#root_return_to').type('Bern'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Create a beach-like atmosphere in your party space by handing out leis and serving tropical drinks.' - ); - cy.get('#root_item_0_qty').clear().type('3'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('ETH'); - cy.get('#root_item_0_unit_price').type('0.75'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Some ideas include putting up a volleyball net, handing out branded beach balls and sunglasses.' - ); - 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('EUR'); - cy.get('#root_item_1_unit_price').type('235'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 2 - cy.get('#root_item_2_sub_category').select('transport'); - cy.get('#root_item_2_item_name') - .clear() - .type( - 'As a bonding exercise you can ask teammates to submit photos of their favorite beach or dream beach.' - ); - cy.get('#root_item_2_qty').clear().type('9'); - cy.get('#root_item_2_currency_type').select('Fiat'); - cy.get('#root_item_2_currency').select('GBP'); - cy.get('#root_item_2_unit_price').type('765.35'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 3 - cy.get('#root_item_3_sub_category').select('tickets'); - cy.get('#root_item_3_item_name') - .clear() - .type( - 'Beach parties are a beloved summertime activity for work' - ); - cy.get('#root_item_3_qty').clear().type('25'); - cy.get('#root_item_3_currency_type').select('Crypto'); - cy.get('#root_item_3_currency').select('DAI'); - cy.get('#root_item_3_unit_price').type('245'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'You can take your staff on a trip to the beach or create a beach-like atmosphere in your party space by handing out leis and serving tropical drinks. Some ideas include putting up a volleyball net, handing out branded beach balls and sunglasses.' - ); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get('input[type=file]').attachFile(['sampletext.txt']); - cy.wait(2000); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'reject' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details - it('Budget owner need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('30-03-2026'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core5 Contributor'); - cy.get('#root_start_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('01-04-2026'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('mi'); - cy.get('#root_event_destination').type('miami'); - cy.get('#downshift-0-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('mi'); - cy.get('#root_departure_from').type('milano'); - cy.get('#downshift-1-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('z'); - cy.get('#root_return_to').type('z'); - cy.get('#downshift-2-item-3 > .cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('8'); - 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('2680'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - cy.get('#root_item_1_qty').clear().type('3'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('SGD'); - cy.get('#root_item_1_unit_price').type('685'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get('input[type=file]').attachFile(['sampletext.txt']); - cy.wait(2000); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // People Ops request for additional details - it.only('People Ops need more info', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core2 Contributor'); - cy.get('#root_start_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('Zürich'); - cy.get('#root_event_destination').type('Zürich'); - cy.get('#downshift-0-item-6 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('t'); - cy.get('#root_departure_from').type('trondh'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('S'); - cy.get('#root_return_to').type('New york'); - cy.get('#downshift-2-item-0 > .cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('12'); - 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('2355.25'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - cy.get('#root_item_1_qty').clear().type('4'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('HKD'); - cy.get('#root_item_1_unit_price').type('4325'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get('input[type=file]').attachFile(['sampletext.txt']); - cy.wait(2000); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log(`=====budgetOwnerUsername : ${budgetOwnerUsername}`); - cy.log(`=====budgetOwnerPassword : ${budgetOwnerPassword}`); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - 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' - ); - - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details in first round and People Ops request for additional details in second round - it('Budget owner and People Ops need more info in two rounds', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('31-10-2024'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core10 Contributor'); - cy.get('#root_start_date').clear().type('29-10-2024'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('05-01-2025'); - cy.get('body').click(); - cy.get('#root_event_type').select('conf'); - //cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('t'); - cy.get('#root_event_destination').type('tokyo'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('b'); - cy.get('#root_departure_from').type('beij'); - cy.get('.cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('s'); - cy.get('#root_return_to').type('shanghai'); - cy.get('.cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('3'); - 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('2680'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - cy.get('#root_item_1_qty').clear().type('8'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('USD'); - cy.get('#root_item_1_unit_price').type('680.50'); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get('input[type=file]').attachFile(['sampletext.txt']); - cy.wait(2000); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'needmoreinfo' - ); - - // requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - 'providemoreinfo' - ); - - // budget owner approves third time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'approve' - ); - - // people ops approves third time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'approve' - ); - - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - - // Budget owner request for additional details and People Ops rejects - it('Budget owner request for additional details and People Ops rejects', () => { - const username = Cypress.env('requestor_username'); - const 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('Coming soon - Request Travel').click(); - - cy.runPrimaryBpmnFile(true); - - cy.contains('Coming soon - Request Travel', { 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); - const projectId = Cypress.env('project_id'); - cy.wait(2000); - - cy.get('#root_project').select(projectId); - cy.get('#root_purpose') - .clear() - .type( - 'Ultimate Trivia Showdown elevates pub trivia into a game-show-like atmosphere. For 90-minutes, a professional performer plays the role of host and leads teams in new takes on quiz games.' - ); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('30-03-2026'); - cy.get('body').click(); - cy.get('#root_core_contributor').clear().type('Core5 Contributor'); - cy.get('#root_start_date').clear().type('29-03-2026'); - cy.get('body').click(); - cy.get('#root_end_date').clear().type('01-04-2026'); - cy.get('body').click(); - cy.get('#root_event_type').select('meetup'); - //cy.get('#root_event_type').select('all_hands'); - cy.get('#root_event_name').clear().type('Players collaborate against each other and compete against other teams to prove dominance.'); - - cy.get('#root_event_destination').clear('mi'); - cy.get('#root_event_destination').type('miami'); - cy.get('#downshift-0-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_departure_from').clear('mi'); - cy.get('#root_departure_from').type('milano'); - cy.get('#downshift-1-item-1 > .cds--list-box__menu-item__option').click(); - cy.get('#root_return_to').clear('z'); - cy.get('#root_return_to').type('z'); - cy.get('#downshift-2-item-3 > .cds--list-box__menu-item__option').click(); - // item 0 - cy.get('#root_item_0_sub_category').select('accom'); - cy.get('#root_item_0_item_name') - .clear() - .type( - 'Happen in a variety of indoor settings and can add a layer of fun and bonding to any team event.....' - ); - cy.get('#root_item_0_qty').clear().type('8'); - 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('2680'); - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - // item 1 - cy.get('#root_item_1_sub_category').select('flights'); - cy.get('#root_item_1_item_name') - .clear() - .type( - 'Now you have all you need for your seamless flight. With a variety of services such as Flexi Ticket.' - ); - 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('AED'); - cy.get('#root_item_1_unit_price').type('1980'); - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Task: Review the Request', - { timeout: 60000 } - ); - - cy.get('.cds--text-area__wrapper') - .find('#root') - .type( - 'A professional performer plays the role of host and leads teams in new takes on quiz games, like Majority Rules and Champion Challenge.' - ); - - cy.get('#root > div:nth-child(3) > p > button').click(); - - cy.get('input[type=file]').attachFile(['sampletext.txt']); - cy.wait(2000); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.wait(15000); - /*cy.get('button') - .contains(/^Return to Home$/) - .click();*/ - - cy.contains('Process Instance Id:', { timeout: 60000 }); - cy.logout(); - cy.wait(1000); - - const budgetOwnerUsername = Cypress.env('budgetowner_username'); - const 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' - ); - - - const peopleOpsUsername = Cypress.env('peopleopssme_username'); - const peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); - cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - 'reject' - ); - - checkProcessInstanceCompleted(username, password, processInstanceId); - }); - }); - }); -}); - diff --git a/spiffworkflow-frontend/cypress/pilot/pp1.cy.js b/spiffworkflow-frontend/cypress/pilot/pp1.cy.js deleted file mode 100644 index 1ae94036..00000000 --- a/spiffworkflow-frontend/cypress/pilot/pp1.cy.js +++ /dev/null @@ -1,97 +0,0 @@ -const approveWithUser = ( - username, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - password = null -) => { - if (!password) { - password = username; - } - cy.login(username, password); - cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Tasks I can complete', { timeout: 60000 }); - cy.get('.cds--btn').contains(/^Go$/).click(); - - // approve! - cy.get('#root-app').click(); - cy.get('button') - .contains(/^Submit$/) - .click(); - if (expectAdditionalApprovalInfoPage) { - cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); - cy.get('button') - .contains(/^Continue$/) - .click(); - } - cy.location({ timeout: 60000 }).should((loc) => { - expect(loc.pathname).to.eq('/tasks'); - }); - cy.logout(); -}; - -describe('pp1', () => { - it('can run PP1', () => { - cy.login('core-a1.contributor', 'core-a1.contributor'); - cy.visit('/'); - cy.contains('Start New +').click(); - cy.contains('Request Goods/Services').click(); - cy.runPrimaryBpmnFile(true); - - 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.get('#root_project').select('18564'); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('need the software for my work'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('2023-10-10'); - cy.get('#root_vendor').clear().type('sartography'); - cy.get('#root_payment_method').select('Bank Transfer'); - cy.get('#root_project').select('18564'); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('spiffworkflow'); - 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('100'); - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); - cy.get('button') - .contains(/^Submit$/) - .click(); - cy.contains('Tasks for my open instances', { timeout: 60000 }); - - cy.logout(); - approveWithUser( - 'infra.project-lead', - processInstanceId, - 'Task: Reminder: Check Existing Budget', - 'infra.project-leadx' - ); - approveWithUser('ppg.ba-a1.sme', processInstanceId); - approveWithUser('security-a1.sme', processInstanceId); - approveWithUser( - 'infra-a1.sme', - processInstanceId, - 'Task: Update Application Landscape' - ); - approveWithUser('legal-a1.sme', processInstanceId); - }); - }); -}); diff --git a/spiffworkflow-frontend/cypress/support/commands.js b/spiffworkflow-frontend/cypress/support/commands.js index 7c7f8866..02e21019 100644 --- a/spiffworkflow-frontend/cypress/support/commands.js +++ b/spiffworkflow-frontend/cypress/support/commands.js @@ -38,11 +38,11 @@ Cypress.Commands.add('navigateToHome', () => { }); Cypress.Commands.add('navigateToAdmin', () => { - cy.visit('/admin'); + cy.visit('/process-groups'); }); Cypress.Commands.add('login', (username, password) => { - cy.visit('/admin'); + cy.visit('/process-groups'); let usernameToUse = username; let passwordToUse = password; if (!usernameToUse) {