Skip to content

docs(recipe): read and assert on table rows with Locator.rows() (#123) - #191

Merged
shossain786 merged 14 commits into
seleniumboot:masterfrom
May-Mei6:docs/locator-rows-recipe
Oct 22, 2026
Merged

shossain786 merged 14 commits into
seleniumboot:masterfrom
May-Mei6:docs/locator-rows-recipe

Conversation

@Lisr-iiil

@Lisr-iiil Lisr-iiil commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Adds a recipe for reading and asserting on HTML tables with Locator.rows(), which was added in #54 but had no recipe.

It covers reading all rows, finding a row by column value, asserting on a cell, and the behaviour of short rows and <th>-only group rows. It also adds a Recipes sidebar entry and a 138-character SEO description.

Closes #123

Type of change

  • Bug fix
  • New feature (opt-in, aligned with the framework philosophy)
  • Documentation
  • Internal refactor / test coverage

Checklist

  • All existing tests pass (mvn clean verify) (mvn clean verify -Dgpg.skip; GPG signing skipped locally)
  • New behaviour is covered by unit tests — N/A, docs only
  • No new external dependencies introduced without prior discussion
  • Code follows existing conventions (no new frameworks, minimal abstraction)
  • No breaking changes to @SeleniumBootApi public APIs (or a major version bump is justified below)
  • Docs updated if user-facing behaviour changed (docs-site/) — N/A, no behaviour change; this PR is itself a docs addition

Notes for reviewers

Reading rows, finding a row, and asserting on a cell were verified in a local TestNG project extending BaseTest using Chrome:

  • The AccountsTableTest class shown on the page was run as-is, apart from open("/accounts") → open("/table.html") and one print line, against a local copy of the table in the recipe, and passed. Changing the cell to $90.00 made the assertion fail with expected [$100.00] but found [$90.00].
  • The same read / find / assert steps passed against the first table on https://the-internet.herokuapp.com/tables (full six-column table).

Verify short rows and <th>-only group rows: verified in a separate local TestNG project extending BaseTest, using real Chrome and local HTML tables based on the recipe. All 8 tests passed together:

  • Two standalone tests verified short rows and <th>-only group rows respectively.
  • Six tests in the combined class verified normal reading, lookup and cell assertion; missing versus explicitly empty middle cells; extra cells beyond the header count; selection of the first row containing <th> as the header when there is no <thead>; short rows and group headings together; and rejection of an incorrect expected cell value.

Build the framework and run existing tests: mvn clean verify -Dgpg.skip=true passed all 789 tests, with no failures, errors, or skipped tests.

Test against the official consumer project: the official consumer project was tested against the local framework build; 111 tests passed and 2 were intentionally skipped.

Build and preview the documentation site: the production build passed. The site was run locally to check page rendering and confirm that the Recipes sidebar entry opened the correct page.

Structure: the page follows the existing recipes, using handle-iframes.md as the template: the main example is a titled, complete test class, and the page ends with a Deeper reference link.

Co-authored by @May-Mei6 and @Lisr-iiil.

May-Mei6 and others added 14 commits October 17, 2026 10:49
Remove the completed Part 1 and Part 2 placeholder comments.

Final verification:
- Browser: 6 tests passed in a separate local TestNG project using real Chrome and HTML fixtures, covering recipe scenarios and an expected assertion failure.
- Framework: mvn clean verify -Dgpg.skip=true passed with 710 tests.
- Documentation: built the docs site successfully and checked the recipe locally for text and code block rendering.
Add the recipe to the Recipes sidebar and provide a 138-character SEO description. Add a core-usage heading and clarify example results.

Final validation:
- Contribution checks: framework verification passed with 710 tests; official consumer verification passed with 111 tests and 2 expected skips.
- Recipe and documentation checks: all 8 local TestNG tests passed in real Chrome; docs build, page rendering, and sidebar navigation checked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(recipe): read and assert on table rows with Locator.rows()

3 participants