blue-battery-71202
03/10/2023, 9:44 AMthis.
keyword inside the test:
ts
createIdAndCode() {
...
cy.wrap(response.body.data.id).as(`id${response.body.data.code}`);
cy.wrap(response.body.data.code).as(`code${?????}`);
...
}
I don't know how to differentiate the different ID and Codes when invoking inside test:
ts
it('test', () => {
ApiHandler.createIdAndCode()
ApiHandler.createIdAndCode()
ApiHandler.useIdInRequest(...) // first ID
ApiHandler.useCodeInRequest(...) // first code
ApiHandler.useIdInRequest(...) // second ID
ApiHandler.useCodeInRequest(...) // second code
});
Whats the best practice to achieve this? I really don't want to pass a parameter for the two functions for naming those two values, since i want it to be generally used, and the "stored" names should be the "same" (except the dynamic value) across the fw.