projects: [
{
name: 'setup',
testMatch: /login\.setup\.ts/,
},
{
name: 'production',
use: {
baseURL: 'https://dev.mi.com',
...devices['Desktop Chrome'],
storageState: '.auth/user.json',
},
dependencies: ['setup'],
},
{
name: 'staging',
use: {
baseURL: 'http://onebox.developer.mi.com',
...devices['Desktop Safari'],
storageState: '.auth/user.json',
},
dependencies: ['setup'],
},
],
npx playwright test --project=staging
Another problem, when opening the browser, the baseUrl cannot be read
This thread is trying to answer question "Why does the project keep opening with Chromium despite being set to run on Safari and why can't the baseUrl be read when opening the browser?"
Huh, so either way it goes to chromium...
This is what I have in my playwright.config.ts
setup.
name: 'webkit',
use: { ...devices['Desktop Safari'],
launchOptions: {
args: [],
slowMo: 1000
},
},
},```
And I just tested it and seems to be only running webkit.
Is there anything in the `dependecies` that could be effecting it?
I didn't write any code that affects which browser opens. And I don’t know why the configured baseUrl cannot be referenced when calling the goto function.
Maybe I found the reason, I removed dependencies:['setup'] and it gets the baseUrl properly and opens with safari, but this feels like a bug!
Nice find! I would maybe create/report the issue on https://playwright.dev/community/welcome so no one else has this issue.
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].