Playwright · Junior · Question 50 of 75

How do you emulate an iPhone in a Playwright project?

projects: [
  { name: "mobile", use: { ...devices["iPhone 15"] } },
]
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.

Further reading

Problem with a question

Playwright · Junior · question 50

Test yourself

Take the Playwright · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz