Frameworks and CI · mid
Framework design, TestNG and JUnit, and Cucumber
A framework has layers, a runner, config, data handling and reports. Start from goals, not tools, and be able to explain your own framework with numbers.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Layers: tests, then page objects, screen objects and API clients, then core utilities (driver factory, waits, HTTP client with auth, config loader, data builders, logging), then reporting and CI.
- Start from goals and risks: which journeys matter, who writes tests, the team language, the CI tool and the environments.
- Config: defaults in a file, overridden per environment and by flags such as -Denv=staging. Secrets only from CI secrets or a vault.
- TestNG order: BeforeSuite, BeforeTest, BeforeClass, BeforeMethod, Test, AfterMethod, AfterClass, AfterTest, AfterSuite. It has testng.xml, groups, DataProvider, dependsOnMethods, parallel and thread-count, IRetryAnalyzer and listeners.
- JUnit Jupiter: BeforeAll and BeforeEach, Tag, ParameterizedTest with CsvSource or MethodSource, ExtendWith for extensions, and parallel runs by configuration.
- JUnit can run tests in parallel. Both are good choices; pick by team habit and needed features.
- BDD is a way to agree on behaviour with examples. Cucumber only runs them. If business people do not read the feature files, you pay the cost and get no benefit.
- Good Gherkin is declarative ("When the customer applies coupon FIRST50"), not UI steps ("click the button with id applyBtn"). Many near-duplicate steps are a sign of imperative style.
- When you present your framework, tell a story: layout, runner, page objects, utilities, CI, report, with test count, run time, flaky rate, and weak spots you would change.
The red pen
Common traps: mistake → fix
Mistake: Start by choosing tools
Fix: start with goals and risks.
Mistake: BDD means using Cucumber
Fix: BDD is the talk and the examples; Cucumber is only a tool.
Mistake: Automate every manual test case
Fix: choose by value and stability.
Mistake: Reciting POM, TestNG, Maven, Jenkins is an answer
Fix: you need a story with numbers and weak spots.
Easy to hard
Questions interviewers ask, easy to hard
- Design an automation framework from scratch for a web and API product.
- TestNG or JUnit for a new suite? Why?
- When does Cucumber help and when does it hurt?
- Walk me through the framework you work on today.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.