Menu

How I structure a Java test automation project (and the free template I made from it)
πŸ“°

How I structure a Java test automation project (and the free template I made from it)

DEV Community: javaΒ·EdwardΒ·7 days ago
#smG72MsU
#devtojava#devto#dev#username#password
Reading 0:00
15s threshold

Keep assertions only in tests. Give every parallel test its own browser. Mock APIs for logic checks. Tag tests as smoke or regression. I turned all of this into a free GitHub template you can clone today.

Every time I started a new test automation project, the first weeks went to the same chores: choosing library versions, deciding on folders, wiring reports, writing a pipeline.

After the fifth time, I turned my setup into a template. This post explains the structure and the rules behind it, so you can use them even if you never clone the repo.

🧭 The one rule that keeps projects clean

Tests assert. Everything else acts.

Layer What it does Assertions?

Page objects Click and type Never

API clients Send requests and return the response Never

Repositories Run SQL Never

Tests Check the result Always

Because only tests contain assertions, you can reuse every page, client and query in any test without surprises.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.