Rayrun
โ† Back to Discord Forum

#Parameterize #Serialized test execution without skipping on faiure

Hi everyone, I tried to search for this question in the section, but I couldn't find it. If this is a duplicate I would apologise. I want to run a group of tests(test.describe) parallel by parameterizing, but inside describe multiple tests should execute serially.

`dataArray.forEach((testCase, index) => {

test.describe.configure({ mode: 'serial' }) test.describe("TCIDs", async () => {

test(`Adding Data case ${index + 1}`, async ({ page }) => {
        // Perform test actions with data
    });
    test(`Editing data Case ${index + 1}`, async ({ page }) => {
        // Perform test actions with data
    });
});

});`

I have to make tests inside serial since they are depend on each other. Also, there are multiple data sets in dataArray. If one set fails all other tests will skip even if its another set of dataArray.

** Is it possible not to skip remaining test data sets of dataArray test execution? ** And run dataArray data tests parallel?

Example dataArray [ { "id": 101, "firstName": "John", "lastName": "Doe", }, { "id": 102, "firstName": "Jane", "lastName": "Smith", } ] Many thanks in advance... <:playwright:1054714813638516757>

This thread is trying to answer question "Is it possible not to skip remaining test data sets of dataArray test execution and run dataArray data tests parallel?"

2 replies

Hi, I know it's not exactly what you're asking but I'd highly recommend you to write tests totally independent. If you need check "editing" then create data exactly for these test cases and don't reuse data from the others. It'll save you a lot of time and nerves. Btw, it's a best practice and will allow you to parallel the tests. I know you're thinking "but it'll be slow". Well, it'll be much slower and more unpredictable in the "serial" approach.

How to possibly speed up tests: use API and database calls when possible, reuse auth data and so on. I hope it'll help you ๐Ÿ™‚

As far as I no you can't continue on serial mode if something failed. It has no sense.

@viraxslot: Thanks mate @viraxslot for the reply ๐Ÿ˜€ I'm creating dynamic test data and using same data for editing. Even it run on serial mode it will get fresh dataset + no need to worry of data maintenance. Json is just for representation, I'm passing Iteration count via config file.

Thanks mate @viraxslot for the reply ๐Ÿ˜€ I'm creating dynamic test data and using same data for editing. Even it run on serial mode it will get fresh dataset + no need to worry of data maintenance. Json is just for representation, I'm passing Iteration count via config file.

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 [email protected].