Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to mock APIs with playwright?#44

emnabn started this conversation inGeneral
Discussion options

Hello,
I tried to mock an API in my project playwright with cucumber js but I didn't succeed:
the code that I implement in the step:

await page.route( '**/emobgapi/v1/offers?country-of-residence=FR&offset=0&limit=10&pickup-station-code=ORYT01&drop-off-station-code=ORYT01&pickup-date=2024-01-08T10:00&drop-off-date=2024-01-22T10:00&driver-age=26&apikey=sL7SEuCNdoBj8SilHttiSPRLnwpFSD92', route => { route.fulfill({ status: 200, contentType: 'application/json', path: '~/tests/acceptance/searchAPI.json', }); },

and I createsearchAPI.json file where I put the response of this request.

Thanks for your help.

You must be logged in to vote

Replies: 2 comments

Comment options

Hi, Thank you for showing interest in my work. Sorry I haven't worked with mocking API's much but surely I will look into this issue and get back if I fin anything

You must be logged in to vote
0 replies
Comment options

https://youtu.be/c7zCQ8FKih4
This might be useful

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@emnabn@akshayp7

[8]ページ先頭

©2009-2025 Movatter.jp