curved-magician-42592
04/20/2023, 6:59 PMcy.task('renameFile', file).then((result) => {
const renamed_file = result;
cy.wrap(renamed_file).as('updated_file');
cy.log('@updated_file');
cy.log('renamed_file);
}
my cy.task() function, renameFile, simply takes a file path and name and renames it for me and then returns me the new file name as a String.
In my test, i'm trying to retrieve that renamed file and THEN assign it to a variable I made in the test called 'renamed_file'.
I tried to log updated_file and renamed_file to see if either one is going to be the new string but they both return Null!
How can I fix my cy.task() to get it to return the text value instead of a null object? I know i'm missing something but I just can't put my finger on it.. Thanksechoing-tent-95037
04/20/2023, 8:15 PMrenameFile task actually looks like.curved-magician-42592
04/20/2023, 9:23 PMcolossal-oxygen-29599
04/23/2023, 4:12 AMcolossal-oxygen-29599
04/23/2023, 4:15 AMcy.wrap(uniqueFilename).as('uniqueFilename');
// ... some more code
cy.wrap(res).as('uniqueFilename);
// ... some more stuff
cy.get('@uniqueFilename').then((value) => cy.log(value));