Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ Used for:

OrangeHRM is used where a realistic application flow makes the interview concept easier to demonstrate.

**Test cases:** every OrangeHRM test starts with its case ID (`tc108_employeeCanBeAddedFoundAndDeleted`, description `[TC-108] ...`). The 22 cases (TC-101 to TC-122) are written out for a manual run in [docs/manual-test-cases.md](docs/manual-test-cases.md); the `interview/` technique lessons and Java exercises have no case IDs.

## 2. The Internet

**Purpose:** Focused Selenium WebDriver exercises ([the-internet.herokuapp.com](https://the-internet.herokuapp.com)).
Expand Down
6 changes: 3 additions & 3 deletions docs/avoid-vs-prefer.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ soft.assertAll(); // reports every failure,
```

**Why:** soft assertions only collect; `assertAll()` is what fails the test.
**In the lab:** `TestNgFeaturesTest.softAssertChecksTheLoginPage`.
**In the lab:** `TestNgFeaturesTest.tc121_softAssertChecksTheLoginPage`.

### Configuration methods under a group filter 🟡 ⭐

Expand Down Expand Up @@ -459,7 +459,7 @@ public void startBrowser() { ... }
```

**Why:** `priority` only sorts the methods TestNG schedules together; with `parallel=classes` each class runs on its own thread, so there is no dependable order between classes. Independent tests can run anywhere, in any order.
**In the lab:** `EmployeeTest.employeeCanBeAddedFoundAndDeleted` (add, find and delete in one test).
**In the lab:** `EmployeeTest.tc108_employeeCanBeAddedFoundAndDeleted` (add, find and delete in one test).

### Retrying every failure 🔴 ⭐

Expand All @@ -476,7 +476,7 @@ public void adminLoginIsRetriedOnceOnFailure() { ... }
```

**Why:** blanket retries hide real defects and flaky tests; a targeted retry, visible in the report, does not.
**In the lab:** [`RetryOnce`](../src/test/java/com/automation/selenium/base/RetryOnce.java), `TestNgFeaturesTest.adminLoginIsRetriedOnceOnFailure`; the practice site's known hiccups are handled (and logged) in `PracticeSiteTest.open`.
**In the lab:** [`RetryOnce`](../src/test/java/com/automation/selenium/base/RetryOnce.java), `TestNgFeaturesTest.tc101_adminLoginIsRetriedOnceOnFailure`; the practice site's known hiccups are handled (and logged) in `PracticeSiteTest.open`.

### Shared state in a parallel data provider 🔴

Expand Down
8 changes: 4 additions & 4 deletions docs/common-interview-traps.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Paths: `interview/` = [`src/test/java/com/automation/selenium/interview/`](../sr
### Can `Select` handle every drop-down? 🟢 ⭐

**Answer:** Only real `<select>` elements. Most modern drop-downs are `div`s: click to open them, then click the option by its text. `Select` throws `UnexpectedTagNameException` on anything else, and refuses a disabled option with `UnsupportedOperationException`.
**In the lab:** `interview/dropdowns/SelectDropdownTest` (native); `BasePage.choose` and `SeleniumScenariosTest.userRoleDropdownOffersAdminAndEss` (custom).
**In the lab:** `interview/dropdowns/SelectDropdownTest` (native); `BasePage.choose` and `SeleniumScenariosTest.tc118_userRoleDropdownOffersAdminAndEss` (custom).

### `clear()` didn't empty the field. Is Selenium broken? 🟡

Expand Down Expand Up @@ -161,12 +161,12 @@ Paths: `interview/` = [`src/test/java/com/automation/selenium/interview/`](../sr
### Can I rely on `priority` to run tests in order across the suite? 🟡

**Answer:** No. `priority` only sorts the methods TestNG schedules together (lower first); it is not a dependency. With parallel runs (here `parallel=classes`, each class on its own thread) there is no dependable order between classes. Tests that need an order should use dependencies, or better, not need one.
**In the lab:** `TestNgFeaturesTest.loginPageIsShown` → `adminLogsInAfterThePageCheck`.
**In the lab:** `TestNgFeaturesTest.tc121_loginPageIsShown` → `tc101_adminLogsInAfterThePageCheck`.

### I used `SoftAssert` and the failures vanished. Why? 🟢 ⭐

**Answer:** `assertAll()` was not called. Soft assertions only *collect* failures; `assertAll()` at the end reports them and fails the test.
**In the lab:** `TestNgFeaturesTest.softAssertChecksTheLoginPage`.
**In the lab:** `TestNgFeaturesTest.tc121_softAssertChecksTheLoginPage`.

### My `@BeforeMethod` didn't run when I filtered by group. Why? 🟡 ⭐

Expand All @@ -186,7 +186,7 @@ Paths: `interview/` = [`src/test/java/com/automation/selenium/interview/`](../sr
### Should a `RetryAnalyzer` retry every failure? 🔴 ⭐

**Answer:** No. Retry only failures you know come from the environment (a short outage). Retrying everything hides real defects and makes flaky tests look green.
**In the lab:** `base/RetryOnce` on one test only (`TestNgFeaturesTest.adminLoginIsRetriedOnceOnFailure`). The practice site's known hiccups are handled where they happen (`PracticeSiteTest.open`), and each reload is written to the report.
**In the lab:** `base/RetryOnce` on one test only (`TestNgFeaturesTest.tc101_adminLoginIsRetriedOnceOnFailure`). The practice site's known hiccups are handled where they happen (`PracticeSiteTest.open`), and each reload is written to the report.

### A parallel data provider, and my test fails randomly. Why? 🔴

Expand Down
Loading
Loading