Rayrun
← Back to Discord Forum

Global Setup is not working

Hey everyone, Im trying to implement a global setup here in my project but it does not work. It does not execute the setup before the main project, What I am doing wrong?

image.png

This thread is trying to answer question "Why is the global setup not working in the user's project?"

17 replies

that's an odd way to handle a global setup. Why not just use the regular/official way described here? anything preventing this approach? https://playwright.dev/docs/test-global-setup-teardown#configure-globalsetup-and-globalteardown

@mookiept the way Im implementing is also official

image.png
@start_qa: If you run the setup project via the command line, does it execute correctly?

If you run the setup project via the command line, does it execute correctly?

I did not try @sashaknits

let me see

Also, I used the way Andre mentioned but its not working with the fullyParallel option

I dont know why

I've switched to using project dependencies since the feature was released and I much prefer it, so hopefully we can get this working for you 👍

I will re-implement that solution with the dependencies and let you know if that works

@start_qa you are calling different devices. Clear the device in setup

@yusufozt. it does not make sense, the device is just the Viewport of it. I already cleared the device and it didn`t worked too

try changing your global setup file to global_setup.spec.ts , and use a glob instead of regex in the testMatch (EG: **/global_setup.spec.ts ). I think I ran into something similar when we cut over to project-based setup.

Actually never tried this way, looked off at first despite making sense thus my wrong assumption 🤣 Will try it one of these days

Also, I used the way Andre mentioned but its not working with the fullyParallel option In this case. Does it work full parallel if you skip the global setup?

tenacious_beagle_27655

@start_qa Is your global setup working ?

Yes. The question is very old but I just increased the timeout for expects and this solved my problem

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.