Rayrun
← Back to Discord Forum

How to set tests to run in a order

Hi everyone,

I have tests which depend on previous tests. For example:

Create tenant test Create Site test

If I do not have created a tenant I could not create a site.

How can I make sure that the site test is executed after the tenant test ?

I have multiple scenarios like this to cover in one test suite for regression.

This thread is trying to answer question "How can I make sure that the site test is executed after the tenant test?"

5 replies
.aleksandaraleksandrov
.aleksandaraleksandrov

Yo, Naming convention is the most simple way - just name them 1Create tenant, 2CreateSite. Second is project dependencies, but I don't think this will work for you.

I can advice to make tests not rely on each other. Can't you just throw an API call before "Create Site" and have yourself a brand new tenant?

Hey Aleksandar ,

Unfortunately I can't do that.

The goal I had in mind is

Register a user Verify the User Log in with the user Continue the full test suite with that user Create tenant Create site Create schedule Then delete the user via API call

.aleksandaraleksandrov
.aleksandaraleksandrov

Is the problem with putting numbers infront of the names of the test files?

I will try that now and report it.

Yea I had similar situation and named tests like 001_testName, 002_testName and this working fine in my case

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.