Playwright · Junior · Question 50 of 75
How do you emulate an iPhone in a Playwright project?
projects: [
{ name: "mobile", use: { ...devices["iPhone 15"] } },
]- 1Set
browser: 'safari-ios'in the test - 2Spread a preset from
devicesintouse - 3Install the iOS simulator on the machine
Show the answer
Correct answer: Spread a preset from devices into use
Explanation
Device presets set viewport, user agent, touch and device scale factor. They emulate the device in a desktop engine; they're not a real phone.