Skip to content

Commit

Permalink
fix: more robust assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
sr4850 committed Dec 4, 2024
1 parent f77e0f7 commit 4589686
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,15 @@ public void searchResultsPageShouldDisplayOperatorNamesContainingOurBusinessName
world.selfServeNavigation.clickSearchWhileCheckingTextPresent(world.createApplication.getOrganisationName(), 300, "KickOut reached. Operator name external search failed.");
}

@And("I am able to view the applicants licence number")
public void iAmAbleToViewTheApplicantsLicenceNumber() {
WebElement tableRow = findElement(String.format("//tr[td[contains(text(),\"%s\")]]", world.createApplication.getOrganisationName()), SelectorType.XPATH);
assertTrue(tableRow.getText().contains(world.applicationDetails.getLicenceNumber()));
}

@And("I am able to view the licence number")
public void iAmAbleToViewTheLicenceNumber() {
WebElement tableRow = findElement(String.format("//tr[td[contains(text(),\"%s\")]]", world.createApplication.getOrganisationName()), SelectorType.XPATH);
assertTrue(tableRow.getText().contains(world.applicationDetails.getLicenceNumber()));
String licenceNumber = world.applicationDetails.getLicenceNumber();
String orgName = world.createApplication.getOrganisationName();

waitForElementToBePresent(String.format("//tr[td[contains(text(), '%s')]]", orgName));
String rowText = getText(String.format("//tr[td[contains(text(), '%s')]]", orgName), SelectorType.XPATH);
assertTrue(rowText.contains(licenceNumber));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: External user search by Address, Business name, Licence Number and Pers
Scenario: Business name external search for lorry and bus operators
When I search for a lorry and bus operator by "business","","","",""
Then search results page should display operator names containing our "businessName"
And I am able to view the applicants licence number
And I am able to view the licence number

Scenario: Licence number external search for lorry and bus operators
When I search for a lorry and bus operator by "licence","","","",""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@INT-EXTERNAL-SEARCH
@INT-SMOKE
@PP-SMOKE
Feature: External user search by Address, Business name, Licence Number and Person's name

Background:
Expand Down

0 comments on commit 4589686

Please sign in to comment.