diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js index 90a7c144..334b9ee9 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js @@ -13,6 +13,7 @@ const submitWithUser = ( 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') @@ -53,8 +54,8 @@ const submitWithUser = ( 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(); + //cy.contains('Submit the Request').click(); + //cy.get('input[value="Submit the Request"]').click(); } else { @@ -182,9 +183,9 @@ describe('Consulting Fees Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -311,9 +312,9 @@ describe('Consulting Fees Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -441,9 +442,9 @@ describe('Consulting Fees Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -636,9 +637,9 @@ describe('Consulting Fees Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -804,9 +805,9 @@ describe('Consulting Fees Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -974,9 +975,9 @@ describe('Consulting Fees Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js index a4f8ef3c..ff4ef564 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js @@ -13,6 +13,7 @@ const submitWithUser = ( 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') @@ -57,8 +58,8 @@ const submitWithUser = ( 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(); + //cy.contains('Submit the Request').click(); + //cy.get('input[value="Submit the Request"]').click(); } else { @@ -196,9 +197,9 @@ describe('Equipment Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -322,9 +323,9 @@ describe('Equipment Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -443,9 +444,9 @@ describe('Equipment Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -591,9 +592,9 @@ describe('Equipment Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -699,9 +700,9 @@ describe('Equipment Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -807,9 +808,9 @@ describe('Equipment Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -933,9 +934,9 @@ describe('Equipment Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1055,9 +1056,9 @@ describe('Equipment Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1176,9 +1177,9 @@ describe('Equipment Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1394,9 +1395,9 @@ describe('Equipment Path - With Files', () => { .attachFile(['sampletext.txt']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1557,9 +1558,9 @@ describe('Equipment Path - With Files', () => { .attachFile(['sampletext.txt']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1719,9 +1720,9 @@ describe('Equipment Path - With Files', () => { .attachFile(['sampletext.txt']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1909,9 +1910,9 @@ describe('Equipment Path - With Files', () => { .attachFile(['sampletext.txt']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2059,9 +2060,9 @@ describe('Equipment Path - With Files', () => { .attachFile(['sampletext.txt']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2208,9 +2209,9 @@ describe('Equipment Path - With Files', () => { .attachFile(['sampletext.txt']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2375,9 +2376,9 @@ describe('Equipment Path - With Files', () => { .attachFile(['sampletext.txt']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2538,9 +2539,9 @@ describe('Equipment Path - With Files', () => { .attachFile(['sampletext.txt']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2701,9 +2702,9 @@ describe('Equipment Path - With Files', () => { .attachFile(['png-5mb-2.png']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js index 101d020b..1eb7f770 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js @@ -87,9 +87,9 @@ describe('Initiate a Request - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -179,9 +179,9 @@ describe('Initiate a Request - Without Files', () => { //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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -282,15 +282,15 @@ describe('Initiate a Request - Without Files', () => { { 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('.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.contains('Edit the Request').click(); - cy.get('input[value="Edit the Request"]').click(); + //cy.get('input[value="Edit the Request"]').click(); cy.get('button') - .contains(/^Submit$/) + .contains(/^Edit Request$/) .click(); @@ -312,10 +312,10 @@ describe('Initiate a Request - Without Files', () => { 'Task: Review the Request', { timeout: 60000 }); - 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.get('.cds--text-area__wrapper').find('#root').type('EDITING INFO'); - cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.contains('Submit the Request').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -331,8 +331,8 @@ describe('Initiate a Request - Without Files', () => { }); }); - //Save as Draft a Software and License request - Without Files - it.only('Save as Draft a Software and License request', () => { + //Save as Draft a Software and License request 1 - Without Files + it('Save as Draft a Software and License request 1', () => { let username = Cypress.env('requestor_username'); let password = Cypress.env('requestor_password'); cy.log('=====username : ' + username); @@ -408,9 +408,9 @@ describe('Initiate a Request - Without Files', () => { .contains(/^Save as draft$/) .click(); - cy.get('button') - .contains(/^Return to Home$/) - .click(); + //cy.get('button') + // .contains(/^Return to Home$/) + // .click(); cy.contains('Started by me', { timeout: 60000 }); cy.logout(); @@ -419,98 +419,8 @@ describe('Initiate a Request - Without Files', () => { }); }); - //Cancel a Software and License request 1- Without Files - it('Cancel a Software and License request 1', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-11-2025'); - cy.get('body').click(); - cy.get('#root_vendor').clear().type('Microsoft'); - cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - //item 0 - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('SNT'); - cy.get('#root_item_0_unit_price').type('1915'); - - - cy.get('#root_item > div:nth-child(3) > p > button').click(); - - //item 1 - cy.get('#root_item_1_sub_category').select('lic_and_sub'); - cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); - cy.get('#root_item_1_qty').clear().type('1'); - cy.get('#root_item_1_currency_type').select('Fiat'); - cy.get('#root_item_1_currency').select('AED'); - cy.get('#root_item_1_unit_price').type('4500'); - - cy.get('#root-Yes').click(); - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - - - }); - }); - - //Cancel a Software and License request 2- Without Files - it('Cancel a Software and License request 2', () => { + //Save as Draft a Software and License request 2- Without Files + it('Save as Draft a Software and License request 2', () => { let username = Cypress.env('requestor_username'); let password = Cypress.env('requestor_password'); cy.log('=====username : ' + username); @@ -594,12 +504,98 @@ describe('Initiate a Request - Without Files', () => { 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('button') + .contains(/^Save as draft$/) + .click(); - cy.get('input[value="Cancel the Request"]').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('Cancel a Software and License request 1', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + //cy.get('#root-Yes').click(); cy.get('button') - .contains(/^Submit$/) + .contains(/^Cancel Request$/) .click(); cy.get('button') @@ -610,6 +606,106 @@ describe('Initiate a Request - Without Files', () => { cy.logout(); + }); + }); + + //Cancel a Software and License request 2- Without Files + it.only('Cancel a Software and License request 2', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Windows 10 S, w/Ghost Manta Accessories, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); + + //cy.contains('Cancel the Request').click(); + + //cy.get('input[value="Cancel the Request"]').click(); + + cy.get('button') + .contains(/^Cancel Request$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + + }); }); }); @@ -744,9 +840,9 @@ describe('Initiate a Request - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -903,9 +999,9 @@ describe('Initiate a Request - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1051,13 +1147,13 @@ describe('Initiate a Request - With Files', () => { cy.wait(2000); - cy.contains('Edit the Request').click(); + //cy.contains('Edit the Request').click(); - cy.get('input[value="Edit the Request"]').click(); + //cy.get('input[value="Edit the Request"]').click(); cy.get('button') - .contains(/^Submit$/) + .contains(/^Edit Request$/) .click(); @@ -1079,8 +1175,8 @@ describe('Initiate a Request - With Files', () => { 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.contains('Submit the Request').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -1224,9 +1320,9 @@ describe('Initiate a Request - With Files', () => { cy.wait(2000); - cy.contains('Cancel the Request').click(); + //cy.contains('Cancel the Request').click(); - cy.get('input[value="Cancel the Request"]').click(); + //cy.get('input[value="Cancel the Request"]').click(); cy.get('button') .contains(/^Submit$/) diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js index a794344d..887fa635 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js @@ -13,6 +13,7 @@ const submitWithUser = ( 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') @@ -53,8 +54,8 @@ const submitWithUser = ( 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(); + //cy.contains('Submit the Request').click(); + //cy.get('input[value="Submit the Request"]').click(); } else { @@ -161,9 +162,9 @@ describe('Learning and Development Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -269,9 +270,9 @@ describe('Learning and Development Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -376,9 +377,9 @@ describe('Learning and Development Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -524,9 +525,9 @@ describe('Learning and Development Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -645,9 +646,9 @@ describe('Learning and Development Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -752,9 +753,9 @@ describe('Learning and Development Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -928,9 +929,9 @@ describe('Learning and Development Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1078,9 +1079,9 @@ describe('Learning and Development Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1227,9 +1228,9 @@ describe('Learning and Development Path - With Files', () => { .attachFile(['sampletext.txt']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1418,9 +1419,9 @@ describe('Learning and Development Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1581,9 +1582,9 @@ describe('Learning and Development Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1731,9 +1732,9 @@ describe('Learning and Development Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js index 4375b39c..b49fddf8 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js @@ -13,6 +13,7 @@ const submitWithUser = ( 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') @@ -53,8 +54,8 @@ const submitWithUser = ( 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(); + //cy.contains('Submit the Request').click(); + //cy.get('input[value="Submit the Request"]').click(); } else { @@ -173,9 +174,9 @@ describe('Other Fees Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -281,9 +282,9 @@ describe('Other Fees Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -388,9 +389,9 @@ describe('Other Fees Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -571,16 +572,16 @@ describe('Other Fees Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) .click(); - cy.wait(9000); + cy.wait(20000); cy.get('button') .contains(/^Return to Home$/) .click(); @@ -721,9 +722,9 @@ describe('Other Fees Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -871,9 +872,9 @@ describe('Other Fees Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js index c8f04143..c0bbf9f5 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js @@ -13,8 +13,8 @@ const submitWithUser = ( cy.wait(1000); cy.log('=======visit find by id : '); cy.visit('/admin/process-instances/find-by-id'); - cy.get('#process-instance-id-input').type(processInstanceId); - cy.wait(1000); + cy.wait(3000); + cy.get('#process-instance-id-input').type(processInstanceId); cy.get('button') .contains(/^Submit$/) .click(); @@ -28,7 +28,7 @@ const submitWithUser = ( // 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.')); + 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.')); @@ -57,8 +57,8 @@ const submitWithUser = ( cy.get('.cds--text-area__wrapper').find('#root').clear().type('Providing additional info. Open source is a term that originally referred to open source software (OSS). Open source software is code that is designed to be publicly accessible—anyone can see, modify, and distribute.'); - cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.contains('Submit the Request').click(); + //cy.get('input[value="Submit the Request"]').click(); } else { @@ -178,9 +178,9 @@ describe('Software and Licenses Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -323,9 +323,9 @@ describe('Software and Licenses Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -378,7 +378,7 @@ describe('Software and Licenses Path - Without Files', () => { null, "approve" ); - + submitWithUser( infrasmeUsername, infrasmePassword, @@ -472,9 +472,9 @@ describe('Software and Licenses Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -579,9 +579,9 @@ describe('Software and Licenses Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -726,9 +726,693 @@ describe('Software and Licenses Path - Without Files', () => { 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.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + + }); +}); + +//Software and Licenses Path - Without Files and with only mandatory fields +describe('Software and Licenses Path - Without Files and with only mandatory fields', () => { + + Cypress._.times(1, () => { + + //Everyone approves with CP + it('Everyone approves with CP', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Need to buy a Software'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('24-11-2025'); + cy.get('body').click(); + //cy.get('#root_vendor').clear().type('Embassar'); + //cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('USD'); + cy.get('#root_item_0_unit_price').type('550'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); + }); + + //Everyone approves the request + it('Everyone approves', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('need software'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('20-11-2025'); + cy.get('body').click(); + //cy.get('#root_vendor').clear().type('Embassar'); + //cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('open source'); + cy.get('#root_item_0_qty').clear().type('1'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('AED'); + cy.get('#root_item_0_unit_price').type('1520'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let securitysmeUsername = Cypress.env('securitysme_username'); + let securitysmePassword = Cypress.env('securitysme_password'); + let infrasmeUsername = Cypress.env('infrasme_username'); + let infrasmePassword = Cypress.env('infrasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + securitysmeUsername, + securitysmePassword, + processInstanceId, + null, + "approve" + ); + + submitWithUser( + infrasmeUsername, + infrasmePassword, + processInstanceId, + 'Task: Update Application Landscape', + "approve" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + }); + }); + + //Budget owner rejects the request + it('Budget owner rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Nee license'); + cy.get('#root_criticality').select('Medium'); + cy.get('#root_period').clear().type('20-02-2026'); + cy.get('body').click(); + //cy.get('#root_vendor').clear().type('Subsc LTD'); + //cy.get('#root_payment_method').select('Bank Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('Software development'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('EUR'); + cy.get('#root_item_0_unit_price').type('1400'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "reject" + ); + + }); + }); + + //Budget owner request for additional details + it('Budget owner need more info', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Software needed'); + cy.get('#root_criticality').select('Low'); + cy.get('#root_period').clear().type('05-02-2025'); + cy.get('body').click(); + //cy.get('#root_vendor').clear().type('ABC Licensing Co'); + //cy.get('#root_payment_method').select('Crypto Transfer'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('lic_and_sub'); + cy.get('#root_item_0_item_name').clear().type('License'); + cy.get('#root_item_0_qty').clear().type('4'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('450'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('It\’s free and easy to post a job. Simply fill in a title, description and budget and competitive bids come within minutes. No job is too big or too small. We\'ve got freelancers for jobs of any size or budget across 1800 skills. No job is too complex.'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + let budgetOwnerUsername = Cypress.env('budgetowner_username'); + let budgetOwnerPassword = Cypress.env('budgetowner_password'); + cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); + cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + null, + "needmoreinfo" + ); + + //requestor sending additional info + submitWithUser( + username, + password, + processInstanceId, + null, + "providemoreinfo" + ); + + //budget owner approves second time + submitWithUser( + budgetOwnerUsername, + budgetOwnerPassword, + processInstanceId, + 'Task: Reminder: Check Existing Budget', + "approve" + ); + + let ppgbasmeUsername = Cypress.env('ppgbasme_username'); + let ppgbasmePassword = Cypress.env('ppgbasme_password'); + let legalsmeUsername = Cypress.env('legalsme_username'); + let legalsmePassword = Cypress.env('legalsme_password'); + + submitWithUser( + ppgbasmeUsername, + ppgbasmePassword, + processInstanceId, + null, + "cpapproved" + ); + + submitWithUser( + legalsmeUsername, + legalsmePassword, + processInstanceId, + null, + "approve" + ); + + + }); + }); + + //Infra reject the request + it('Infra rejects', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.wait(5000); + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Software is needed'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + // cy.get('#root_vendor').clear().type('Embassar'); + // cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('AUD'); + cy.get('#root_item_0_unit_price').type('2416'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); + + //cy.contains('Submit the Request').click(); + + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -803,7 +1487,7 @@ describe('Software and Licenses Path - With Files', () => { Cypress._.times(1, () => { //Everyone approves with CP - it.only('Everyone approves with CP', () => { + it('Everyone approves with CP', () => { let username = Cypress.env('requestor_username'); let password = Cypress.env('requestor_password'); cy.log('=====username : ' + username); @@ -929,9 +1613,9 @@ describe('Software and Licenses Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1105,9 +1789,9 @@ describe('Software and Licenses Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1297,9 +1981,9 @@ describe('Software and Licenses Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1446,9 +2130,9 @@ describe('Software and Licenses Path - With Files', () => { .attachFile(['png-5mb-2.png']); cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1637,9 +2321,9 @@ describe('Software and Licenses Path - With Files', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -1852,9 +2536,9 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2050,9 +2734,9 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2263,9 +2947,9 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2434,9 +3118,9 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2646,9 +3330,9 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.wait(2000); - cy.contains('Submit the Request').click(); + //cy.contains('Submit the Request').click(); - cy.get('input[value="Submit the Request"]').click(); + //cy.get('input[value="Submit the Request"]').click(); cy.get('button') @@ -2717,686 +3401,3 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { }); }); -//Software and Licenses Path - Without Files and with only mandatory fields -describe.only('Software and Licenses Path - Without Files and with only mandatory fields', () => { - - Cypress._.times(1, () => { - - //Everyone approves with CP - it('Everyone approves with CP', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Need to buy a Software'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('24-11-2025'); - cy.get('body').click(); - //cy.get('#root_vendor').clear().type('Embassar'); - //cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Open source software'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('USD'); - cy.get('#root_item_0_unit_price').type('550'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); - - cy.contains('Submit the Request').click(); - - cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Everyone approves the request - it('Everyone approves', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('need software'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('20-11-2025'); - cy.get('body').click(); - //cy.get('#root_vendor').clear().type('Embassar'); - //cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('open source'); - cy.get('#root_item_0_qty').clear().type('1'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('AED'); - cy.get('#root_item_0_unit_price').type('1520'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); - - cy.contains('Submit the Request').click(); - - cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - 'Task: Update Application Landscape', - "approve" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Budget owner rejects the request - it('Budget owner rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Nee license'); - cy.get('#root_criticality').select('Medium'); - cy.get('#root_period').clear().type('20-02-2026'); - cy.get('body').click(); - //cy.get('#root_vendor').clear().type('Subsc LTD'); - //cy.get('#root_payment_method').select('Bank Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('Software development'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('EUR'); - cy.get('#root_item_0_unit_price').type('1400'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); - - cy.contains('Submit the Request').click(); - - cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - //Budget owner request for additional details - it('Budget owner need more info', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Software needed'); - cy.get('#root_criticality').select('Low'); - cy.get('#root_period').clear().type('05-02-2025'); - cy.get('body').click(); - //cy.get('#root_vendor').clear().type('ABC Licensing Co'); - //cy.get('#root_payment_method').select('Crypto Transfer'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('lic_and_sub'); - cy.get('#root_item_0_item_name').clear().type('License'); - cy.get('#root_item_0_qty').clear().type('4'); - cy.get('#root_item_0_currency_type').select('Crypto'); - cy.get('#root_item_0_currency').select('SNT'); - cy.get('#root_item_0_unit_price').type('450'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('It\’s free and easy to post a job. Simply fill in a title, description and budget and competitive bids come within minutes. No job is too big or too small. We\'ve got freelancers for jobs of any size or budget across 1800 skills. No job is too complex.'); - - cy.contains('Submit the Request').click(); - - cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "needmoreinfo" - ); - - //requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - "providemoreinfo" - ); - - //budget owner approves second time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "cpapproved" - ); - - submitWithUser( - legalsmeUsername, - legalsmePassword, - processInstanceId, - null, - "approve" - ); - - - }); - }); - - //Infra reject the request - it('Infra rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services'); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); - // wait a second to ensure we can click the radio button - - cy.wait(2000); - cy.get('input#root-procurement').click(); - cy.wait(2000); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - */ - - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); - - cy.wait(5000); - cy.url().then((currentUrl) => { - // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" - // extract the digits after /tasks - const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; - cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); - cy.get('#root_project').select(projectId); - cy.get('#root_category').select('soft_and_lic'); - cy.get('#root_purpose').clear().type('Software is needed'); - cy.get('#root_criticality').select('High'); - cy.get('#root_period').clear().type('25-11-2025'); - cy.get('body').click(); - // cy.get('#root_vendor').clear().type('Embassar'); - // cy.get('#root_payment_method').select('Reimbursement'); - /* cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - */ - cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Open source'); - cy.get('#root_item_0_qty').clear().type('2'); - cy.get('#root_item_0_currency_type').select('Fiat'); - cy.get('#root_item_0_currency').select('AUD'); - cy.get('#root_item_0_unit_price').type('2416'); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - cy.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); - - //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); - - cy.contains('Submit the Request').click(); - - cy.get('input[value="Submit the Request"]').click(); - - - cy.get('button') - .contains(/^Submit$/) - .click(); - - - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let ppgbasmeUsername = Cypress.env('ppgbasme_username'); - let ppgbasmePassword = Cypress.env('ppgbasme_password'); - let securitysmeUsername = Cypress.env('securitysme_username'); - let securitysmePassword = Cypress.env('securitysme_password'); - let infrasmeUsername = Cypress.env('infrasme_username'); - let infrasmePassword = Cypress.env('infrasme_password'); - let legalsmeUsername = Cypress.env('legalsme_username'); - let legalsmePassword = Cypress.env('legalsme_password'); - - submitWithUser( - ppgbasmeUsername, - ppgbasmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - securitysmeUsername, - securitysmePassword, - processInstanceId, - null, - "approve" - ); - - submitWithUser( - infrasmeUsername, - infrasmePassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - - }); -}); \ No newline at end of file