Rayrun
← Back to Discord Forum

I set it to run on safari, but it doesn't take effect, it keeps opening with chromeium

optional518posted in #help-playwright
Open in Discord
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?"

7 replies

Hey 👋 , What happens when you comment out production project so you only have staging and you run the same command? (For science)

It's just as ineffective.

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?
Screenshot_2023-11-02_at_10.02.36_AM.png
@notlan585: 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.

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.

@notlan585: 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!

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.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

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 luc@ray.run.