Hello guys, I'm new to Cypress API testing, I have a Base64data string (it has over 150000 characters) which I need to encode... I'm trying to copy it from SoapUI... Any idea how can I make this as a file and then do cy.readFile, or how can I use another method to encode this base64 string?
Thanks a lot everyone
abundant-alarm-34669
02/15/2023, 12:38 PM
this is the base64data in SoapUI
d
delightful-guitar-3252
02/15/2023, 2:34 PM
try this:
1-pass this value into a json and save it in your fixtures directory
2-do the reading from you json and put it on a variable with cy.fixture('filename').then((base64data) => {//put the code here})
3-now base64data has the string you need
atention: filename does not need '.json' when called inside cy.fixture()
a
abundant-alarm-34669
02/16/2023, 1:23 PM
Thanks a lot, I did it with some research online, I did it exact the same way you mentioned it 🙂 @delightful-guitar-3252