spiff-arena/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js

3551 lines
129 KiB
JavaScript
Raw Normal View History

2023-04-06 14:28:24 +00:00
const submitWithUser = (
username,
password,
processInstanceId,
expectAdditionalApprovalInfoPage = false,
approvaltype
2023-04-06 14:28:24 +00:00
) => {
cy.log('========Login with : ', username);
cy.log('========processInstanceId: ', processInstanceId);
cy.login(username, password);
cy.log('=======visit find by id : ');
cy.visit('/admin/process-instances/find-by-id');
cy.get('#process-instance-id-input').type(processInstanceId);
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Tasks I can complete', { timeout: 60000 });
cy.get('.cds--btn').contains(/^Go$/).click();
// approve!
2023-05-12 15:05:35 +00:00
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$/)
2023-05-12 15:05:35 +00:00
.click(); */
// Form 3
cy.contains('Task: Review the Request', { timeout: 60000 });
cy.get('.cds--text-area__wrapper')
.find('#root')
.clear()
.type(
'Providing additional info. Open source is a term that originally referred to open source software (OSS). Open source software is code that is designed to be publicly accessible—anyone can see, modify, and distribute.'
);
// cy.contains('Submit the Request').click();
// cy.get('input[value="Submit the Request"]').click();
} else {
}
cy.get('button')
.contains(/^Submit$/)
.click();
if (expectAdditionalApprovalInfoPage === 'Task: Update Application Landscape') {
cy.contains(expectAdditionalApprovalInfoPage, { timeout: 60000 });
cy.get('button')
.contains(/^Continue$/)
.click();
}
2023-05-12 15:05:35 +00:00
// cy.getBySel('return-to-home-button', { timeout: 60000 });
cy.get('button').contains('Return to Home', { timeout: 60000 });
cy.logout();
};
//Check if the process instance is completed successfully
const checkProcessInstanceCompleted = (
username,
password,
processInstanceId
) => {
cy.wait(2000);
cy.log('========Login with : ', username);
cy.log('========processInstanceId: ', processInstanceId);
cy.login(username, password);
cy.wait(1000);
cy.visit('/admin/process-instances/find-by-id');
cy.get('#process-instance-id-input').type(processInstanceId);
cy.get('button')
.contains(/^Submit$/)
.click();
cy.wait(2000);
cy.get('#tag-1 > span').contains('complete');
}
2023-05-12 15:05:35 +00:00
// Software and Licenses Path - Without Files
describe.only('Software and Licenses Path - Without Files', () => {
Cypress._.times(1, () => {
2023-05-12 15:05:35 +00:00
// Everyone approves with CP
it('Everyone approves with CP', () => {
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
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 });
*/
2023-05-12 15:05:35 +00:00
// item 0
cy.get('#root_item_0_sub_category').select('op_src');
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
// item 1
cy.get('#root_item_1_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
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 }
);
2023-05-12 15:05:35 +00:00
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'
);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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();
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'cpapproved'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Everyone approves the request
it('Everyone approves', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
2023-04-06 14:28:24 +00:00
.contains(/^Submit$/)
.click();
*/
2023-04-06 14:28:24 +00:00
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'
);
cy.get('#root_criticality').select('High');
cy.get('#root_period').clear().type('05-11-2025');
cy.get('body').click();
cy.get('#root_vendor').clear().type('Red Hat');
cy.get('#root_payment_method').select('Reimbursement');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
// item 0
cy.get('#root_item_0_sub_category').select('op_src');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_item_name')
.clear()
.type(
'Open source has become a movement and a way of working that reaches beyond software production'
);
cy.get('#root_item_0_qty').clear().type('2');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('NZD');
cy.get('#root_item_0_unit_price').type('2416');
cy.get('#root_item > div:nth-child(3) > p > button').click();
2023-05-12 15:05:35 +00:00
// item 1
cy.get('#root_item_1_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_1_item_name')
.clear()
.type(
'A software license is a document that states the rights of the developer and user of software.'
);
cy.get('#root_item_1_qty').clear().type('1');
cy.get('#root_item_1_currency_type').select('Fiat');
cy.get('#root_item_1_currency').select('STN');
cy.get('#root_item_1_unit_price').type('380');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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'
);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-04-06 14:28:24 +00:00
2023-05-12 15:05:35 +00:00
// cy.get('input[value="Submit the Request"]').click();
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Submit$/)
.click();
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Return to Home$/)
.click();
cy.contains('Started by me', { timeout: 60000 });
cy.logout();
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
securitysmeUsername,
securitysmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
infrasmeUsername,
infrasmePassword,
processInstanceId,
'Task: Update Application Landscape',
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Budget owner rejects the request
it.only('Budget owner rejects', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'
);
cy.get('#root_criticality').select('Medium');
cy.get('#root_period').clear().type('24-02-2026');
cy.get('body').click();
cy.get('#root_vendor').clear().type('Oracle');
cy.get('#root_payment_method').select('Bank Transfer');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
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');
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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'
);
2023-04-06 14:28:24 +00:00
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-04-06 14:28:24 +00:00
2023-05-12 15:05:35 +00:00
// cy.get('input[value="Submit the Request"]').click();
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Submit$/)
.click();
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Return to Home$/)
.click();
cy.contains('Started by me', { timeout: 60000 });
cy.logout();
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'reject'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Budget owner request for additional details
it('Budget owner need more info', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
2023-04-06 14:28:24 +00:00
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'A software license establishes the rights of all parties involved with the software: the author, the provider and the end users. It defines the relationship between the software company and users and explains how they are protected'
);
cy.get('#root_criticality').select('Low');
cy.get('#root_period').clear().type('25-02-2025');
cy.get('body').click();
cy.get('#root_vendor').clear().type('ABC Licensing Co');
cy.get('#root_payment_method').select('Crypto Transfer');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
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');
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Submit$/)
.click();
2023-04-06 14:28:24 +00:00
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-04-26 14:24:30 +00:00
2023-05-12 15:05:35 +00:00
cy.get('.cds--text-area__wrapper')
.find('#root')
.type(
'They define what users can do with software code they did not write.'
);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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();
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'needmoreinfo'
);
2023-05-12 15:05:35 +00:00
// requestor sending additional info
submitWithUser(
username,
password,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'providemoreinfo'
);
2023-05-12 15:05:35 +00:00
// budget owner approves second time
submitWithUser(
budgetOwnerUsername,
budgetOwnerPassword,
processInstanceId,
'Task: Reminder: Check Existing Budget',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'cpapproved'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
2023-04-06 14:28:24 +00:00
});
2023-05-12 15:05:35 +00:00
// Infra reject the request
it('Infra rejects', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'There are two general types of software licenses that differ based on how they are viewed under copyright law.'
);
cy.get('#root_criticality').select('High');
cy.get('#root_period').clear().type('02-11-2025');
cy.get('body').click();
cy.get('#root_vendor').clear().type('Meta');
cy.get('#root_payment_method').select('Reimbursement');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('op_src');
cy.get('#root_item_0_item_name')
.clear()
.type(
'The open source movement uses the values and decentralized production model of open source software'
);
cy.get('#root_item_0_qty').clear().type('2');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('AUD');
cy.get('#root_item_0_unit_price').type('2416');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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.'
);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// cy.get('input[value="Submit the Request"]').click();
cy.get('button')
.contains(/^Submit$/)
.click();
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Return to Home$/)
.click();
cy.contains('Started by me', { timeout: 60000 });
cy.logout();
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
securitysmeUsername,
securitysmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
infrasmeUsername,
infrasmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'reject'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
2023-04-06 14:28:24 +00:00
});
});
2023-04-06 14:28:24 +00:00
});
2023-05-12 15:05:35 +00:00
// 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, () => {
2023-05-12 15:05:35 +00:00
// Everyone approves with CP
it('Everyone approves with CP', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
// 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 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('op_src');
cy.get('#root_item_0_item_name').clear().type('Open source software');
cy.get('#root_item_0_qty').clear().type('2');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('USD');
cy.get('#root_item_0_unit_price').type('550');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
// 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');
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// cy.get('input[value="Submit the Request"]').click();
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Submit$/)
.click();
cy.get('button')
.contains(/^Return to Home$/)
.click();
cy.contains('Started by me', { timeout: 60000 });
cy.logout();
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'cpapproved'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
2023-04-06 14:28:24 +00:00
});
2023-05-12 15:05:35 +00:00
// Everyone approves the request
it('Everyone approves', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
// 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 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('op_src');
cy.get('#root_item_0_item_name').clear().type('open source');
cy.get('#root_item_0_qty').clear().type('1');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('AED');
cy.get('#root_item_0_unit_price').type('1520');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
// 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');
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// cy.get('input[value="Submit the Request"]').click();
cy.get('button')
.contains(/^Submit$/)
.click();
2023-04-06 14:28:24 +00:00
cy.get('button')
.contains(/^Return to Home$/)
.click();
cy.contains('Started by me', { timeout: 60000 });
cy.logout();
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
securitysmeUsername,
securitysmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
infrasmeUsername,
infrasmePassword,
processInstanceId,
'Task: Update Application Landscape',
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
2023-04-06 14:28:24 +00:00
});
2023-05-12 15:05:35 +00:00
// Budget owner rejects the request
it('Budget owner rejects', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
// 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 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('lic_and_sub');
cy.get('#root_item_0_item_name').clear().type('Software development');
cy.get('#root_item_0_qty').clear().type('2');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('EUR');
cy.get('#root_item_0_unit_price').type('1400');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
// 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');
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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();
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'reject'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Budget owner request for additional details
it('Budget owner need more info', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
// 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 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('lic_and_sub');
cy.get('#root_item_0_item_name').clear().type('License');
cy.get('#root_item_0_qty').clear().type('4');
cy.get('#root_item_0_currency_type').select('Crypto');
cy.get('#root_item_0_currency').select('SNT');
cy.get('#root_item_0_unit_price').type('450');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-04-06 14:28:24 +00:00
2023-05-12 15:05:35 +00:00
// 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.');
2023-04-06 14:28:24 +00:00
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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();
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'needmoreinfo'
);
2023-05-12 15:05:35 +00:00
// requestor sending additional info
submitWithUser(
username,
password,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'providemoreinfo'
);
2023-05-12 15:05:35 +00:00
// budget owner approves second time
submitWithUser(
budgetOwnerUsername,
budgetOwnerPassword,
processInstanceId,
'Task: Reminder: Check Existing Budget',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'cpapproved'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
2023-04-06 14:28:24 +00:00
});
2023-05-12 15:05:35 +00:00
// Infra reject the request
it('Infra rejects', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
cy.get('#root_purpose').clear().type('Software is needed');
cy.get('#root_criticality').select('High');
cy.get('#root_period').clear().type('25-11-2025');
cy.get('body').click();
// cy.get('#root_vendor').clear().type('Embassar');
// cy.get('#root_payment_method').select('Reimbursement');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('op_src');
cy.get('#root_item_0_item_name').clear().type('Open source');
cy.get('#root_item_0_qty').clear().type('2');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('AUD');
cy.get('#root_item_0_unit_price').type('2416');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
// 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');
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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();
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
securitysmeUsername,
securitysmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
infrasmeUsername,
infrasmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'reject'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
});
});
2023-05-12 15:05:35 +00:00
// Software and Licenses Path - With Files
describe('Software and Licenses Path - With Files', () => {
Cypress._.times(1, () => {
2023-05-12 15:05:35 +00:00
// Everyone approves with CP
it('Everyone approves with CP', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
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 });
*/
2023-05-12 15:05:35 +00:00
// item 0
cy.get('#root_item_0_sub_category').select('op_src');
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
// item 1
cy.get('#root_item_1_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_1_item_name')
.clear()
.type(
'A software license is a document that provides legally binding guidelines for the use and distri END'
);
cy.get('#root_item_1_qty').clear().type('1');
cy.get('#root_item_1_currency_type').select('Fiat');
cy.get('#root_item_1_currency').select('INR');
cy.get('#root_item_1_unit_price').type('4500');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['sampletext.txt']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'cpapproved'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Everyone approves the request
it('Everyone approves', () => {
2023-05-12 15:05:35 +00:00
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();
*/
2023-05-12 15:05:35 +00:00
cy.contains('Request Goods or Services', { timeout: 60000 });
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.wait(2000);
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'Stware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'
);
cy.get('#root_criticality').select('High');
cy.get('#root_period').clear().type('30-11-2024');
cy.get('body').click();
cy.get('#root_vendor').clear().type('ORACLE LTD');
cy.get('#root_payment_method').select('Bank Transfer');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('op_src');
cy.get('#root_item_0_item_name')
.clear()
.type('A bounty is a payment or reward of money to locate');
cy.get('#root_item_0_qty').clear().type('2');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('SGD');
cy.get('#root_item_0_unit_price').type('2416');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['png-5mb-2.png']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
securitysmeUsername,
securitysmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
infrasmeUsername,
infrasmePassword,
processInstanceId,
'Task: Update Application Landscape',
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Budget owner rejects the request
it('Budget owner rejects', () => {
2023-05-12 15:05:35 +00:00
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();
*/
2023-05-12 15:05:35 +00:00
cy.contains('Request Goods or Services', { timeout: 60000 });
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.wait(2000);
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'Stware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'
);
cy.get('#root_criticality').select('Medium');
cy.get('#root_period').clear().type('24-12-2023');
cy.get('body').click();
cy.get('#root_vendor').clear().type('Subscription PVT');
cy.get('#root_payment_method').select('Bank Transfer');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('lic_and_sub');
cy.get('#root_item_0_item_name')
.clear()
.type('Software development consultants with Python background');
cy.get('#root_item_0_qty').clear().type('5');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('EUR');
cy.get('#root_item_0_unit_price').type('250');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['png-5mb-2.png']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'reject'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Budget owner request for additional details
it('Budget owner need more info', () => {
2023-05-12 15:05:35 +00:00
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();
*/
2023-05-12 15:05:35 +00:00
cy.contains('Request Goods or Services', { timeout: 60000 });
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.wait(2000);
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'Stware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'
);
cy.get('#root_criticality').select('Low');
cy.get('#root_period').clear().type('25-02-2025');
cy.get('body').click();
cy.get('#root_vendor').clear().type('LIC INST');
cy.get('#root_payment_method').select('Crypto Transfer');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('lic_and_sub');
cy.get('#root_item_0_item_name')
.clear()
.type(
'Freelancers to do the Python development and front end react app development'
);
cy.get('#root_item_0_qty').clear().type('4');
cy.get('#root_item_0_currency_type').select('Crypto');
cy.get('#root_item_0_currency').select('SNT');
cy.get('#root_item_0_unit_price').type('450');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['png-5mb-2.png']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'needmoreinfo'
);
2023-05-12 15:05:35 +00:00
// requestor sending additional info
submitWithUser(
username,
password,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'providemoreinfo'
);
2023-05-12 15:05:35 +00:00
// budget owner approves second time
submitWithUser(
budgetOwnerUsername,
budgetOwnerPassword,
processInstanceId,
'Task: Reminder: Check Existing Budget',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'cpapproved'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Infra rejects the request
it('Infra Rejects', () => {
2023-05-12 15:05:35 +00:00
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();
*/
2023-05-12 15:05:35 +00:00
cy.contains('Request Goods or Services', { timeout: 60000 });
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.wait(2000);
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
"Proprietary licenses are often referred to as closed source. They provide customers with operational code. Users cannot freely alter this software. These licenses also usually restrict reverse engineering the software's code to obtain the source code"
);
cy.get('#root_criticality').select('High');
cy.get('#root_period').clear().type('25-11-2025');
cy.get('body').click();
cy.get('#root_vendor').clear().type('Red HAT');
cy.get('#root_payment_method').select('Reimbursement');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_sub_category').select('op_src');
cy.get('#root_item_0_item_name')
.clear()
.type(
'They provide customers with operational code. Users cannot freely alter this software.'
);
cy.get('#root_item_0_qty').clear().type('2');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('STN');
cy.get('#root_item_0_unit_price').type('2416');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['png-5mb-2.png']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
securitysmeUsername,
securitysmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
infrasmeUsername,
infrasmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'reject'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
});
});
2023-05-12 15:05:35 +00:00
// Software and Licenses Path - With Files and Multiple items
describe('Software and Licenses Path - With Files and Multiple items', () => {
Cypress._.times(1, () => {
2023-05-12 15:05:35 +00:00
// Everyone approves with CP
it('Everyone approves with CP', () => {
2023-05-12 15:05:35 +00:00
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();
*/
2023-05-12 15:05:35 +00:00
cy.contains('Request Goods or Services', { timeout: 60000 });
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.wait(2000);
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
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 });
*/
2023-05-12 15:05:35 +00:00
// item 0
cy.get('#root_item_0_sub_category').select('op_src');
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
// item 1
cy.get('#root_item_1_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
// item 2
cy.get('#root_item_2_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
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 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['sampletext.txt']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'cpapproved'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Everyone approves the request
it('Everyone approves', () => {
2023-05-12 15:05:35 +00:00
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();
*/
2023-05-12 15:05:35 +00:00
cy.contains('Request Goods or Services', { timeout: 60000 });
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.wait(2000);
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'
);
cy.get('#root_criticality').select('High');
cy.get('#root_period').clear().type('25-11-2025');
cy.get('body').click();
cy.get('#root_vendor').clear().type('Apple');
cy.get('#root_payment_method').select('Crypto Transfer');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
// item 0
cy.get('#root_item_0_sub_category').select('op_src');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_item_name')
.clear()
.type(
'Definition. Open source software (OSS) is software that is distributed with its source code'
);
cy.get('#root_item_0_qty').clear().type('2');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('AED');
cy.get('#root_item_0_unit_price').type('1250');
cy.get('#root_item > div:nth-child(3) > p > button').click();
2023-05-12 15:05:35 +00:00
// item 1
cy.get('#root_item_1_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_1_item_name')
.clear()
.type(
'A software license is a document that provides binding guidelines for the use and distribution.'
);
cy.get('#root_item_1_qty').clear().type('5');
cy.get('#root_item_1_currency_type').select('Crypto');
cy.get('#root_item_1_currency').select('SNT');
cy.get('#root_item_1_unit_price').type('25000');
cy.get('#root_item > div:nth-child(3) > p > button').click();
2023-05-12 15:05:35 +00:00
// item 2
cy.get('#root_item_2_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_2_item_name')
.clear()
.type(
'Subscription relates to a licensing model that allows users to pay regularly for a computer program'
);
cy.get('#root_item_2_qty').clear().type('3');
cy.get('#root_item_2_currency_type').select('Crypto');
cy.get('#root_item_2_currency').select('ETH');
cy.get('#root_item_2_unit_price').type('2.10');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['png-5mb-2.png']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
securitysmeUsername,
securitysmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
infrasmeUsername,
infrasmePassword,
processInstanceId,
'Task: Update Application Landscape',
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Budget owner rejects the request
it('Budget owner rejects', () => {
2023-05-12 15:05:35 +00:00
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();
*/
2023-05-12 15:05:35 +00:00
cy.contains('Request Goods or Services', { timeout: 60000 });
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.wait(2000);
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'
);
cy.get('#root_criticality').select('Medium');
cy.get('#root_period').clear().type('24-02-2026');
cy.get('body').click();
cy.get('#root_vendor').clear().type('Subscription PVT');
cy.get('#root_payment_method').select('Bank Transfer');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
// item 0
cy.get('#root_item_0_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_item_name')
.clear()
.type(
'Subscription relates to a licensing model that allows users to pay regularly for a computer program'
);
cy.get('#root_item_0_qty').clear().type('5');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('USD');
cy.get('#root_item_0_unit_price').type('250.50');
cy.get('#root_item > div:nth-child(3) > p > button').click();
2023-05-12 15:05:35 +00:00
// item 1
cy.get('#root_item_1_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_1_item_name')
.clear()
.type(
'A software license is a document that provides binding guidelines for the use and distribution.'
);
cy.get('#root_item_1_qty').clear().type('5');
cy.get('#root_item_1_currency_type').select('Fiat');
cy.get('#root_item_1_currency').select('GBP');
cy.get('#root_item_1_unit_price').type('5200');
cy.get('#root_item > div:nth-child(3) > p > button').click();
2023-05-12 15:05:35 +00:00
// item 2
cy.get('#root_item_2_sub_category').select('op_src');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_2_item_name')
.clear()
.type(
'Definition. Open source software (OSS) is software that is distributed with its source code'
);
cy.get('#root_item_2_qty').clear().type('3');
cy.get('#root_item_2_currency_type').select('Fiat');
cy.get('#root_item_2_currency').select('HKD');
cy.get('#root_item_2_unit_price').type('2100');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['sampletext.txt']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'reject'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Budget owner request for additional details
it('Budget owner need more info', () => {
2023-05-12 15:05:35 +00:00
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();
*/
2023-05-12 15:05:35 +00:00
cy.contains('Request Goods or Services', { timeout: 60000 });
2023-05-12 15:05:35 +00:00
// 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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.wait(2000);
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'
);
cy.get('#root_criticality').select('Low');
cy.get('#root_period').clear().type('25-02-2025');
cy.get('body').click();
cy.get('#root_vendor').clear().type('LIC INST');
cy.get('#root_payment_method').select('Crypto Transfer');
/* cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
*/
2023-05-12 15:05:35 +00:00
// item 0
cy.get('#root_item_0_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_item_name')
.clear()
.type(
'A software license is a document that provides binding guidelines for the use and distribution.'
);
cy.get('#root_item_0_qty').clear().type('24');
cy.get('#root_item_0_currency_type').select('Crypto');
cy.get('#root_item_0_currency').select('SNT');
cy.get('#root_item_0_unit_price').type('450');
cy.get('#root_item > div:nth-child(3) > p > button').click();
2023-05-12 15:05:35 +00:00
// item 1
cy.get('#root_item_1_sub_category').select('op_src');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_1_item_name')
.clear()
.type(
'Definition. Open source software (OSS) is software that is distributed with its source code'
);
cy.get('#root_item_1_qty').clear().type('15');
cy.get('#root_item_1_currency_type').select('Crypto');
cy.get('#root_item_1_currency').select('ETH');
cy.get('#root_item_1_unit_price').type('0.85');
cy.get('#root_item > div:nth-child(3) > p > button').click();
2023-05-12 15:05:35 +00:00
// item 2
cy.get('#root_item_2_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_2_item_name')
.clear()
.type(
'Subscription relates to a licensing model that allows users to pay regularly for a computer program'
);
cy.get('#root_item_2_qty').clear().type('8');
cy.get('#root_item_2_currency_type').select('Crypto');
cy.get('#root_item_2_currency').select('DAI');
cy.get('#root_item_2_unit_price').type('2100');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['sampletext.txt']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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();
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'needmoreinfo'
);
2023-05-12 15:05:35 +00:00
// requestor sending additional info
submitWithUser(
username,
password,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'providemoreinfo'
);
2023-05-12 15:05:35 +00:00
// budget owner approves second time
submitWithUser(
budgetOwnerUsername,
budgetOwnerPassword,
processInstanceId,
'Task: Reminder: Check Existing Budget',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'cpapproved'
);
submitWithUser(
legalsmeUsername,
legalsmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
2023-05-12 15:05:35 +00:00
// Infra rejects the request
it('Infra Rejects', () => {
2023-05-12 15:05:35 +00:00
const username = Cypress.env('requestor_username');
const password = Cypress.env('requestor_password');
cy.log(`=====username : ${username}`);
cy.log(`=====password : ${password}`);
cy.login(username, password);
cy.visit('/');
cy.contains('Start New +').click();
cy.contains('Request Goods or Services').click();
cy.runPrimaryBpmnFile(true);
/* cy.contains('Please select the type of request to start the process.');
// wait a second to ensure we can click the radio button
cy.get('input#root-procurement').click();
cy.get('button')
.contains(/^Submit$/)
.click();
*/
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
const projectId = Cypress.env('project_id');
cy.get('#root_project').select(projectId);
cy.get('#root_category').select('soft_and_lic');
2023-05-12 15:05:35 +00:00
cy.get('#root_purpose')
.clear()
.type(
'Free and open source software (FOSS) licenses are often referred to as open source. FOSS source code is available to the customer along with the software product. The customer is usually allowed to use the source code to change the software.'
);
cy.get('#root_criticality').select('High');
cy.get('#root_period').clear().type('20-11-2025');
cy.get('body').click();
cy.get('#root_vendor').clear().type('Atlassian');
cy.get('#root_payment_method').select('Debit Card');
cy.get('button')
.contains(/^Submit$/)
.click();
2023-05-12 15:05:35 +00:00
// item 0
cy.contains('Task: Enter NDR Items', { timeout: 60000 });
cy.get('#root_item_0_sub_category').select('op_src');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_0_item_name')
.clear()
.type(
'Definition. Open source software (OSS) is software that is distributed with its source code'
);
cy.get('#root_item_0_qty').clear().type('2');
cy.get('#root_item_0_currency_type').select('Fiat');
cy.get('#root_item_0_currency').select('THB');
cy.get('#root_item_0_unit_price').type('1350');
cy.get('#root_item > div:nth-child(3) > p > button').click();
2023-05-12 15:05:35 +00:00
// item 1
cy.get('#root_item_1_sub_category').select('op_src');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_1_item_name')
.clear()
.type(
'Open source software (OSS) is software that is distributed with its source code'
);
cy.get('#root_item_1_qty').clear().type('15');
cy.get('#root_item_1_currency_type').select('Fiat');
cy.get('#root_item_1_currency').select('TRY');
cy.get('#root_item_1_unit_price').type('3200');
cy.get('#root_item > div:nth-child(3) > p > button').click();
2023-05-12 15:05:35 +00:00
// item 2
cy.get('#root_item_2_sub_category').select('lic_and_sub');
2023-05-12 15:05:35 +00:00
cy.get('#root_item_2_item_name')
.clear()
.type(
'Subscription relates to a licensing model that allows users to pay regularly for a computer program'
);
cy.get('#root_item_2_qty').clear().type('8');
cy.get('#root_item_2_currency_type').select('Crypto');
cy.get('#root_item_2_currency').select('DAI');
cy.get('#root_item_2_unit_price').type('2100');
cy.get('button')
.contains(/^Submit$/)
.click();
cy.contains(
'Review and provide any supporting information or files for your request.',
{ timeout: 60000 }
);
2023-05-12 15:05:35 +00:00
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();
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
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);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get(
'#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg'
).click();
cy.wait(1000);
2023-05-12 15:05:35 +00:00
cy.get('input[type=file]').attachFile(['png-5mb-2.png']);
cy.wait(2000);
2023-05-12 15:05:35 +00:00
// cy.contains('Submit the Request').click();
2023-05-12 15:05:35 +00:00
// 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();
2023-05-12 15:05:35 +00:00
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',
2023-05-12 15:05:35 +00:00
'approve'
);
2023-05-12 15:05:35 +00:00
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,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
securitysmeUsername,
securitysmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'approve'
);
submitWithUser(
infrasmeUsername,
infrasmePassword,
processInstanceId,
null,
2023-05-12 15:05:35 +00:00
'reject'
);
checkProcessInstanceCompleted(username, password, processInstanceId);
});
});
});
2023-05-12 15:05:35 +00:00
});