diff --git a/src/test/java/org/dvsa/testing/framework/stepdefs/vol/ExternalSearch.java b/src/test/java/org/dvsa/testing/framework/stepdefs/vol/ExternalSearch.java index d2f908afe..e6307ed76 100644 --- a/src/test/java/org/dvsa/testing/framework/stepdefs/vol/ExternalSearch.java +++ b/src/test/java/org/dvsa/testing/framework/stepdefs/vol/ExternalSearch.java @@ -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)); } diff --git a/src/test/resources/org/dvsa/testing/framework/features/SelfServe/Search/external-search.feature b/src/test/resources/org/dvsa/testing/framework/features/SelfServe/Search/external-search.feature index 739784506..1ef68dd3c 100644 --- a/src/test/resources/org/dvsa/testing/framework/features/SelfServe/Search/external-search.feature +++ b/src/test/resources/org/dvsa/testing/framework/features/SelfServe/Search/external-search.feature @@ -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","","","","" diff --git a/src/test/resources/org/dvsa/testing/framework/features/SelfServe/Search/int-external-search.feature b/src/test/resources/org/dvsa/testing/framework/features/SelfServe/Search/int-external-search.feature index e294184c3..9c12bf14c 100644 --- a/src/test/resources/org/dvsa/testing/framework/features/SelfServe/Search/int-external-search.feature +++ b/src/test/resources/org/dvsa/testing/framework/features/SelfServe/Search/int-external-search.feature @@ -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: