From 886577c60ba1f5a10f3e0591012acb96fea4830e Mon Sep 17 00:00:00 2001 From: Madhurya Liyanage Date: Fri, 28 Apr 2023 15:25:04 +0530 Subject: [PATCH 1/2] Updates to match the interstitial pages --- .../pilot/NDR_PP1/consultingfees.cy.js | 49 ++++-- .../cypress/pilot/NDR_PP1/equipment.cy.js | 144 ++++++++++----- .../pilot/NDR_PP1/learninganddev.cy.js | 96 ++++++---- .../cypress/pilot/NDR_PP1/otherfees.cy.js | 60 ++++--- .../pilot/NDR_PP1/softwarelicense.cy.js | 164 ++++++++++++------ 5 files changed, 346 insertions(+), 167 deletions(-) diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js index f6900d39..90a7c144 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/consultingfees.cy.js @@ -120,8 +120,8 @@ describe('Consulting Fees Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + cy.wait(5000); + cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -191,7 +191,10 @@ describe('Consulting Fees Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.wait(3000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); cy.contains('Started by me', { timeout: 60000 }); cy.logout(); @@ -246,8 +249,8 @@ describe('Consulting Fees Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -317,7 +320,10 @@ describe('Consulting Fees Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.wait(3000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); cy.contains('Started by me', { timeout: 60000 }); cy.logout(); @@ -372,8 +378,8 @@ describe('Consulting Fees Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -444,7 +450,10 @@ describe('Consulting Fees Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.wait(3000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); cy.contains('Started by me', { timeout: 60000 }); cy.logout(); @@ -523,8 +532,8 @@ describe('Consulting Fees Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -636,7 +645,7 @@ describe('Consulting Fees Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); + cy.wait(9000); cy.visit('/'); cy.contains('Started by me', { timeout: 60000 }); cy.logout(); @@ -691,8 +700,8 @@ describe('Consulting Fees Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -804,8 +813,10 @@ describe('Consulting Fees Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); cy.contains('Started by me', { timeout: 60000 }); cy.logout(); @@ -860,8 +871,8 @@ describe('Consulting Fees Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -971,7 +982,7 @@ describe('Consulting Fees Path - With Files', () => { cy.get('button') .contains(/^Submit$/) .click(); - cy.wait(6000); + cy.wait(9000); cy.visit('/'); cy.contains('Started by me', { timeout: 60000 }); cy.logout(); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js index b70f94ab..a4f8ef3c 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/equipment.cy.js @@ -124,7 +124,7 @@ describe('Equipment Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -206,7 +206,10 @@ describe('Equipment Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -276,7 +279,7 @@ describe('Equipment Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -328,7 +331,10 @@ describe('Equipment Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -396,7 +402,7 @@ describe('Equipment Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -446,7 +452,10 @@ describe('Equipment Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -541,7 +550,7 @@ describe('Equipment Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -592,7 +601,10 @@ describe('Equipment Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -646,7 +658,7 @@ describe('Equipment Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -697,7 +709,10 @@ describe('Equipment Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -751,7 +766,7 @@ describe('Equipment Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -802,7 +817,10 @@ describe('Equipment Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -874,7 +892,7 @@ describe('Equipment Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -925,7 +943,10 @@ describe('Equipment Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -993,7 +1014,7 @@ describe('Equipment Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1043,7 +1064,10 @@ describe('Equipment Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1111,7 +1135,7 @@ describe('Equipment Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1161,7 +1185,10 @@ describe('Equipment Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1254,7 +1281,7 @@ describe('Equipment Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1376,8 +1403,11 @@ describe('Equipment Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1445,7 +1475,7 @@ describe('Equipment Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1536,8 +1566,11 @@ describe('Equipment Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1605,7 +1638,7 @@ describe('Equipment Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1695,8 +1728,11 @@ describe('Equipment Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1791,7 +1827,7 @@ describe('Equipment Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1883,8 +1919,11 @@ describe('Equipment Path - With Files', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1938,7 +1977,7 @@ describe('Equipment Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2030,8 +2069,11 @@ describe('Equipment Path - With Files', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2085,7 +2127,7 @@ describe('Equipment Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2176,8 +2218,11 @@ describe('Equipment Path - With Files', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2249,7 +2294,7 @@ describe('Equipment Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2340,8 +2385,11 @@ describe('Equipment Path - With Files', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2409,7 +2457,7 @@ describe('Equipment Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2499,8 +2547,11 @@ describe('Equipment Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2568,7 +2619,7 @@ describe('Equipment Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2659,8 +2710,11 @@ describe('Equipment Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(20000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js index 911a0023..a794344d 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/learninganddev.cy.js @@ -120,7 +120,7 @@ describe('Learning and Development Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -171,7 +171,10 @@ describe('Learning and Development Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -225,7 +228,7 @@ describe('Learning and Development Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -275,7 +278,10 @@ describe('Learning and Development Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -329,7 +335,7 @@ describe('Learning and Development Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -379,7 +385,10 @@ describe('Learning and Development Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -452,7 +461,7 @@ describe('Learning and Development Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -525,7 +534,10 @@ describe('Learning and Development Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -592,7 +604,7 @@ describe('Learning and Development Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -642,7 +654,10 @@ describe('Learning and Development Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -696,7 +711,7 @@ describe('Learning and Development Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -746,7 +761,10 @@ describe('Learning and Development Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -827,7 +845,7 @@ describe('Learning and Development Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -919,8 +937,11 @@ describe('Learning and Development Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -974,7 +995,7 @@ describe('Learning and Development Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1066,8 +1087,11 @@ describe('Learning and Development Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1121,7 +1145,7 @@ describe('Learning and Development Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1212,8 +1236,11 @@ describe('Learning and Development Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1286,7 +1313,7 @@ describe('Learning and Development Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1400,8 +1427,11 @@ describe('Learning and Development Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1468,7 +1498,7 @@ describe('Learning and Development Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1560,8 +1590,11 @@ describe('Learning and Development Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1615,7 +1648,7 @@ describe('Learning and Development Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1707,8 +1740,11 @@ describe('Learning and Development Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js index 7e4410a8..4375b39c 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/otherfees.cy.js @@ -120,8 +120,8 @@ describe('Other Fees Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -183,7 +183,10 @@ describe('Other Fees Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(1000); @@ -237,8 +240,8 @@ describe('Other Fees Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -287,7 +290,10 @@ describe('Other Fees Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(1000); @@ -341,8 +347,8 @@ describe('Other Fees Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -391,7 +397,10 @@ describe('Other Fees Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(1000); @@ -469,8 +478,8 @@ describe('Other Fees Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -571,8 +580,11 @@ describe('Other Fees Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(1000); @@ -626,8 +638,8 @@ describe('Other Fees Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -718,8 +730,11 @@ describe('Other Fees Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(1000); @@ -773,8 +788,8 @@ describe('Other Fees Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); - cy.url().then((currentUrl) => { + 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]; @@ -865,8 +880,11 @@ describe('Other Fees Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(1000); diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js index 980d2398..c8f04143 100644 --- a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/softwarelicense.cy.js @@ -125,7 +125,7 @@ describe('Software and Licenses Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -188,7 +188,10 @@ describe('Software and Licenses Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -267,7 +270,7 @@ describe('Software and Licenses Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -330,7 +333,10 @@ describe('Software and Licenses Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -425,7 +431,7 @@ describe('Software and Licenses Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -475,7 +481,10 @@ describe('Software and Licenses Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -529,7 +538,7 @@ describe('Software and Licenses Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -579,7 +588,10 @@ describe('Software and Licenses Path - Without Files', () => { .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -673,7 +685,7 @@ describe('Software and Licenses Path - Without Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -724,7 +736,10 @@ describe('Software and Licenses Path - Without Files', () => { .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -788,7 +803,7 @@ describe('Software and Licenses Path - With Files', () => { Cypress._.times(1, () => { //Everyone approves with CP - it('Everyone approves with CP', () => { + it.only('Everyone approves with CP', () => { let username = Cypress.env('requestor_username'); let password = Cypress.env('requestor_password'); cy.log('=====username : ' + username); @@ -820,7 +835,7 @@ describe('Software and Licenses Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -924,8 +939,11 @@ describe('Software and Licenses Path - With Files', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1004,7 +1022,7 @@ describe('Software and Licenses Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1097,8 +1115,11 @@ describe('Software and Licenses Path - With Files', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1193,7 +1214,7 @@ describe('Software and Licenses Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1285,8 +1306,11 @@ describe('Software and Licenses Path - With Files', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1308,7 +1332,7 @@ describe('Software and Licenses Path - With Files', () => { }); //Budget owner request for additional details - it.only('Budget owner need more info', () => { + it('Budget owner need more info', () => { let username = Cypress.env('requestor_username'); let password = Cypress.env('requestor_password'); cy.log('=====username : ' + username); @@ -1340,7 +1364,7 @@ describe('Software and Licenses Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1432,7 +1456,10 @@ describe('Software and Licenses Path - With Files', () => { .click(); cy.wait(9000); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1527,7 +1554,7 @@ describe('Software and Licenses Path - With Files', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1620,8 +1647,11 @@ describe('Software and Licenses Path - With Files', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1716,7 +1746,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -1832,8 +1862,11 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -1912,7 +1945,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2027,8 +2060,11 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2123,7 +2159,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2236,8 +2272,11 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2291,7 +2330,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2404,8 +2443,11 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .contains(/^Submit$/) .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2500,7 +2542,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2614,8 +2656,11 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { .click(); - cy.wait(6000); - cy.visit('/'); + cy.wait(9000); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2673,7 +2718,7 @@ describe('Software and Licenses Path - With Files and Multiple items', () => { }); //Software and Licenses Path - Without Files and with only mandatory fields -describe('Software and Licenses Path - Without Files and with only mandatory fields', () => { +describe.only('Software and Licenses Path - Without Files and with only mandatory fields', () => { Cypress._.times(1, () => { @@ -2710,7 +2755,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2760,7 +2805,10 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2839,7 +2887,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -2889,7 +2937,10 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -2984,7 +3035,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -3034,7 +3085,10 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -3088,7 +3142,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -3138,7 +3192,10 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .contains(/^Submit$/) .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); @@ -3232,7 +3289,7 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi { timeout: 60000 } ); - cy.wait(15000); + cy.wait(5000); cy.url().then((currentUrl) => { // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" // extract the digits after /tasks @@ -3283,7 +3340,10 @@ describe('Software and Licenses Path - Without Files and with only mandatory fi .click(); - cy.visit('/'); + cy.get('button') + .contains(/^Return to Home$/) + .click(); + cy.contains('Started by me', { timeout: 60000 }); cy.logout(); cy.wait(2000); From 13d0886c5e093eb5580043f40a2826cccbbf7423 Mon Sep 17 00:00:00 2001 From: Madhurya Liyanage Date: Fri, 28 Apr 2023 15:25:54 +0530 Subject: [PATCH 2/2] Test cases for request - add, edit, cancel, save as draft --- .../pilot/NDR_PP1/initiaterequest.cy.js | 1246 +++++++++++++++++ 1 file changed, 1246 insertions(+) create mode 100644 spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js diff --git a/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js new file mode 100644 index 00000000..101d020b --- /dev/null +++ b/spiffworkflow-frontend/cypress/pilot/NDR_PP1/initiaterequest.cy.js @@ -0,0 +1,1246 @@ + +//Software and License - Without Files +describe('Initiate a Request - Without Files', () => { + Cypress._.times(1, () => { + //Submit a Software and License request - Without Files + it('Submit a Software and License request', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Windows 10 S, w/Ghost Manta Accessories, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); + + cy.contains('Submit the Request').click(); + + cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + }); + }); + + //Submit a Software and License request - Without Files and with mandatory fields only + it('Submit a Software and License request - Without Files and with mandatory fields only', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Need to buy a Software'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('24-11-2025'); + cy.get('body').click(); + //cy.get('#root_vendor').clear().type('Embassar'); + //cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('USD'); + cy.get('#root_item_0_unit_price').type('550'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + //cy.get('.cds--text-area__wrapper').find('#root').type('For professionals working in the professional services, ‘consultant’ and advisor’ are often used and fall under common terminology. Consultancy.uk zooms in on this field to get a closer look. \n https://www.consultancy.uk/career/what-is-consulting'); + + cy.contains('Submit the Request').click(); + + cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + }); + }); + + //Edit a Software and License request - Without Files + it('Edit a Software and License request', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Windows 10 S, w/Ghost Manta Accessories, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); + + cy.contains('Edit the Request').click(); + + cy.get('input[value="Edit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + + + //Form 1 + cy.contains('Task: Submit Details', { timeout: 60000 }); + cy.wait(2000); + cy.get('button') + .contains(/^Submit$/) + .click(); + //Form 2 + /*cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + cy.get('button') + .contains(/^Submit$/) + .click();*/ + //Form 3 + cy.contains( + 'Task: Review the Request', + { timeout: 60000 }); + + cy.get('.cds--text-area__wrapper').find('#root').type('EDITING INFO : 2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); + + cy.contains('Submit the Request').click(); + cy.get('input[value="Submit the Request"]').click(); + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + }); + }); + + //Save as Draft a Software and License request - Without Files + it.only('Save as Draft a Software and License request', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + cy.get('button') + .contains(/^Save as draft$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + + + }); + }); + + //Cancel a Software and License request 1- Without Files + it('Cancel a Software and License request 1', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + cy.get('#root-Yes').click(); + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + + + }); + }); + + //Cancel a Software and License request 2- Without Files + it('Cancel a Software and License request 2', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Windows 10 S, w/Ghost Manta Accessories, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); + + cy.contains('Cancel the Request').click(); + + cy.get('input[value="Cancel the Request"]').click(); + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + + + }); + }); + }); +}); + +//Software and License - With Files +describe('Initiate a Request - With Files', () => { + Cypress._.times(1, () => { + //Submit a Software and License request - Without Files + it('Submit a Software and License request', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('15-11-2035'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft Corp'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is developed in a decentralized and collaborative way'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('JPY'); + cy.get('#root_item_0_unit_price').type('2416'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('INR'); + cy.get('#root_item_1_unit_price').type('4500'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('Open source software is developed in a decentralized and collaborative way, relying on peer review and community production. Open source software is often cheaper more flexible. \nhttps://www.redhat.com/en'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['sampletext.txt']); + + cy.wait(2000); + + cy.contains('Submit the Request').click(); + + cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + }); + }); + + //Submit a Software and License request - With Files and Multiple items + it('Submit a Software and License request - With Files and Multiple items', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Software licenses typically are proprietary, free or open source. The distinguishing feature is the terms under which users may redistribute or copy the software for future development or use.'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Meta Corp'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Definition. Open source software (OSS) is software that is distributed with its source code'); + cy.get('#root_item_0_qty').clear().type('1'); + cy.get('#root_item_0_currency_type').select('Fiat'); + cy.get('#root_item_0_currency').select('AUD'); + cy.get('#root_item_0_unit_price').type('2416'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides binding guidelines for the use and distribution.'); + cy.get('#root_item_1_qty').clear().type('5'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('EUR'); + cy.get('#root_item_1_unit_price').type('250'); + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 2 + cy.get('#root_item_2_sub_category').select('lic_and_sub'); + cy.get('#root_item_2_item_name').clear().type('Subscription relates to a licensing model that allows users to pay regularly for a computer program'); + cy.get('#root_item_2_qty').clear().type('10'); + cy.get('#root_item_2_currency_type').select('Crypto'); + cy.get('#root_item_2_currency').select('DAI'); + cy.get('#root_item_2_unit_price').type('12500'); + + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, all software is copyright protected.'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['sampletext.txt']); + + cy.wait(2000); + + cy.contains('Submit the Request').click(); + + cy.get('input[value="Submit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + + }); + }); + + //Edit a Software and License request - With Files + it('Edit a Software and License request', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Windows 10 S, w/Ghost Manta Accessories, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['png-5mb-2.png']); + + cy.wait(2000); + + + cy.contains('Edit the Request').click(); + + cy.get('input[value="Edit the Request"]').click(); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + + //Form 1 + cy.contains('Task: Submit Details', { timeout: 60000 }); + cy.wait(2000); + cy.get('button') + .contains(/^Submit$/) + .click(); + //Form 2 + /*cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + cy.get('button') + .contains(/^Submit$/) + .click();*/ + //Form 3 + cy.contains( + 'Task: Review the Request', + { timeout: 60000 }); + + cy.get('.cds--text-area__wrapper').find('#root').type('EDITING INFO : 2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); + + cy.contains('Submit the Request').click(); + cy.get('input[value="Submit the Request"]').click(); + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + cy.wait(2000); + }); + }); + + //Cancel a Software and License request - With Files + it('Cancel a Software and License request', () => { + let username = Cypress.env('requestor_username'); + let password = Cypress.env('requestor_password'); + cy.log('=====username : ' + username); + cy.log('=====password : ' + password); + + cy.login(username, password); + cy.visit('/'); + + cy.contains('Start New +').click(); + cy.contains('Request Goods or Services'); + + cy.runPrimaryBpmnFile(true); + + /* cy.contains('Please select the type of request to start the process.'); + // wait a second to ensure we can click the radio button + + cy.wait(2000); + cy.get('input#root-procurement').click(); + cy.wait(2000); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + */ + + cy.contains( + 'Request Goods or Services', + { timeout: 60000 } + ); + + cy.url().then((currentUrl) => { + // if url is "/tasks/8/d37c2f0f-016a-4066-b669-e0925b759560" + // extract the digits after /tasks + const processInstanceId = currentUrl.match(/(?<=\/tasks\/)\d+/)[0]; + cy.log('==###############===processInstanceId : ', processInstanceId); + let projectId = Cypress.env('project_id'); + cy.wait(2000); + cy.get('#root_project').select(projectId); + cy.get('#root_category').select('soft_and_lic'); + cy.get('#root_purpose').clear().type('Sware\nA software license is a document that provides legally binding guidelines for the use and distribution of software.\nSoftware licenses typically provide end users with the right to one or more copies of the software without violating copyrights'); + cy.get('#root_criticality').select('High'); + cy.get('#root_period').clear().type('25-11-2025'); + cy.get('body').click(); + cy.get('#root_vendor').clear().type('Microsoft'); + cy.get('#root_payment_method').select('Reimbursement'); + /* cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains('Task: Enter NDR Items', { timeout: 60000 }); + */ + //item 0 + cy.get('#root_item_0_sub_category').select('op_src'); + cy.get('#root_item_0_item_name').clear().type('Open source software is code that is designed to be publicly accessible anyone can see, modify, END'); + cy.get('#root_item_0_qty').clear().type('2'); + cy.get('#root_item_0_currency_type').select('Crypto'); + cy.get('#root_item_0_currency').select('SNT'); + cy.get('#root_item_0_unit_price').type('1915'); + + + cy.get('#root_item > div:nth-child(3) > p > button').click(); + + //item 1 + cy.get('#root_item_1_sub_category').select('lic_and_sub'); + cy.get('#root_item_1_item_name').clear().type('A software license is a document that provides legally binding guidelines for the use and distri END'); + cy.get('#root_item_1_qty').clear().type('1'); + cy.get('#root_item_1_currency_type').select('Fiat'); + cy.get('#root_item_1_currency').select('AED'); + cy.get('#root_item_1_unit_price').type('4500'); + + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.contains( + 'Review and provide any supporting information or files for your request.', + { timeout: 60000 } + ); + + cy.get('.cds--text-area__wrapper').find('#root').type('2021 Newest HP 17.3 inch FHD Laptop, AMD Ryzen 5 5500U 6core(Beat i7-1160G7, up to 4.0GHz),16GB RAM, 1TB PCIe SSD, Bluetooth 4.2, WiFi, HDMI, USB-A&C, Windows 10 S, w/Ghost Manta Accessories, Silver\nhttps://www.amazon.com/HP-i7-11G7-Bluetooth-Windows'); + + + cy.get('#root > div:nth-child(3) > p > button').click(); + + cy.get("input[type=file]") + .attachFile(['lorem-ipsum.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get("input[type=file]") + .attachFile(['png-5mb-1.png']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['Free_Test_Data_1MB_PDF.pdf']); + cy.wait(1000); + + cy.get('#root > div:nth-child(3) > p > button').click(); + cy.wait(1000); + + cy.get('#root > div.row.array-item-list > div:nth-child(4) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(3) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + cy.get('#root > div.row.array-item-list > div:nth-child(2) > div > div.cds--sm\\:col-span-1.cds--md\\:col-span-1.cds--lg\\:col-span-1.cds--css-grid-column > div > div > button.btn.btn-default.array-item-move-up > svg').click(); + cy.wait(1000); + + cy.get("input[type=file]") + .attachFile(['png-5mb-2.png']); + + cy.wait(2000); + + cy.contains('Cancel the Request').click(); + + cy.get('input[value="Cancel the Request"]').click(); + + cy.get('button') + .contains(/^Submit$/) + .click(); + + cy.get('button') + .contains(/^Return to Home$/) + .click(); + + cy.contains('Started by me', { timeout: 60000 }); + cy.logout(); + + }); + }); + }); +}); +