Repository navigation
Fix: title assertion fails against the current homepage - #2
Open
jochen-testingbot wants to merge 1 commit into
Open
jochen-testingbot wants to merge 1 commit into
jochen-testingbot wants to merge 1 commit into
Conversation
The homepage title is now 'Cross Browser Testing & Mobile App Testing | TestingBot', so the exact-match assertion failed all three runs of mvn test.
There was a problem hiding this comment.
🟢 Approved
The title assertion now tolerates expected marketing-title changes while still verifying the page is TestingBot and providing clearer failure diagnostics, with no active review issues identified.
No open issues 🎉
What changed in this PR
Updates the Selenium/TestNG homepage title check to tolerate TestingBot marketing-title changes while still verifying the page belongs to TestingBot.
Changes:
- Captures the current page title.
- Replaces the brittle exact-title assertion with a
TestingBotsubstring check. - Includes the actual title in assertion failure messages.
| File | Description |
|---|---|
src/test/java/com/yourcompany/Tests/SimpleTest.java |
Makes the homepage title assertion resilient to title wording changes and improves failure diagnostics. |
Review effort: Lite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of https://testingbot-team.atlassian.net/browse/TB-1008 (docs audit). This repo is the Selenium + Java sample project in the signup onboarding.
Problem
mvn test, run as the README says, failed all 3 tests:(TestNG's
assertEquals(actual, expected)order makes the message look reversed: the live title isCross Browser Testing & Mobile App Testing | TestingBot.) An exact title match breaks every time marketing changes the title.Change
Assert that the title contains
TestingBot, with the actual title in the failure message.Verification
Clean
maven:3.9-eclipse-temurin-21container,mvn -B test(the data provider was switched to serial inside the container only, to respect the shared account's concurrency):