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
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ public void completeContinuationsSignPage() {
waitAndClick("sign", SelectorType.ID);
world.govSignInJourney.navigateToGovUkSignIn();
world.govSignInJourney.signInGovAccount();
if (isTitlePresent("You have already proved your identity", 2)) {
clickById("submitButton");
}
if (isTitlePresent("Confirm your details", 2)) {
clickById("submitButton");
}
} else {
waitAndClick("//*[contains(text(),'Print, sign and return')]", SelectorType.XPATH);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ public void signInGovAccount() {
waitAndClick("//*[@id='submitButton']", SelectorType.XPATH);
}

if (isTitlePresent("Confirm your details", 2)) {
waitAndClick("//*[@id='submitButton']", SelectorType.XPATH);
}

if (isTextPresent("Are your details up to date?" )) {
clickByXPath("//input[contains(@class, 'govuk-radios__input') and @id='up-to-date']");
waitAndClick("//*[contains(text(),'Continue')]", SelectorType.XPATH);
Expand All @@ -168,6 +172,10 @@ public void signInGovAccount() {
waitAndClick("//button[@type='Submit']", SelectorType.XPATH);
}

if (isTitlePresent("Confirm your details", 2)) {
waitAndClick("//*[@id='submitButton']", SelectorType.XPATH);
}

if (isElementPresent("//button[@id='submitButton' and contains(text(),'Continue to the service')]", SelectorType.XPATH)) {
waitAndClick("//button[@id='submitButton' and contains(text(),'Continue to the service')]", SelectorType.XPATH);
} else {
Expand Down Expand Up @@ -210,6 +218,14 @@ public void signInGovAccount() {
isElementPresent("//*[contains(text(),'Continue')]", SelectorType.XPATH)) {
click("//*[contains(text(),'Continue')]", SelectorType.XPATH);
}

if (isTitlePresent("You have already proved your identity", 2)) {
waitAndClick("//*[@id='submitButton']", SelectorType.XPATH);
}

if (isTitlePresent("Confirm your details", 2)) {
waitAndClick("//*[@id='submitButton']", SelectorType.XPATH);
}
}

public void registerGovAccount() throws InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public CreateApplications(World world) {
this.world = world;
}

@When("i choose to print and sign")
@When("i sign the declaration")
public void iChooseToPrintAndSign() {
refreshPageWithJavascript();
if (!getCurrentUrl().contains("tm-declaration") && (getCurrentUrl().contains("dashboard"))) {
Expand All @@ -44,7 +44,37 @@ public void iChooseToPrintAndSign() {
}
world.govSignInJourney.navigateToGovUkSignIn();
world.govSignInJourney.signInGovAccount();
waitForTitleToBePresent("Review and declarations");
if (isTitlePresent("You have already proved your identity", 2)) {
clickById("submitButton");
}
if (isTitlePresent("Confirm your details", 2)) {
clickById("submitButton");
}
if (isTextPresent("What happens next?") || isTextPresent("Awaiting operator review")) {
return;
}
if (!isTitlePresent("Review and declarations", 5)) {
return;
}
if (isTextPresent("Declaration signed through GOV.UK One Login")) {
return;
}
// After GOV sign-in, the radio may need re-selecting to reveal hidden buttons
if (isElementPresent("declarationsAndUndertakings[signatureVerifyMandate]", SelectorType.ID)) {
clickById("declarationsAndUndertakings[signatureVerifyMandate]");
}
if (isElementPresent("//*[@name='form-actions[sign]']", SelectorType.XPATH)) {
waitAndClick("//*[@name='form-actions[sign]']", SelectorType.XPATH);
world.govSignInJourney.navigateToGovUkSignIn();
world.govSignInJourney.signInGovAccount();
if (isTitlePresent("You have already proved your identity", 2)) {
clickById("submitButton");
}
if (isTitlePresent("Confirm your details", 2)) {
clickById("submitButton");
}
}
scrollToBottom();
if (isElementPresent("//*[@name='signatureDetails[submitAndPay]']", SelectorType.XPATH)) {
waitAndClick("//*[@name='signatureDetails[submitAndPay]']", SelectorType.XPATH);
} else if (isElementPresent("//*[@name='form-actions[submitAndPay]']", SelectorType.XPATH)) {
Expand All @@ -67,6 +97,9 @@ public void theApplicationShouldBeSubmitted() {

@When("i pay for my application")
public void iPayForMyApplication() {
if (isTitlePresent("Confirm your details", 2)) {
clickById("submitButton");
}
UniversalActions.clickPay();
world.feeAndPaymentJourney.customerPaymentModule();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ public void iSubmitTheApplicationWithAnInterim() {
waitAndClick("//*[@name='form-actions[sign]']", SelectorType.XPATH);
world.govSignInJourney.navigateToGovUkSignIn();
world.govSignInJourney.signInGovAccount();
if (isTitlePresent("You have already proved your identity", 2)) {
clickById("submitButton");
}
if (isTitlePresent("Confirm your details", 2)) {
clickById("submitButton");
}
waitAndClick("submitAndPay", SelectorType.ID);
UniversalActions.clickPay();
world.feeAndPaymentJourney.customerPaymentModule();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ public void iAddAnExistingPersonAsATransportManagerWhoIsNotTheOperatorOn(String
world.registerUser.setFamilyName(tmOperatorFamilyName);
}

@And("i sign the declaration")
public void iSignTheDeclaration() {
world.selfServeUIJourney.signDeclaration();
}

@When("i add an operator as a transport manager")
public void iAddAnOperatorAsATransportManager() {
world.TMJourney.nominateOperatorUserAsTransportManager(String.format("%s %s", world.registerUser.getForeName(), world.registerUser.getFamilyName()), true);
Expand All @@ -102,6 +97,9 @@ public void theOperatorCountersignsDigitally() throws InterruptedException, Deco
if (isTitlePresent("You have already proved your identity", 4)) {
waitAndClick("//*[@id='submitButton']", SelectorType.XPATH);
}
if (isTitlePresent("Confirm your details", 2)) {
clickById("submitButton");
}
waitForTextToBePresent("What happens next?");
if (isElementPresent("//*[contains(text(),'Finish')]", SelectorType.XPATH)) {
click("//*[contains(text(),'Finish')]", SelectorType.XPATH);
Expand Down Expand Up @@ -148,6 +146,9 @@ public void theOperatorCountersignsByPrintAndSign() {
if(isTitlePresent("You have already proved your identity",1)){
waitAndClick("submitButton", SelectorType.ID);
}
if (isTitlePresent("Confirm your details", 2)) {
clickById("submitButton");
}
waitForTextToBePresent("What happens next?");
waitAndClickByLinkText("Sign out");
world.selfServeNavigation.navigateToLoginPage();
Expand All @@ -171,8 +172,14 @@ public void iAddNewPersonAsATransportManagerAndTheyFillOutTheirDetails() {

@When("the operator rejects the transport managers details")
public void theOperatorRejectsTheTransportManagersDetails() {
if (isTitlePresent("You have already proved your identity", 2)) {
clickById("submitButton");
}
if (isTitlePresent("Confirm your details", 2)) {
clickById("submitButton");
}
waitForTextToBePresent("What happens next?");
UniversalActions.clickHome();
UniversalActions.clickHome();
waitForTextToBePresent("Home");
world.TMJourney.assertTMDetailsWithOperator();
waitAndClickByLinkText("Sign out");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,36 @@ public VerifySwitchedOff(World world) {

@And("transport manager details approved banner appears")
public void transportManagerDetailsApprovedBannerAppears() {
assertTrue(isTextPresent("Transport Manager details approved"));
waitAndClickByLinkText("Back to Transport Managers");
if (isTextPresent("Declaration signed through GOV.UK One Login")) {
click("//*[contains(text(),'Finish')]", SelectorType.XPATH);
} else {
assertTrue(isTextPresent("Transport Manager details approved"));
waitAndClickByLinkText("Back to Transport Managers");
}
}

@And("transport manager status is {string} and {string}")
public void transportManagerStatusIs(String classString, String Text) {
assertTrue(isElementPresent(String.format("//*[@class='govuk-tag govuk-tag--%s']", classString), SelectorType.XPATH));
assertTrue(getText(String.format("//*[@class='govuk-tag govuk-tag--%s']", classString), SelectorType.XPATH).equalsIgnoreCase(Text));
String actualText = getText(String.format("//*[@class='govuk-tag govuk-tag--%s']", classString), SelectorType.XPATH);
if (Text.equalsIgnoreCase("Not yet received")) {
assertTrue(actualText.equalsIgnoreCase(Text) || actualText.equalsIgnoreCase("Received"),
String.format("Expected '%s' or 'Received' but got '%s'", Text, actualText));
} else {
assertTrue(actualText.equalsIgnoreCase(Text),
String.format("Expected '%s' but got '%s'", Text, actualText));
}
}

@And("submit to operator button is displayed")
public void submitToOperatorButtonIsDisplayed() {
waitForTextToBePresent("Awaiting operator review");
assertTrue(isElementPresent("//h1[contains(text(),'Awaiting operator review')]", SelectorType.XPATH));
waitAndClickByLinkText("Back to Transport Managers");
if (isElementPresent("//*[contains(text(),'Finish')]", SelectorType.XPATH)) {
click("//*[contains(text(),'Finish')]", SelectorType.XPATH);
} else {
waitAndClickByLinkText("Back to Transport Managers");
}
}

@And("i select a transport manager to add")
Expand Down Expand Up @@ -66,7 +81,7 @@ public void iSubmitAndPayForTheApplication() {

@Then("the print and sign page is displayed")
public void thePrintAndSignPageIsDisplayed() {
assertTrue(isTextPresent("Transport Manager details approved"));
assertTrue(isTextPresent("Print, sign and return"));
assertTrue(isTextPresent("Transport Manager details approved") || isTextPresent("Declaration signed through GOV.UK One Login"));
assertTrue(isTextPresent("Print, sign and return") || isTextPresent("Finish"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Self Serve Apply for licence
Scenario Outline: Create and pay application fees
Given i have a "<operatorType>" "<licenceType>" "GB" application in traffic area
| north_east |
And i choose to print and sign
And i sign the declaration
When i pay for my application
Then the application should be submitted

Expand All @@ -20,7 +20,7 @@ Feature: Self Serve Apply for licence
Given i have a "<operatorType>" "<licenceType>" "GB" application in traffic area
| north_west |
| north_east |
And i choose to print and sign
And i sign the declaration
When i pay for my application
Then the application should be submitted

Expand All @@ -32,7 +32,7 @@ Feature: Self Serve Apply for licence
Scenario Outline: Create and pay NI application fees
Given i have a "<operatorType>" "<licenceType>" "NI" application in traffic area
| northern_ireland |
And i choose to print and sign
And i sign the declaration
When i pay for my application
Then the application should be submitted

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Feature: Countersigning declaration page for the operator Print and Sign
@OLCS-21374
Scenario: Add TM as the Operator Print and Sign
When the transport manager is the owner
And i choose to print and sign
And i sign the declaration
Then transport manager details approved banner appears
And transport manager status is "green" and "Not yet received"

@OLCS-21678
Scenario: Add TM who is not the Operator Print and Sign
When the transport manager is not the owner
And i choose to print and sign
And i sign the declaration
Then submit to operator button is displayed
And transport manager status is "orange" and "With operator"
Loading