diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js index 1ae82058..150f9153 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js @@ -27,41 +27,51 @@ const submitWithUser = ( cy.wait(2000); // approve! - if (approvaltype === "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('.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('.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.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 }); + // 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 }); + .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(); + 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(); @@ -72,7 +82,6 @@ const submitWithUser = ( cy.get('button') .contains(/^Continue$/) .click(); - } cy.visit('/'); @@ -85,15 +94,15 @@ const submitWithUser = ( cy.wait(2000); }; -//Consulting Fees Path - Without Files +// Consulting Fees Path - Without Files describe.only('Consulting Fees Path - Without Files', () => { Cypress._.times(1, () => { - //Budget owner approves the request + // Budget owner approves the request it('Budget owner approves', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + 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('/'); @@ -116,36 +125,41 @@ describe.only('Consulting Fees Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* cy.get('button') .contains(/^Submit$/) .click(); - cy.contains('Task: Enter NDR Items', { timeout: 60000 });*/ - //item 0 + 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_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'); @@ -153,9 +167,13 @@ describe.only('Consulting Fees Path - Without Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -163,15 +181,18 @@ describe.only('Consulting Fees Path - Without Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -181,12 +202,15 @@ describe.only('Consulting Fees Path - Without Files', () => { { 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('.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -201,28 +225,27 @@ describe.only('Consulting Fees Path - Without Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'approve' ); - }); }); - //Budget owner rejects the request + // 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); + 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('/'); @@ -245,36 +268,39 @@ describe.only('Consulting Fees Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* cy.get('button') .contains(/^Submit$/) .click(); - cy.contains('Task: Enter NDR Items', { timeout: 60000 });*/ + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //Item 0 + // 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_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'); @@ -282,9 +308,13 @@ describe.only('Consulting Fees Path - Without Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -292,15 +322,18 @@ describe.only('Consulting Fees Path - Without Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -310,12 +343,15 @@ describe.only('Consulting Fees Path - Without Files', () => { { 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('.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -330,28 +366,27 @@ describe.only('Consulting Fees Path - Without Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'reject' ); - }); }); - //Budget owner request for additional details + // 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); + 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('/'); @@ -374,36 +409,41 @@ describe.only('Consulting Fees Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* cy.get('button') .contains(/^Submit$/) .click(); - cy.contains('Task: Enter NDR Items', { timeout: 60000 });*/ + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -411,9 +451,13 @@ describe.only('Consulting Fees Path - Without Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -421,16 +465,18 @@ describe.only('Consulting Fees Path - Without Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -440,12 +486,15 @@ describe.only('Consulting Fees Path - Without Files', () => { { 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('.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -460,52 +509,50 @@ describe.only('Consulting Fees Path - Without Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'needmoreinfo' ); - //requestor sending additional info + // requestor sending additional info submitWithUser( username, password, processInstanceId, null, - "providemoreinfo" + 'providemoreinfo' ); - //budget owner approves second time + // budget owner approves second time submitWithUser( budgetOwnerUsername, budgetOwnerPassword, processInstanceId, 'Task: Reminder: Check Existing Budget', - "approve" + 'approve' ); - }); }); - }); }); -//Consulting Fees Path - With Files +// Consulting Fees Path - With Files describe('Consulting Fees Path - With Files', () => { Cypress._.times(1, () => { - //Budget owner approves the request + // Budget owner approves the request it('Budget owner approves', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + 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('/'); @@ -528,36 +575,41 @@ describe('Consulting Fees Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* cy.get('button') .contains(/^Submit$/) .click(); - cy.contains('Task: Enter NDR Items', { timeout: 60000 });*/ + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -565,9 +617,13 @@ describe('Consulting Fees Path - With Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -575,15 +631,18 @@ describe('Consulting Fees Path - With Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -593,54 +652,65 @@ describe('Consulting Fees Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -652,28 +722,27 @@ describe('Consulting Fees Path - With Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'approve' ); - }); }); - //Budget owner rejects the request + // 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); + 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('/'); @@ -696,36 +765,39 @@ describe('Consulting Fees Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* cy.get('button') .contains(/^Submit$/) .click(); - cy.contains('Task: Enter NDR Items', { timeout: 60000 });*/ + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -733,9 +805,13 @@ describe('Consulting Fees Path - With Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -743,15 +819,18 @@ describe('Consulting Fees Path - With Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -761,54 +840,65 @@ describe('Consulting Fees Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -823,28 +913,27 @@ describe('Consulting Fees Path - With Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'reject' ); - }); }); - //Budget owner request for additional details + // 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); + 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('/'); @@ -867,35 +956,40 @@ describe('Consulting Fees Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* cy.get('button') .contains(/^Submit$/) .click(); - cy.contains('Task: Enter NDR Items', { timeout: 60000 });*/ - //item 0 + 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_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'); @@ -903,9 +997,13 @@ describe('Consulting Fees Path - With Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -913,15 +1011,18 @@ describe('Consulting Fees Path - With Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -931,54 +1032,65 @@ describe('Consulting Fees Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -989,40 +1101,37 @@ describe('Consulting Fees Path - With Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'needmoreinfo' ); - //requestor sending additional info + // requestor sending additional info submitWithUser( username, password, processInstanceId, null, - "providemoreinfo" + 'providemoreinfo' ); - //budget owner approves second time + // budget owner approves second time submitWithUser( budgetOwnerUsername, budgetOwnerPassword, processInstanceId, 'Task: Reminder: Check Existing Budget', - "approve" + 'approve' ); - - }); }); - }); -}); \ No newline at end of file +}); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js index 72a88f26..5095448b 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js @@ -1,113 +1,124 @@ const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype + username, + password, + processInstanceId, + expectAdditionalApprovalInfoPage = false, + approvaltype ) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); + cy.wait(2000); + cy.log('========Login with : ', username); + cy.log('========processInstanceId: ', processInstanceId); + cy.login(username, password); - cy.wait(1000); - cy.log('=======visit find by id : '); - cy.visit('/admin/process-instances/find-by-id'); - cy.wait(3000); - cy.get('#process-instance-id-input').type(processInstanceId); + cy.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(); - - 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 }); + .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 }); + .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.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 { + } - } else { + cy.get('button') + .contains(/^Submit$/) + .click(); - } + if (expectAdditionalApprovalInfoPage) { + cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); cy.get('button') - .contains(/^Submit$/) - .click(); + .contains(/^Continue$/) + .click(); + } - if (expectAdditionalApprovalInfoPage) { - cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); + cy.visit('/'); - cy.get('button') - .contains(/^Continue$/) - .click(); - - } - - cy.visit('/'); - - cy.location({ timeout: 60000 }).should((loc) => { - expect(loc.pathname).to.eq('/'); - }); - cy.wait(2000); - cy.logout(); - cy.wait(2000); + cy.location({ timeout: 60000 }).should((loc) => { + expect(loc.pathname).to.eq('/'); + }); + cy.wait(2000); + cy.logout(); + cy.wait(2000); }; -//Equipment Path - Without Files +// Equipment Path - Without Files describe.only('Equipment Path - Without Files', () => { + Cypress._.times(1, () => { + // Out of Policy. People Ops Partner Group and Budget owner approves the request + it('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}`); - Cypress._.times(1, () => { - //Out of Policy. People Ops Partner Group and Budget owner approves the request - it('Out of Policy. People Ops Partner Group and Budget owner 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.login(username, password); - cy.visit('/'); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); + cy.runPrimaryBpmnFile(true); - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); + /* 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); @@ -120,1151 +131,1201 @@ describe.only('Equipment Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + // 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - cy.log('=====after logout ---'); - - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - 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" - ); - - - }); - }); - - //Out of Policy. People Ops Partner Group approves and Budget owner rejects the request - it('Out of Policy. People Ops Partner Group approves and 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - 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" - ); - - - }); - }); - - //Out of Policy. People Ops Partner Group approves and Budget owner request for additional details - it('Out of Policy. People Ops Partner Group approves and Budget owner needs 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - 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" - ); - - // 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" - ); - - - }); - }); - - //Within Policy. People Ops Partner Group approves the request - it('Within Policy. People Ops Partner Group 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Within Policy. People Ops Partner Group rejects the request - it('Within Policy. People Ops Partner Group 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - //Within Policy. People Ops Partner Group request additional info - it('Within Policy. People Ops Partner Group needs 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let 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" - ); - - - }); - }); - //Within Policy. People Ops Partner Group and Budget owner approves the request - it('Within Policy. People Ops Partner Group and Budget owner 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "escalateBO" - ); - - 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" - ); - - - }); - }); - - //Within Policy. People Ops Partner Group approves and Budget owner rejects the request - it('Within Policy. People Ops Partner Group approves and 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "escalateBO" - ); - - 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" - ); - - - }); - }); - - //Within Policy. People Ops Partner Group approves and Budget owner request for additional details - it('Within Policy. People Ops Partner Group approves and Budget owner needs 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "escalateBO" - ); - - 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" - ); - - //people ops approves second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - - }); - }); - + // 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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); }); + + // Out of Policy. People Ops Partner Group approves and Budget owner rejects the request + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Out of Policy. People Ops Partner Group approves and Budget owner request for additional details + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group approves the request + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group rejects the request + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group request additional info + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + // Within Policy. People Ops Partner Group and Budget owner approves the request + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group approves and Budget owner rejects the request + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group approves and Budget owner request for additional details + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + }); }); -//Equipment Path - With Files +// Equipment Path - With Files describe('Equipment Path - With Files', () => { + Cypress._.times(1, () => { + // Out of Policy. People Ops Partner Group and Budget owner approves the request + it('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}`); - Cypress._.times(1, () => { - //Out of Policy. People Ops Partner Group and Budget owner approves the request - it('Out of Policy. People Ops Partner Group and Budget owner 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.login(username, password); - cy.visit('/'); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); + cy.runPrimaryBpmnFile(true); - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); + /* 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); @@ -1277,1505 +1338,1631 @@ describe('Equipment Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + // 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - 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" - ); - - - }); - }); - - //Out of Policy. People Ops Partner Group approves and Budget owner rejects the request - it('Out of Policy. People Ops Partner Group approves and 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').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); - let 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - 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" - ); - - - }); - }); - - //Out of Policy. People Ops Partner Group approves and Budget owner request for additional details - it('Out of Policy. People Ops Partner Group approves and Budget owner needs 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').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); - let 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - 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" - ); - - //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" - ); - - - }); - }); - - //Within Policy. People Ops Partner Group approves the request - it('Within Policy. People Ops Partner Group 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').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); - let 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Within Policy. People Ops Partner Group rejects the request - it('Within Policy. People Ops Partner Group 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').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); - let 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - //Within Policy. People Ops Partner Group request additional info - it('Within Policy. People Ops Partner Group needs 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').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); - let 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let 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" - ); - - - }); - }); - //Within Policy. People Ops Partner Group and Budget owner approves the request - it('Within Policy. People Ops Partner Group and Budget owner 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').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); - let 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "escalateBO" - ); - - 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" - ); - - - }); - }); - - //Within Policy. People Ops Partner Group approves and Budget owner rejects the request - it('Within Policy. People Ops Partner Group approves and 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').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); - let 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "escalateBO" - ); - - 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" - ); - - - }); - }); - - //Within Policy. People Ops Partner Group approves and Budget owner request for additional details - it('Within Policy. People Ops Partner Group approves and Budget owner needs 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').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); - let 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('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "escalateBO" - ); - - 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" - ); - - //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" - ); - - - }); - }); - + // 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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); }); -}); \ No newline at end of file + + // Out of Policy. People Ops Partner Group approves and Budget owner rejects the request + it('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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Out of Policy. People Ops Partner Group approves and Budget owner request for additional details + it('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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group approves the request + it('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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group rejects the request + it('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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group request additional info + it('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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + // Within Policy. People Ops Partner Group and Budget owner approves the request + it('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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group approves and Budget owner rejects the request + it('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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Within Policy. People Ops Partner Group approves and Budget owner request for additional details + it('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('Started by me', { 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' + ); + }); + }); + }); +}); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js index 54b4c7ad..da77c1e1 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js @@ -1,23 +1,22 @@ - -//Software and License - Without Files +// Software and License - Without Files describe.only('Initiate a Request - Without Files', () => { - Cypress._.times(1, () => { - //Submit a Software and License request - Without Files - it('Submit a Software and License request', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + Cypress._.times(1, () => { + // Submit a Software and License request - Without Files + it('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.login(username, password); + cy.visit('/'); - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - cy.runPrimaryBpmnFile(true); + cy.runPrimaryBpmnFile(true); - /* cy.contains('Please select the type of request to start the process.'); + /* 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); @@ -30,98 +29,108 @@ describe.only('Initiate a Request - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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') + 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'); + // 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(); - 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'); - //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('button') - .contains(/^Submit$/) - .click(); + 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( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); + // cy.contains('Submit the Request').click(); - 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('input[value="Submit the Request"]').click(); - //cy.contains('Submit the Request').click(); + cy.get('button') + .contains(/^Submit$/) + .click(); - //cy.get('input[value="Submit the Request"]').click(); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + }); + }); - cy.get('button') - .contains(/^Submit$/) - .click(); + // Submit a Software and License request - Without Files and with mandatory fields only + it('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.get('button') - .contains(/^Return to Home$/) - .click(); + cy.login(username, password); + cy.visit('/'); - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - }); - }); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - //Submit a Software and License request - Without Files and with mandatory fields only - it('Submit a Software and License request - Without Files and with mandatory fields only', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + cy.runPrimaryBpmnFile(true); - 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.'); + /* 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); @@ -134,87 +143,81 @@ describe.only('Initiate a Request - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + 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('#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.get('button') - .contains(/^Submit$/) - .click(); + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); - 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('.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') + .contains(/^Submit$/) + .click(); + cy.get('button') + .contains(/^Return to Home$/) + .click(); - cy.get('button') - .contains(/^Submit$/) - .click(); + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + }); + }); - cy.get('button') - .contains(/^Return to Home$/) - .click(); + // Edit a Software and License request - Without Files + it('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.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); + cy.login(username, password); + cy.visit('/'); - }); - }); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - //Edit a Software and License request - Without Files - it('Edit a Software and License request', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + cy.runPrimaryBpmnFile(true); - 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.'); + /* 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); @@ -227,602 +230,642 @@ describe.only('Initiate a Request - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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') + 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'); + // 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(); - 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'); - //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('button') - .contains(/^Submit$/) - .click(); + 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( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); + // cy.contains('Edit the Request').click(); - 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.get('input[value="Edit the Request"]').click(); - //cy.contains('Edit the Request').click(); + cy.get('button') + .contains(/^Edit 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.wait(2000); - cy.get('button') - .contains(/^Submit$/) - .click(); - //Form 2 - /*cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + // Form 1 + cy.contains('Task: Submit Details', { timeout: 60000 }); + 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 }); + .click(); */ + // Form 3 + cy.contains('Task: Review the Request', { timeout: 60000 }); - cy.get('.cds--text-area__wrapper').find('#root').type('EDITING INFO'); + 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$/) - .click(); + cy.get('button') + .contains(/^Submit$/) + .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(); - cy.wait(2000); - }); - }); - - //Close a Software and License request 1 - Without Files - it('Close 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').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); - 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(/^Close$/) - .click(); - - //cy.get('button') - // .contains(/^Return to Home$/) - // .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - - - }); - }); - - //Close a Software and License request 2 - Without Files - it('Close 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').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); - 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(/^Close$/) - .click(); - - //cy.get('button') - // .contains(/^Return to Home$/) - // .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - - - }); - }); - - - //Close a Software and License request 3 - Without Files - it('Close a Software and License request 3', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('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.get('button') - .contains(/^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('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').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); - 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(/^Cancel 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 2- Without Files - it('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').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); - 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - - - }); - }); + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + }); }); + + // Close a Software and License request 1 - Without Files + it('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(/^Close$/) + .click(); + + // cy.get('button') + // .contains(/^Return to Home$/) + // .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + }); + }); + + // Close a Software and License request 2 - Without Files + it('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(/^Close$/) + .click(); + + // cy.get('button') + // .contains(/^Return to Home$/) + // .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + }); + }); + + // Close a Software and License request 3 - Without Files + it('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(/^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('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.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', () => { + 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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + }); + }); + }); }); -//Software and License - With Files +// Software and License - With Files describe('Initiate a Request - With Files', () => { - Cypress._.times(1, () => { - //Submit a Software and License request - Without Files - it('Submit a Software and License request - With Files', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + Cypress._.times(1, () => { + // Submit a Software and License request - Without Files + it('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.login(username, password); + cy.visit('/'); - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - cy.runPrimaryBpmnFile(true); + cy.runPrimaryBpmnFile(true); - /* cy.contains('Please select the type of request to start the process.'); + /* 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); @@ -835,141 +878,158 @@ describe('Initiate a Request - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + 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'); + // 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(); + 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'); + // 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.get('button') - .contains(/^Submit$/) - .click(); + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); - 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('.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('#root > div:nth-child(3) > p > button').click(); + cy.get('input[type=file]').attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); - 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: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.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: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('#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("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: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('#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.get("input[type=file]") - .attachFile(['sampletext.txt']); + cy.wait(2000); - 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.get('button') + .contains(/^Return to Home$/) + .click(); - cy.get('button') - .contains(/^Submit$/) - .click(); + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + }); + }); - cy.get('button') - .contains(/^Return to Home$/) - .click(); + // Submit a Software and License request - With Files and Multiple items + it('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('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - }); - }); + cy.runPrimaryBpmnFile(true); - //Submit a Software and License request - With Files and Multiple items - it('Submit a Software and License request - With Files and Multiple items', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); + /* 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); @@ -982,152 +1042,173 @@ describe('Initiate a Request - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + 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'); + // 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(); + 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'); + // 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(); + 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'); + // 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('button') - .contains(/^Submit$/) - .click(); + 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.contains( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); + cy.get('#root > div:nth-child(3) > p > button').click(); - 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('input[type=file]').attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); - cy.get('#root > div:nth-child(3) > p > button').click(); + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - 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: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.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('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); + cy.get('input[type=file]').attachFile(['Free_Test_Data_1MB_PDF.pdf']); + 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('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - 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('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); + cy.get('input[type=file]').attachFile(['sampletext.txt']); - 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.wait(2000); - cy.get("input[type=file]") - .attachFile(['sampletext.txt']); + // cy.contains('Submit the Request').click(); - cy.wait(2000); + // cy.get('input[value="Submit the Request"]').click(); - //cy.contains('Submit the Request').click(); + cy.get('button') + .contains(/^Submit$/) + .click(); - //cy.get('input[value="Submit the Request"]').click(); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + }); + }); - cy.get('button') - .contains(/^Submit$/) - .click(); + // Edit a Software and License request - With Files + it('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.get('button') - .contains(/^Return to Home$/) - .click(); + cy.login(username, password); + cy.visit('/'); - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - }); - }); + cy.runPrimaryBpmnFile(true); - //Edit a Software and License request - With Files - it('Edit a Software and License request - With Files', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); + /* 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); @@ -1140,427 +1221,472 @@ describe('Initiate a Request - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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') + 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'); + // 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(); - 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'); - //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('button') - .contains(/^Submit$/) - .click(); + 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( - 'Review and provide any supporting information or files for your request.', - { timeout: 60000 } - ); + cy.get('#root > div:nth-child(3) > p > button').click(); - 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('input[type=file]').attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); - cy.get('#root > div:nth-child(3) > p > button').click(); + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['lorem-ipsum.pdf']); - 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: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.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('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); + cy.get('input[type=file]').attachFile(['Free_Test_Data_1MB_PDF.pdf']); + 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('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); - cy.get("input[type=file]") - .attachFile(['Free_Test_Data_1MB_PDF.pdf']); - 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('#root > div:nth-child(3) > p > button').click(); - cy.wait(1000); + cy.get('input[type=file]').attachFile(['png-5mb-2.png']); - 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.wait(2000); - cy.get("input[type=file]") - .attachFile(['png-5mb-2.png']); + // cy.contains('Edit the Request').click(); - cy.wait(2000); + // cy.get('input[value="Edit the Request"]').click(); + cy.get('button') + .contains(/^Edit Request$/) + .click(); - //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.wait(2000); - cy.get('button') - .contains(/^Submit$/) - .click(); - //Form 2 - /*cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + // Form 1 + cy.contains('Task: Submit Details', { timeout: 60000 }); + 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.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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - }); - }); - - //Close a Software and License request 1 - With Files - it('Close a Software and License request 1 - With Files', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('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.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(/^Close$/) - .click(); - - cy.wait(3000); - - // 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('Cancel a Software and License request - With Files ', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); - - cy.login(username, password); - cy.visit('/'); - - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('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.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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - - }); - }); + .click(); */ + // Form 3 + cy.contains('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.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); + }); }); -}); + // Close a Software and License request 1 - With Files + it('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(/^Close$/) + .click(); + + cy.wait(3000); + + // 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('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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 index 773b103a..c068fa32 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js @@ -1,109 +1,118 @@ const submitWithUser = ( - username, - password, - processInstanceId, - expectAdditionalApprovalInfoPage = false, - approvaltype + username, + password, + processInstanceId, + expectAdditionalApprovalInfoPage = false, + approvaltype ) => { - cy.wait(2000); - cy.log('========Login with : ', username); - cy.log('========processInstanceId: ', processInstanceId); - cy.login(username, password); + cy.wait(2000); + cy.log('========Login with : ', username); + cy.log('========processInstanceId: ', processInstanceId); + cy.login(username, password); - cy.wait(1000); - cy.log('=======visit find by id : '); - cy.visit('/admin/process-instances/find-by-id'); - cy.wait(3000); - cy.get('#process-instance-id-input').type(processInstanceId); + cy.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(); - - 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 }); + .contains(/^Submit$/) + .click(); + // Form 2 + /* cy.contains('Task: Enter NDR Items', { timeout: 60000 }); cy.get('button') .contains(/^Submit$/) - .click(); - //Form 2 - /*cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - cy.get('button') - .contains(/^Submit$/) - .click();*/ - //Form 3 - cy.contains( - 'Task: Review the Request', - { timeout: 60000 }); + .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.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 { + } - } else { + cy.get('button') + .contains(/^Submit$/) + .click(); - } + if (expectAdditionalApprovalInfoPage) { + cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); cy.get('button') - .contains(/^Submit$/) - .click(); + .contains(/^Continue$/) + .click(); + } - if (expectAdditionalApprovalInfoPage) { - cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); + cy.visit('/'); - cy.get('button') - .contains(/^Continue$/) - .click(); - - } - - cy.visit('/'); - - cy.location({ timeout: 60000 }).should((loc) => { - expect(loc.pathname).to.eq('/'); - }); - cy.wait(2000); - cy.logout(); - cy.wait(2000); + cy.location({ timeout: 60000 }).should((loc) => { + expect(loc.pathname).to.eq('/'); + }); + cy.wait(2000); + cy.logout(); + cy.wait(2000); }; -//Learning and Development Path - Without Files +// Learning and Development Path - Without Files describe.only('Learning and Development Path - Without Files', () => { + Cypress._.times(1, () => { + // People Ops Partner Group approves the request + it('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}`); - Cypress._.times(1, () => { - //People Ops Partner Group approves the request - it('Books Only. People Ops Partner Group 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.login(username, password); - cy.visit('/'); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); + cy.runPrimaryBpmnFile(true); - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); + /* 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); @@ -116,719 +125,753 @@ describe.only('Learning and Development Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + // 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //People Ops Partner Group rejects the request - it('Books Only. People Ops Partner Group 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - //People Ops Partner Group request for additional details - it('Books Only. People Ops Partner Group needs 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let 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" - ); - - - }); - }); - - //Budget owner approves and People Ops Partner Group approves the request - it('NOT Books Only. Budget owner approves and People Ops Partner Group 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').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); - let 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.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - 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" - ); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Budget owner rejects the request - it('NOT Books Only. 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').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); - let 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.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('NOT Books Only. Budget owner needs 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').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); - let 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.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" - ); - - - }); - }); - + 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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); }); + // People Ops Partner Group rejects the request + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // People Ops Partner Group request for additional details + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Budget owner approves and People Ops Partner Group approves the request + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Budget owner rejects the request + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Budget owner request for additional details + it('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.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + }); }); -//Learning and Development Path - With Files +// Learning and Development Path - With Files describe('Learning and Development Path - With Files', () => { + Cypress._.times(1, () => { + // People Ops Partner Group approves the request + it('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}`); - Cypress._.times(1, () => { - //People Ops Partner Group approves the request - it('Books Only. People Ops Partner Group 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.login(username, password); - cy.visit('/'); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - cy.contains('Start New +').click(); - cy.contains('Request Goods or Services').click(); + cy.runPrimaryBpmnFile(true); - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); + /* 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); @@ -841,144 +884,158 @@ describe('Learning and Development Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + // 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('#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.get('button') - .contains(/^Submit$/) - .click(); + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); - 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('.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('#root > div:nth-child(3) > p > button').click(); + cy.get('input[type=file]').attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); - 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: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.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: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('#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("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: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('#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.get("input[type=file]") - .attachFile(['sampletext.txt']); + cy.wait(2000); - 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.get('button') + .contains(/^Return to Home$/) + .click(); - cy.get('button') - .contains(/^Submit$/) - .click(); + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); + const peopleOpsUsername = Cypress.env('peopleopssme_username'); + const peopleOpsPassword = Cypress.env('peopleopssme_password'); + cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); + cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); + submitWithUser( + peopleOpsUsername, + peopleOpsPassword, + processInstanceId, + null, + 'approve' + ); + }); + }); - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); + // People Ops Partner Group rejects the request + it('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}`); - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); + cy.login(username, password); + cy.visit('/'); - }); - }); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - //People Ops Partner Group rejects the request - it('Books Only. People Ops Partner Group rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + cy.runPrimaryBpmnFile(true); - 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.'); + /* 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); @@ -991,144 +1048,158 @@ describe('Learning and Development Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + // 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('#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.get('button') - .contains(/^Submit$/) - .click(); + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); - 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('.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('#root > div:nth-child(3) > p > button').click(); + cy.get('input[type=file]').attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); - 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: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.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: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('#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("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: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('#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.get("input[type=file]") - .attachFile(['sampletext.txt']); + cy.wait(2000); - 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.get('button') + .contains(/^Return to Home$/) + .click(); - cy.get('button') - .contains(/^Submit$/) - .click(); + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); + const peopleOpsUsername = Cypress.env('peopleopssme_username'); + const peopleOpsPassword = Cypress.env('peopleopssme_password'); + cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); + cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); + submitWithUser( + peopleOpsUsername, + peopleOpsPassword, + processInstanceId, + null, + 'reject' + ); + }); + }); - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); + // People Ops Partner Group request for additional details + it('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}`); - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "reject" - ); + cy.login(username, password); + cy.visit('/'); - }); - }); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - //People Ops Partner Group request for additional details - it('Books Only. People Ops Partner Group needs more info', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + cy.runPrimaryBpmnFile(true); - 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.'); + /* 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); @@ -1141,162 +1212,175 @@ describe('Learning and Development Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + // 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('#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.get('button') - .contains(/^Submit$/) - .click(); + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); - 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('.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('#root > div:nth-child(3) > p > button').click(); + cy.get('input[type=file]').attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); - 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: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.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: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('#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("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: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('#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.get("input[type=file]") - .attachFile(['sampletext.txt']); + cy.wait(2000); + // cy.contains('Submit the Request').click(); - cy.wait(2000); - //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.get('button') + .contains(/^Return to Home$/) + .click(); - cy.get('button') - .contains(/^Submit$/) - .click(); + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); - cy.wait(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); + const peopleOpsUsername = Cypress.env('peopleopssme_username'); + const peopleOpsPassword = Cypress.env('peopleopssme_password'); + cy.log(`=====peopleOpsUsername : ${peopleOpsUsername}`); + cy.log(`=====peopleOpsPassword : ${peopleOpsPassword}`); - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); + submitWithUser( + peopleOpsUsername, + peopleOpsPassword, + processInstanceId, + null, + 'needmoreinfo' + ); - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); + // requestor sending additional info + submitWithUser( + username, + password, + processInstanceId, + null, + 'providemoreinfo' + ); - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "needmoreinfo" - ); + // people ops approves second time + submitWithUser( + peopleOpsUsername, + peopleOpsPassword, + processInstanceId, + null, + 'approve' + ); + }); + }); - //requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - "providemoreinfo" - ); + // Budget owner approves and People Ops Partner Group approves the request + it('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}`); - //people ops approves second time - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); + cy.login(username, password); + cy.visit('/'); + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services').click(); - }); - }); + cy.runPrimaryBpmnFile(true); - //Budget owner approves and People Ops Partner Group approves the request - it('NOT Books Only. Budget owner approves and People Ops Partner Group 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').click(); - - cy.runPrimaryBpmnFile(true); - - /* cy.contains('Please select the type of request to start the process.'); + /* 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); @@ -1309,494 +1393,541 @@ describe('Learning and Development Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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('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') + // 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - 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" - ); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - }); - }); - - //Budget owner rejects the request - it('NOT Books Only. 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').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); - let 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "reject" - ); - - }); - }); - - //Budget owner request for additional details - it('NOT Books Only. Budget owner needs 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').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); - let 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(9000); - cy.get('button') - .contains(/^Return to Home$/) - .click(); - - cy.contains('Started by me', { timeout: 60000 }); - cy.logout(); - cy.wait(2000); - - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); - - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - null, - "needmoreinfo" - ); - - //requestor sending additional info - submitWithUser( - username, - password, - processInstanceId, - null, - "providemoreinfo" - ); - - //budget owner approves second time - submitWithUser( - budgetOwnerUsername, - budgetOwnerPassword, - processInstanceId, - 'Task: Reminder: Check Existing Budget', - "approve" - ); - - let peopleOpsUsername = Cypress.env('peopleopssme_username'); - let peopleOpsPassword = Cypress.env('peopleopssme_password'); - cy.log('=====peopleOpsUsername : ' + peopleOpsUsername); - cy.log('=====peopleOpsPassword : ' + peopleOpsPassword); - - submitWithUser( - peopleOpsUsername, - peopleOpsPassword, - processInstanceId, - null, - "approve" - ); - - - }); - }); - + 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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); }); -}); \ No newline at end of file + + // Budget owner rejects the request + it('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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + + // Budget owner request for additional details + it('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(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { 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' + ); + }); + }); + }); +}); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js index eb1f0d6c..c3d7f2d9 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js @@ -27,41 +27,51 @@ const submitWithUser = ( cy.wait(2000); // approve! - if (approvaltype === "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('.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('.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.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 }); + // 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 }); + .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(); + 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(); @@ -72,7 +82,6 @@ const submitWithUser = ( cy.get('button') .contains(/^Continue$/) .click(); - } cy.visit('/'); @@ -86,14 +95,13 @@ const submitWithUser = ( }; describe.only('Other Fees Path - Without Files', () => { - Cypress._.times(1, () => { - //Budget owner approves the request + // Budget owner approves the request it('Budget owner approves', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + 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('/'); @@ -116,53 +124,58 @@ describe.only('Other Fees Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* cy.get('button') .contains(/^Submit$/) .click(); cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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 + // 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_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(); @@ -172,18 +185,20 @@ describe.only('Other Fees Path - Without Files', () => { { 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('.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.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(); @@ -192,28 +207,27 @@ describe.only('Other Fees Path - Without Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'approve' ); - }); }); - //Budget owner rejects the request + // 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); + 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('/'); @@ -236,41 +250,45 @@ describe.only('Other Fees Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* 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_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(); @@ -280,12 +298,15 @@ describe.only('Other Fees Path - Without Files', () => { { 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('.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -299,28 +320,27 @@ describe.only('Other Fees Path - Without Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'reject' ); - }); }); - //Budget owner request for additional details + // 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); + 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('/'); @@ -343,41 +363,45 @@ describe.only('Other Fees Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* 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_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(); @@ -387,12 +411,15 @@ describe.only('Other Fees Path - Without Files', () => { { 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('.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -406,52 +433,49 @@ describe.only('Other Fees Path - Without Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'needmoreinfo' ); - //requestor sending additional info + // requestor sending additional info submitWithUser( username, password, processInstanceId, null, - "providemoreinfo" + 'providemoreinfo' ); - //budget owner approves second time + // budget owner approves second time submitWithUser( budgetOwnerUsername, budgetOwnerPassword, processInstanceId, 'Task: Reminder: Check Existing Budget', - "approve" + 'approve' ); - }); }); - }); }); describe('Other Fees Path - With Files', () => { - Cypress._.times(1, () => { - //Budget owner approves the request + // Budget owner approves the request it('Budget owner approves', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + 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('/'); @@ -474,36 +498,39 @@ describe('Other Fees Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* cy.get('button') .contains(/^Submit$/) .click(); cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -511,9 +538,13 @@ describe('Other Fees Path - With Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -528,54 +559,65 @@ describe('Other Fees Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -590,28 +632,27 @@ describe('Other Fees Path - With Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'approve' ); - }); }); - //Budget owner rejects the request + // 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); + 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('/'); @@ -634,41 +675,45 @@ describe('Other Fees Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* 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_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(); @@ -678,54 +723,65 @@ describe('Other Fees Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -740,28 +796,27 @@ describe('Other Fees Path - With Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'reject' ); - }); }); - //Budget owner request for additional details + // 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); + 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('/'); @@ -784,41 +839,45 @@ describe('Other Fees Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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') + /* 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_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(); @@ -828,54 +887,65 @@ describe('Other Fees Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -890,39 +960,37 @@ describe('Other Fees Path - With Files', () => { cy.logout(); cy.wait(1000); - let budgetOwnerUsername = Cypress.env('budgetowner_username'); - let budgetOwnerPassword = Cypress.env('budgetowner_password'); - cy.log('=====budgetOwnerUsername : ' + budgetOwnerUsername); - cy.log('=====budgetOwnerPassword : ' + budgetOwnerPassword); + 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" + 'needmoreinfo' ); - //requestor sending additional info + // requestor sending additional info submitWithUser( username, password, processInstanceId, null, - "providemoreinfo" + 'providemoreinfo' ); - //budget owner approves second time + // budget owner approves second time submitWithUser( budgetOwnerUsername, budgetOwnerPassword, processInstanceId, 'Task: Reminder: Check Existing Budget', - "approve" + 'approve' ); - }); }); - }); -}); \ No newline at end of file +}); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js index 7b5c5d3e..6b12d3cc 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js @@ -5,99 +5,99 @@ const submitWithUser = ( 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.')); - //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 }); + if (approvaltype === 'approve') { + cy.get('#root > label:nth-child(1)').click(); + cy.get('.cds--text-area__wrapper') + .find('#root') + .type(username.concat(' is approving this.')); + } else if (approvaltype === 'reject') { + cy.get('#root > label:nth-child(3)').click(); + cy.get('.cds--text-area__wrapper') + .find('#root') + .type(username.concat(' is rejecting this.')); + } else if (approvaltype === 'needmoreinfo') { + cy.get('#root > label:nth-child(2)').click(); + cy.get('.cds--text-area__wrapper') + .find('#root') + .type( + username.concat( + ' needs additional info. A software license is a document that provides legally binding guidelines for the use and distribution of software.Software licenses typically provide end users with the right to END.' + ) + ); + // cy.get('.cds--text-area__wrapper').find('#root').type(username.concat(' needs additional info.')); + } else if (approvaltype === 'cpapproved') { + cy.get('#root > label:nth-child(3)').click(); + cy.get('.cds--text-area__wrapper') + .find('#root') + .type(username.concat(' is selecting CP is Approved.')); + } else if (approvaltype === 'providemoreinfo') { + // Form 1 + cy.contains('Task: Submit Details', { timeout: 60000 }); + cy.get('button') + .contains(/^Submit$/) + .click(); + // Form 2 + /* cy.contains('Task: Enter NDR Items', { timeout: 60000 }); cy.get('button') .contains(/^Submit$/) - .click(); - //Form 2 - /*cy.contains('Task: Enter NDR Items', { timeout: 60000 }); - cy.get('button') - .contains(/^Submit$/) - .click();*/ - //Form 3 - cy.contains( - 'Task: Review the Request', - { timeout: 60000 }); + .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.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.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 }); + // if (expectAdditionalApprovalInfoPage) { + // cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 }); + // + // cy.get('button') + // .contains(/^Continue$/) + // .click(); + // } - cy.get('button') - .contains(/^Continue$/) - .click(); - - } - - cy.visit('/'); - - cy.location({ timeout: 60000 }).should((loc) => { - expect(loc.pathname).to.eq('/'); - }); - cy.wait(2000); + // cy.getBySel('return-to-home-button', { timeout: 60000 }); + cy.get('button').contains('Return to Home', { timeout: 60000 }); cy.logout(); - cy.wait(2000); }; -//Software and Licenses Path - Without Files +// Software and Licenses Path - Without Files describe.only('Software and Licenses Path - Without Files', () => { - Cypress._.times(1, () => { - - //Everyone approves with CP + // Everyone approves with CP it.only('Everyone approves with CP', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + 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('/'); @@ -107,22 +107,21 @@ describe.only('Software and Licenses Path - Without Files', () => { cy.runPrimaryBpmnFile(true); - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(2000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; cy.log('==###############===processInstanceId : ', processInstanceId); - let projectId = Cypress.env('project_id'); - cy.wait(2000); + 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_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(); @@ -134,26 +133,32 @@ describe.only('Software and Licenses Path - Without Files', () => { cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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 + // 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_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(); @@ -163,54 +168,55 @@ describe.only('Software and Licenses Path - 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, 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.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); + 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" + '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'); + 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" + 'cpapproved' ); submitWithUser( @@ -218,18 +224,17 @@ describe.only('Software and Licenses Path - Without Files', () => { legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - }); }); - //Everyone approves the request + // 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); + 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('/'); @@ -242,32 +247,28 @@ describe.only('Software and Licenses Path - Without Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - cy.wait(2000); cy.get('input#root-procurement').click(); - cy.wait(2000); - cy.get('button') .contains(/^Submit$/) .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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_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(); @@ -280,9 +281,13 @@ describe.only('Software and Licenses Path - Without Files', () => { cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -290,15 +295,18 @@ describe.only('Software and Licenses Path - Without Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_item_name') + .clear() + .type( + 'A software license is a document that states the rights of the developer and user of software.' + ); cy.get('#root_item_1_qty').clear().type('1'); cy.get('#root_item_1_currency_type').select('Fiat'); cy.get('#root_item_1_currency').select('STN'); cy.get('#root_item_1_unit_price').type('380'); - cy.get('button') .contains(/^Submit$/) .click(); @@ -308,54 +316,55 @@ describe.only('Software and Licenses Path - Without Files', () => { { 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.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.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); + 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" + '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'); + 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" + 'approve' ); submitWithUser( @@ -363,7 +372,7 @@ describe.only('Software and Licenses Path - Without Files', () => { securitysmePassword, processInstanceId, null, - "approve" + 'approve' ); submitWithUser( @@ -371,7 +380,7 @@ describe.only('Software and Licenses Path - Without Files', () => { infrasmePassword, processInstanceId, 'Task: Update Application Landscape', - "approve" + 'approve' ); submitWithUser( @@ -379,18 +388,17 @@ describe.only('Software and Licenses Path - Without Files', () => { legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - }); }); - //Budget owner rejects the request + // 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); + 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('/'); @@ -403,9 +411,7 @@ describe.only('Software and Licenses Path - Without Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - cy.wait(2000); cy.get('input#root-procurement').click(); - cy.wait(2000); cy.get('button') @@ -413,22 +419,21 @@ describe.only('Software and Licenses Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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_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(); @@ -440,14 +445,17 @@ describe.only('Software and Licenses Path - Without Files', () => { 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_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(); @@ -457,12 +465,15 @@ describe.only('Software and Licenses Path - Without Files', () => { { 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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -474,30 +485,28 @@ describe.only('Software and Licenses Path - Without Files', () => { 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); + 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" + 'reject' ); - }); }); - //Budget owner request for additional details + // 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); + 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('/'); @@ -510,9 +519,7 @@ describe.only('Software and Licenses Path - Without Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - cy.wait(2000); cy.get('input#root-procurement').click(); - cy.wait(2000); cy.get('button') @@ -520,22 +527,21 @@ describe.only('Software and Licenses Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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_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(); @@ -547,14 +553,17 @@ describe.only('Software and Licenses Path - Without Files', () => { 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_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(); @@ -564,12 +573,15 @@ describe.only('Software and Licenses Path - Without Files', () => { { 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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -581,50 +593,49 @@ describe.only('Software and Licenses Path - Without Files', () => { 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); + 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" + 'needmoreinfo' ); - //requestor sending additional info + // requestor sending additional info submitWithUser( username, password, processInstanceId, null, - "providemoreinfo" + 'providemoreinfo' ); - //budget owner approves second time + // budget owner approves second time submitWithUser( budgetOwnerUsername, budgetOwnerPassword, processInstanceId, 'Task: Reminder: Check Existing Budget', - "approve" + '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'); + 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" + 'cpapproved' ); submitWithUser( @@ -632,19 +643,17 @@ describe.only('Software and Licenses Path - Without Files', () => { legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - - }); }); - //Infra reject the request + // 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); + 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('/'); @@ -657,9 +666,7 @@ describe.only('Software and Licenses Path - Without Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - cy.wait(2000); cy.get('input#root-procurement').click(); - cy.wait(2000); cy.get('button') @@ -667,22 +674,21 @@ describe.only('Software and Licenses Path - Without Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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_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(); @@ -694,14 +700,17 @@ describe.only('Software and Licenses Path - Without Files', () => { 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_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(); @@ -711,54 +720,55 @@ describe.only('Software and Licenses Path - Without Files', () => { { 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('.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.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); + 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" + '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'); + 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" + 'approve' ); submitWithUser( @@ -766,7 +776,7 @@ describe.only('Software and Licenses Path - Without Files', () => { securitysmePassword, processInstanceId, null, - "approve" + 'approve' ); submitWithUser( @@ -774,27 +784,22 @@ describe.only('Software and Licenses Path - Without Files', () => { infrasmePassword, processInstanceId, null, - "reject" + 'reject' ); - }); }); - - }); }); -//Software and Licenses Path - Without Files and with only mandatory fields +// 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 + // 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); + 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('/'); @@ -807,9 +812,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi /* 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') @@ -817,41 +820,35 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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('#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_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(); @@ -861,12 +858,11 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { 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('.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -878,36 +874,35 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi 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); + 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" + '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'); + 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" + 'cpapproved' ); submitWithUser( @@ -915,18 +910,17 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - }); }); - //Everyone approves the request + // 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); + 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('/'); @@ -939,9 +933,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi /* 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') @@ -949,41 +941,35 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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('#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_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(); @@ -993,12 +979,11 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { 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('.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -1010,36 +995,35 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi 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); + 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" + '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'); + 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" + 'approve' ); submitWithUser( @@ -1047,7 +1031,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi securitysmePassword, processInstanceId, null, - "approve" + 'approve' ); submitWithUser( @@ -1055,7 +1039,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi infrasmePassword, processInstanceId, 'Task: Update Application Landscape', - "approve" + 'approve' ); submitWithUser( @@ -1063,18 +1047,17 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - }); }); - //Budget owner rejects the request + // 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); + 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('/'); @@ -1087,9 +1070,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi /* 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') @@ -1097,41 +1078,35 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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('#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_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(); @@ -1141,12 +1116,11 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { 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('.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -1158,30 +1132,28 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi 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); + 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" + 'reject' ); - }); }); - //Budget owner request for additional details + // 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); + 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('/'); @@ -1194,9 +1166,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi /* 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') @@ -1204,41 +1174,35 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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('#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_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(); @@ -1248,12 +1212,11 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { 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('.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -1265,50 +1228,49 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi 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); + 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" + 'needmoreinfo' ); - //requestor sending additional info + // requestor sending additional info submitWithUser( username, password, processInstanceId, null, - "providemoreinfo" + 'providemoreinfo' ); - //budget owner approves second time + // budget owner approves second time submitWithUser( budgetOwnerUsername, budgetOwnerPassword, processInstanceId, 'Task: Reminder: Check Existing Budget', - "approve" + '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'); + 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" + 'cpapproved' ); submitWithUser( @@ -1316,19 +1278,17 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - - }); }); - //Infra reject the request + // 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); + 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('/'); @@ -1341,9 +1301,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi /* 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') @@ -1351,19 +1309,14 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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'); @@ -1378,14 +1331,13 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - cy.get('#root_item_0_sub_category').select('op_src'); + 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(); @@ -1395,54 +1347,51 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { 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('.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.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); + 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" + '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'); + 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" + 'approve' ); submitWithUser( @@ -1450,7 +1399,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi securitysmePassword, processInstanceId, null, - "approve" + 'approve' ); submitWithUser( @@ -1458,27 +1407,22 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi infrasmePassword, processInstanceId, null, - "reject" + 'reject' ); - }); }); - - }); }); -//Software and Licenses Path - With Files +// Software and Licenses Path - With Files describe('Software and Licenses Path - With Files', () => { - Cypress._.times(1, () => { - - //Everyone approves with CP + // 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); + 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('/'); @@ -1491,9 +1435,7 @@ describe('Software and Licenses Path - With Files', () => { /* cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button - cy.wait(2000); cy.get('input#root-procurement').click(); - cy.wait(2000); cy.get('button') @@ -1501,22 +1443,21 @@ describe('Software and Licenses Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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_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(); @@ -1528,9 +1469,13 @@ describe('Software and Licenses Path - With Files', () => { cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -1538,15 +1483,18 @@ describe('Software and Licenses Path - With Files', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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(); @@ -1556,60 +1504,70 @@ describe('Software and Licenses Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) .click(); - cy.wait(9000); cy.get('button') .contains(/^Return to Home$/) @@ -1619,34 +1577,34 @@ describe('Software and Licenses Path - With Files', () => { 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); + 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" + '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'); + 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" + 'cpapproved' ); submitWithUser( @@ -1654,18 +1612,17 @@ describe('Software and Licenses Path - With Files', () => { legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - }); }); - //Everyone approves the request + // 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); + 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('/'); @@ -1688,22 +1645,23 @@ describe('Software and Licenses Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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(); @@ -1715,14 +1673,15 @@ describe('Software and Licenses Path - With Files', () => { 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_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(); @@ -1732,60 +1691,70 @@ describe('Software and Licenses Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) .click(); - cy.wait(9000); cy.get('button') .contains(/^Return to Home$/) @@ -1795,34 +1764,34 @@ describe('Software and Licenses Path - With Files', () => { 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); + 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" + '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'); + 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" + 'approve' ); submitWithUser( @@ -1830,7 +1799,7 @@ describe('Software and Licenses Path - With Files', () => { securitysmePassword, processInstanceId, null, - "approve" + 'approve' ); submitWithUser( @@ -1838,7 +1807,7 @@ describe('Software and Licenses Path - With Files', () => { infrasmePassword, processInstanceId, 'Task: Update Application Landscape', - "approve" + 'approve' ); submitWithUser( @@ -1846,18 +1815,17 @@ describe('Software and Licenses Path - With Files', () => { legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - }); }); - //Budget owner rejects the request + // 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); + 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('/'); @@ -1880,22 +1848,23 @@ describe('Software and Licenses Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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(); @@ -1907,14 +1876,15 @@ describe('Software and Licenses Path - With Files', () => { 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_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(); @@ -1924,54 +1894,65 @@ describe('Software and Licenses Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -1986,28 +1967,27 @@ describe('Software and Licenses Path - With Files', () => { 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); + 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" + 'reject' ); - }); }); - //Budget owner request for additional details + // 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); + 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('/'); @@ -2030,22 +2010,23 @@ describe('Software and Licenses Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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(); @@ -2057,14 +2038,17 @@ describe('Software and Licenses Path - With Files', () => { 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_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(); @@ -2074,53 +2058,64 @@ describe('Software and Licenses Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -2135,48 +2130,48 @@ describe('Software and Licenses Path - With Files', () => { 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); + 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" + 'needmoreinfo' ); - //requestor sending additional info + // requestor sending additional info submitWithUser( username, password, processInstanceId, null, - "providemoreinfo" + 'providemoreinfo' ); - //budget owner approves second time + // budget owner approves second time submitWithUser( budgetOwnerUsername, budgetOwnerPassword, processInstanceId, 'Task: Reminder: Check Existing Budget', - "approve" + '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'); + 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" + 'cpapproved' ); submitWithUser( @@ -2184,20 +2179,17 @@ describe('Software and Licenses Path - With Files', () => { legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - - - }); }); - //Infra rejects the request + // Infra rejects the request it('Infra Rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + 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('/'); @@ -2220,22 +2212,23 @@ describe('Software and Licenses Path - With Files', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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(); @@ -2247,14 +2240,17 @@ describe('Software and Licenses Path - With Files', () => { 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_sub_category').select('op_src'); + cy.get('#root_item_0_item_name') + .clear() + .type( + 'They provide customers with operational code. Users cannot freely alter this software.' + ); cy.get('#root_item_0_qty').clear().type('2'); cy.get('#root_item_0_currency_type').select('Fiat'); cy.get('#root_item_0_currency').select('STN'); cy.get('#root_item_0_unit_price').type('2416'); - cy.get('button') .contains(/^Submit$/) .click(); @@ -2264,60 +2260,70 @@ describe('Software and Licenses Path - With Files', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) .click(); - cy.wait(9000); cy.get('button') .contains(/^Return to Home$/) @@ -2327,34 +2333,34 @@ describe('Software and Licenses Path - With Files', () => { 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); + 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" + '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'); + 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" + 'approve' ); submitWithUser( @@ -2362,7 +2368,7 @@ describe('Software and Licenses Path - With Files', () => { securitysmePassword, processInstanceId, null, - "approve" + 'approve' ); submitWithUser( @@ -2370,26 +2376,22 @@ describe('Software and Licenses Path - With Files', () => { infrasmePassword, processInstanceId, null, - "reject" + 'reject' ); - }); }); - }); }); -//Software and Licenses Path - With Files and Multiple items +// Software and Licenses Path - With Files and Multiple items describe('Software and Licenses Path - With Files and Multiple items', () => { - Cypress._.times(1, () => { - - //Everyone approves with CP + // 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); + 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('/'); @@ -2412,22 +2414,23 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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(); @@ -2440,9 +2443,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -2450,9 +2457,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -2460,16 +2471,18 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -2479,60 +2492,70 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) .click(); - cy.wait(9000); cy.get('button') .contains(/^Return to Home$/) @@ -2542,34 +2565,34 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { 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); + 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" + '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'); + 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" + 'cpapproved' ); submitWithUser( @@ -2577,18 +2600,17 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - }); }); - //Everyone approves the request + // 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); + 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('/'); @@ -2611,22 +2633,23 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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(); @@ -2638,9 +2661,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -2648,9 +2675,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -2658,15 +2689,18 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -2676,61 +2710,70 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) .click(); - cy.wait(9000); cy.get('button') .contains(/^Return to Home$/) @@ -2740,34 +2783,34 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { 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); + 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" + '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'); + 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" + 'approve' ); submitWithUser( @@ -2775,7 +2818,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { securitysmePassword, processInstanceId, null, - "approve" + 'approve' ); submitWithUser( @@ -2783,7 +2826,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { infrasmePassword, processInstanceId, 'Task: Update Application Landscape', - "approve" + 'approve' ); submitWithUser( @@ -2791,18 +2834,17 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - }); }); - //Budget owner rejects the request + // 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); + 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('/'); @@ -2825,22 +2867,23 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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(); @@ -2853,9 +2896,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -2863,9 +2910,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -2873,9 +2924,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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'); @@ -2890,54 +2945,65 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -2952,28 +3018,27 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { 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); + 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" + 'reject' ); - }); }); - //Budget owner request for additional details + // 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); + 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('/'); @@ -2996,22 +3061,23 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + cy.contains('Request Goods or Services', { timeout: 60000 }); - //cy.wait(5000); + // 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'); + 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_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(); @@ -3023,9 +3089,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.contains('Task: Enter NDR Items', { timeout: 60000 }); */ - //item 0 + // 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_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'); @@ -3033,9 +3103,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_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'); @@ -3043,15 +3117,18 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -3061,54 +3138,65 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) @@ -3121,50 +3209,49 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { 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); + 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" + 'needmoreinfo' ); - //requestor sending additional info + // requestor sending additional info submitWithUser( username, password, processInstanceId, null, - "providemoreinfo" + 'providemoreinfo' ); - //budget owner approves second time + // budget owner approves second time submitWithUser( budgetOwnerUsername, budgetOwnerPassword, processInstanceId, 'Task: Reminder: Check Existing Budget', - "approve" + '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'); + 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" + 'cpapproved' ); submitWithUser( @@ -3172,20 +3259,17 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { legalsmePassword, processInstanceId, null, - "approve" + 'approve' ); - - - }); }); - //Infra rejects the request + // Infra rejects the request it('Infra Rejects', () => { - let username = Cypress.env('requestor_username'); - let password = Cypress.env('requestor_password'); - cy.log('=====username : ' + username); - cy.log('=====password : ' + password); + 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('/'); @@ -3198,9 +3282,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { /* 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') @@ -3208,22 +3290,21 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .click(); */ - cy.contains( - 'Request Goods or Services', - { timeout: 60000 } - ); + 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); + 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_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(); @@ -3233,10 +3314,14 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .contains(/^Submit$/) .click(); - //item 0 + // item 0 cy.contains('Task: Enter NDR Items', { timeout: 60000 }); cy.get('#root_item_0_sub_category').select('op_src'); - cy.get('#root_item_0_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); + cy.get('#root_item_0_item_name') + .clear() + .type( + 'Definition. Open source software (OSS) is software that is distributed with its source code' + ); cy.get('#root_item_0_qty').clear().type('2'); cy.get('#root_item_0_currency_type').select('Fiat'); cy.get('#root_item_0_currency').select('THB'); @@ -3244,9 +3329,13 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 1 + // 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_item_name') + .clear() + .type( + 'Open source software (OSS) is software that is distributed with its source code' + ); cy.get('#root_item_1_qty').clear().type('15'); cy.get('#root_item_1_currency_type').select('Fiat'); cy.get('#root_item_1_currency').select('TRY'); @@ -3254,15 +3343,18 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { cy.get('#root_item > div:nth-child(3) > p > button').click(); - //item 2 + // 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_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(); @@ -3272,61 +3364,70 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { 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('.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.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.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.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.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.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.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.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.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.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.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.contains('Submit the Request').click(); + // cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) .click(); - cy.wait(9000); cy.get('button') .contains(/^Return to Home$/) @@ -3334,36 +3435,35 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { 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); + 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" + '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'); + 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" + 'approve' ); submitWithUser( @@ -3371,7 +3471,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { securitysmePassword, processInstanceId, null, - "approve" + 'approve' ); submitWithUser( @@ -3379,11 +3479,9 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { infrasmePassword, processInstanceId, null, - "reject" + 'reject' ); - }); }); - }); -}); \ No newline at end of file +}); diff --git a/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx b/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx index 270a00d2..368c3285 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx @@ -119,7 +119,11 @@ export default function ProcessInterstitial() { ) { return (
-