I did like this.... is there any possibility to ke...
# help
b
I did like this.... is there any possibility to keep this xml data some where or I can read it?
f
You'd create
/cypress/fixtures/file.xml
and put it there. Then you read it via
cy.fixture('file')
and then do a string replacement to populate the values you want.
b
okay i have moved the code in xml, and read it . now how to do string replacement to populate value , i didn't got you
static buildImportPACS008File = ( fileRef: number, timestamp: string, bankingDate: string, TxId: string, iban: string): Cypress.Chainable => { return cy.fixture('importPacs008File.xml') }
f
That's a static method in your code, not your test file, right?
b
Yeah this is static method.. I will call this in my test file, or may be i think i can do directly in test file
f
So you wouldn't do it that way. You'd call the
cy.fixture('file.xml').then(contents => contents.replace("FILE_REF", fileRef)
Just chain each
replace
call