Playwright · Junior · Question 11 of 75

What does setting baseURL in the config allow?

Show the answer

Correct answer: Using relative URLs like page.goto('/login')

Explanation

With use: { baseURL: 'http://localhost:3000' }, navigation and toHaveURL can use relative paths. Changing environments then means changing one setting.

Further reading

Problem with a question

Playwright · Junior · question 11

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