Skip to content

Commit

Permalink
LIME-1299 - Added Welsh Lang Tests for Footer
Browse files Browse the repository at this point in the history
To Check all Footer Links display the correct Welsh Language Text
  • Loading branch information
ChrisBates1 committed Oct 4, 2024
1 parent e7476aa commit 4da7b91
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,30 @@ public class DrivingLicencePageObject extends UniversalSteps {
@FindBy(xpath = "//*[@id=\"main-content\"]/div/div/form/h2")
public WebElement DVLAConsentSection;

@FindBy(xpath = "//a[contains(text(),\"Datganiad hygyrchedd\")]")
public WebElement DVLAAccessibilityStatement;

@FindBy(xpath = "//a[contains(text(),\"Cwcis\")]")
public WebElement DVLACookie;

@FindBy(xpath = "//a[contains(text(),\"Telerau ac amodau\")]")
public WebElement DVLATermsAndConditions;

@FindBy(xpath = "//a[contains(text(),\"Hysbysiad preifatrwydd\")]")
public WebElement DVLAPrivacyStatement;

@FindBy(xpath = "//a[contains(text(),\"Cymorth (agor mewn tab newydd)\")]")
public WebElement DVLASupport;

@FindBy(xpath = "//a[contains(text(),\"Trwydded Llywodraeth Agored v3.0\")]")
public WebElement DVLAOpenGovernmentLicence;

@FindBy(xpath = "//*[contains(text(),\"Mae’r holl gynnwys ar gael o dan\")]")
public WebElement DVLAOpenGovernmentLicenceText;

@FindBy(xpath = "//*[contains(text(),\"© Hawlfraint y goron\")]")
public WebElement DVLACrownCopyright;

@FindBy(xpath = "//*[@id=\"consentCheckbox-hint\"]/ul/li[1]/a")
public WebElement oneLoginLink;

Expand Down Expand Up @@ -1295,6 +1319,46 @@ public void assertConsentSection(String consentSection) {
assertEquals(consentSection, DVLAConsentSection.getText());
}

public void assertAccessbilityStatementLink(String accessibilityStatement) {
assertEquals(accessibilityStatement, DVLAAccessibilityStatement.getText());
LOGGER.info("actualText = " + DVLAAccessibilityStatement.getText());
}

public void assertCookiesLink(String cookiesLink) {
assertEquals(cookiesLink, DVLACookie.getText());
LOGGER.info("actualText = " + DVLACookie.getText());
}

public void assertTermsAndConditions(String termsAndConditions) {
assertEquals(termsAndConditions, DVLATermsAndConditions.getText());
LOGGER.info("actualText = " + DVLATermsAndConditions.getText());
}

public void assertPrivacyNotice(String privacyNotice) {
assertEquals(privacyNotice, DVLAPrivacyStatement.getText());
LOGGER.info("actualText = " + DVLAPrivacyStatement.getText());
}

public void assertSupportLink(String supportLink) {
assertEquals(supportLink, DVLASupport.getText());
LOGGER.info("actualText = " + DVLASupport.getText());
}

public void assertOLGLink(String olgLink) {
assertEquals(olgLink, DVLAOpenGovernmentLicence.getText());
LOGGER.info("actualText = " + DVLAOpenGovernmentLicence.getText());
}

public void assertOLGTextFirst(String olgTextFirst) {
assertEquals(olgTextFirst, DVLAOpenGovernmentLicenceText.getText());
LOGGER.info("actualText = " + DVLAOpenGovernmentLicenceText.getText());
}

public void assertCrownCopyright(String crownCopyright) {
assertEquals(crownCopyright, DVLACrownCopyright.getText());
LOGGER.info("actualText = " + DVLACrownCopyright.getText());
}

public void assertOneLoginPrivacyLink(String oneLoginPrivacyLink) {
assertEquals(oneLoginPrivacyLink, oneLoginLink.getText());
String oneLoginDVLALinkUrl = oneLoginLink.getAttribute("href");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,46 @@ public void iSeeTheConsentSectionAllowDVLAToCheckYourDrivingLicenceDetails(
assertConsentSection(consentSection);
}

@Given("^I see the accessibility statement link (.*)$")
public void iSeeTheAccessibilityStatementLink(String accessibilityStatement) {
assertAccessbilityStatementLink(accessibilityStatement);
}

@And("^I see the cookies link (.*)$")
public void iSeeTheCookiesLink(String cookiesLink) {
assertCookiesLink(cookiesLink);
}

@And("^I see the terms and conditions link (.*)$")
public void iSeeTheTermsAndConditionsLink(String termsAndConditions) {
assertTermsAndConditions(termsAndConditions);
}

@And("^I see the privacy notice link (.*)$")
public void iSeeThePrivacyNoticeLink(String privacyNotice) {
assertPrivacyNotice(privacyNotice);
}

@And("^I see the support link (.*)$")
public void iSeeTheSupportLink(String supportLink) {
assertSupportLink(supportLink);
}

@And("^I see the OLG link (.*)$")
public void iSeeTheOLGLink(String olgLink) {
assertOLGLink(olgLink);
}

@And("^I see the OLG text first half (.*)$")
public void iSeeTheOLGTextFirst(String olgTextFirst) {
assertOLGTextFirst(olgTextFirst);
}

@And("^I see the crown copyright link (.*)$")
public void iSeeTheCrownCropyright(String crownCopyright) {
assertCrownCopyright(crownCopyright);
}

@Then("^I see privacy notice link (.*)$")
public void iSeePrivacyNoticeLinkTheGOVUKOneLoginPrivacyNotice(String oneLoginPrivacyLink) {
assertOneLoginPrivacyLink(oneLoginPrivacyLink);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ Feature: Driving License Language Test
When the beta banner reads Mae hwn yn wasanaeth newydd – bydd eich adborth (agor mewn tab newydd) yn ein helpu i'w wella.
Then The test is complete and I close the driver

@Language-regression
Scenario: Footer - Link Text Validation
Given I see the accessibility statement link Datganiad hygyrchedd
And I see the cookies link Cwcis
And I see the terms and conditions link Telerau ac amodau
And I see the privacy notice link Hysbysiad preifatrwydd
And I see the support link Cymorth (agor mewn tab newydd)
And I see the OLG link Trwydded Llywodraeth Agored v3.0
And I see the OLG text first half Mae’r holl gynnwys ar gael o dan Trwydded Llywodraeth Agored v3.0, oni nodir yn wahanol
And I see the crown copyright link © Hawlfraint y goron
And The test is complete and I close the driver

@Language-regression
Scenario Outline: DVLA Error tab title validation
Given I click on DVLA radio button and Parhau
Expand Down

0 comments on commit 4da7b91

Please sign in to comment.