cypress - req.reply()
Vasudevan

Vasudevan @vasudevan2992

About: Aspiring Web developer !

Joined:
Apr 8, 2024

cypress - req.reply()

Publish Date: Oct 1 '24
0 0

cy.intercept({
method: 'GET',
url: 'https://rahulshettyacademy.com/Library/GetBook.php?AuthorName=shetty',
}, (req) => {
req.reply({
statusCode: 200,
body:{
"book_name": 'Modified Response book',
"isbn": "BSG",
"aisle": "2302"
}
});
}).as('bookRetrievals')

where am i going wrong here, i know i can use other ways.. but is this wrong way to use req.reply() or what am i missing .. i just want to stub with my response instead of original api response using reply()

Comments 0 total

    Add comment