r/softwaretesting • • 2h ago

Script maintenance- Playwright Automation

Currently working in a reputed organization with a team size of 13.

We run Automation Regression test suite with close to 750 tests every day via jenkins on Kubernetes Pods.

It's a playwright Cucumber BDD framework running on a SaaS Data analytics product which is very complex.

The issue is out of 750, close to 650 is UI based tests and 100 would be API. there are multiple teams from dev pushing code every alternate day atleast.

Due to this we are not able to show a consistent pass %. Either environment related issues comes up, or some backend issues or locator updates/ workflow change and we will be catching that up. Now next day another guy pushes code and we have lower tests passing now and the cycle repeats.

My manager expects a test suite that will give the exact condition of the product. Pass is a pass or fail denotes a product issue. he doesn't want intermittent failures or script issues or any unstable suite. His expectation is 50 tests maximum can fail out of total 750 for other reasons, which I feel it's valid to some extent. Currently we have 85% as average which means most of the days 100-120 fails which is a pain to analyze and reduces efficiency of Automation. There were good number of unstable tests and are fixed and tests are stable now even in CI.

So my question is , Is this a fair expectation ? And to have a very stable Automation tests suite what do you guys follow?

For now.

I can think of migrating maximum number of tests including the ones with Web socket calls to UI independent tests so that instability will reduce.

Also, JSON schema tests for all the end points using AJV package.

It would be of great help if you guys can share your views and suggest based on ur valuable experiences.

Thanks.

1 Upvotes

9 comments sorted by

1

u/ResolveResident118 2h ago

The only same expectation is zero test failures.

The biggest problem here is that the test automation is completely divorced from the code so if course there are going to be failures.

What tests are run locally or on PR before the code is merged? This is where test failures should be being picked up, not in a daily run.

1

u/AdMinute3667 2h ago

Sorry. Forgot to mention. Automated tests are run on staging environment which is for Testing. Dev pushes code from dev to staging.

3

u/ResolveResident118 58m ago

That's the problem though. The tests are only being run when after multiple changes have been pushed. This makes it more likely tests will have broken and much harder to find the cause of the break. 

You may not want or be able to run all of the tests prior to this but, in general, the earlier you can run the tests, the less likely they are to be a problem. Ideally, the devs are running a subset of these tests locally before pushing their changes.

3

u/PettyBonus31 2h ago

100-120 daily failures on 750 tests isn't a tooling problem, it's a process one, if the suite can't stabilize because devs keep breaking things faster than you can fix them, no amount of framework tweaking will get you to 50 max fails.

1

u/CertainDeath777 1h ago

i dont know why reddit deletes comments like this (i had to manually approve it), and even bans the user. i feel bad for him, we mods had nothing to do with that. rip that guy.

2

u/TobyTrash 22m ago

As many have noted, the tests are performing according to spec, they are catching errors when code is moved from dev to staging.

To have a stable no error run, you need the tests to run on a pre-prod like environment. It sort of sounds like this is your staging env. In that case you are missing an env - test.

A staging/pre-prod env should not have that many errors as its the almost in prod.

If you can't get a new env because of "whatever", you need to change up how and when these tests are run in dev in order to ensure higher stability when its merged to staging.

I world recommend 4 envs. Dev, test, pre-prod and prod. All literature recommends 4 envs, but of course things change with agility and ci/cd.

Virtual temp environments might also help - if possible.

1

u/CertainDeath777 1h ago

Its a fair expecation from boss to have a consistent tess pass rate, if the ressources are provided.
If the ressources (especially the human ones) are provided, but team simply is lagging behind in chages all the times, maybe the development process needs to change.
What can definitely be done is write the test adaptation while the software is written. so test code and software code goes on test env at the same time. dev could even use the test code to test implementation before merge.

But some things will have to work: tickets/tasks described in a way that formalises contracts/api/locators etc from start. and QA beeing embedded early into software dev cycle.
And the test automation framework needs to be architected in a way, that it supports a rapidly changing app well.

So its on you to decide whats the real issue. Ressources, Processes or something else, adress it and advise change.

1

u/AptKid 1h ago

Do you have multiple environments? It's not unusual for an env, where PR are constantly being merged, to have a lower pass rate. There should be a seperate, stabilized env, where you can merge features and your automated tests, in a controlled way.

1

u/Left_Watercress7266 1h ago

It's a pretty common condition. UI scenarios will fail mostly due to random issues or changes, even if it is playwright. Changes or defects anyways its a part of modification. But those kind of random issues should be handled in a seperate way of identifying the pattern or identifying the root cause for the failures.

In my organisation, we had 60% pass on average for UI scenarios and we had worked on the random and intermittent issues, identifying the root cause and fixing by giving enough waits or multiple validation before going to the next steps and retries too. That's how we pushed till 80%.