Skip to content

Commit

Permalink
fix: smoke test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sr4850 committed Dec 16, 2024
1 parent a1a04d3 commit 2f9bd0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dvsa.testing.framework.stepdefs.permits.ecmtInternationalRemoval;

import activesupport.aws.s3.SecretsManager;
import activesupport.driver.Browser;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
Expand Down Expand Up @@ -86,7 +87,9 @@ public void iNavigateToPermitDashboardPage() {

@And("I'm on the ECMT international submitted page for my active application")
public void iMOnTheECMTInternationalSubmittedPageForMyActiveApplication() {
world.selfServeNavigation.navigateToLogin(world.registerUser.getUserName(), world.registerUser.getEmailAddress());
world.selfServeNavigation.navigateToLoginPage();
String newPassword = SecretsManager.getSecretValue("internalNewPassword");
world.globalMethods.signIn(world.registerUser.getUserName(), newPassword);
HomePageJourney.selectPermitTab();
clickByLinkText(world.applicationDetails.getLicenceNumber());
OverviewPageJourney.clickOverviewSection(OverviewSection.Declaration);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dvsa.testing.framework.stepdefs.vol;

import activesupport.driver.Browser;
import org.apache.hc.core5.http.HttpException;
import org.dvsa.testing.framework.Injectors.World;
import io.cucumber.java.en.And;
Expand All @@ -14,6 +15,7 @@
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebElement;

import java.util.ArrayList;
import java.util.List;

import static org.dvsa.testing.framework.Utils.Generic.UniversalActions.refreshPageWithJavascript;
Expand Down Expand Up @@ -79,8 +81,13 @@ public void iGenerateALetter() {
@Then("The pop up should contain letter details")
public void thePopUpShouldContainLetterDetails() {
waitForTextToBePresent("Amend letter");
waitForElementToBePresent("//*[@id='letter-link']");
String docStoreLink = getLink("//*[@id='letter-link']",SelectorType.XPATH);
// waitForElementToBePresent("//*[@id='letter-link']");
if (isElementNotPresent("//*[@id='letter-link']", SelectorType.XPATH)) {
waitAndClick("GV - Blank letter to operator", SelectorType.LINKTEXT);
ArrayList<String> tabs = new ArrayList<String> (getWindowHandles());
switchToWindow(tabs.get(0));
}
String docStoreLink = getLink("//*[@id='letter-link']",SelectorType.XPATH);
assertNotNull(docStoreLink);
String webDAVUrl = URL.build(ApplicationType.INTERNAL, world.configuration.env, "documents-dav").toString();
assertTrue(docStoreLink.contains(String.format("ms-word:ofe|u|%s",webDAVUrl)));
Expand Down

0 comments on commit 2f9bd0d

Please sign in to comment.