Skip to content

Commit

Permalink
Merge pull request #1056 from dvsa/fix/popUp
Browse files Browse the repository at this point in the history
fix: wait
  • Loading branch information
sr4850 authored Dec 18, 2024
2 parents 79032ff + 90fac66 commit b629de5
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 67 deletions.
12 changes: 6 additions & 6 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ ignore:
SNYK-JAVA-ORGBOUNCYCASTLE-6612984:
- '*':
reason: None Given
expires: 2024-12-10T:46:16.314Z
expires: 2025-12-10T:46:16.314Z
created: 2024-05-09T15:46:16.322Z

SNYK-JAVA-DOM4J-174153:
- '*':
reason: None Given
expires: 2024-12-17T13:36:08.904Z
expires: 2025-12-17T13:36:08.904Z
created: 2024-05-08T13:36:08.910Z
SNYK-JAVA-ORGYAML-2806360:
- '*':
reason: None Given
expires: 2024-12-17T13:49:35.026Z
expires: 2025-12-17T13:49:35.026Z
created: 2024-05-08T13:49:35.034Z
SNYK-JAVA-DOM4J-2812975:
- '*':
reason: None Given
expires: 2024-12-17T13:52:40.223Z
expires: 2025-12-17T13:52:40.223Z
created: 2024-05-08T13:52:40.231Z
SNYK-JAVA-ORGYAML-6056527:
- '*':
reason: None Given
expires: 2024-12-17T13:53:08.534Z
expires: 2025-12-17T13:53:08.534Z
created: 2024-05-08T13:53:08.541Z
SNYK-JAVA-SOFTWAREAMAZONION-6153869:
- '*':
reason: None Given
expires: 2024-12-17T13:53:47.241Z
expires: 2025-12-17T13:53:47.241Z
created: 2024-05-08T13:53:47.250Z
patch: {}
90 changes: 40 additions & 50 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.dvsa.testing.framework</groupId>
<artifactId>vol-functional-tests</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.10.2-SNAPSHOT</version>


<properties>
Expand All @@ -18,8 +18,8 @@
<axe-scanner-version>2.11.0</axe-scanner-version>


<allure-cucumber7-jvm.version>2.20.1</allure-cucumber7-jvm.version>
<allure-report.version>2.25.0</allure-report.version>
<allure-cucumber7-jvm.version>2.27.0</allure-cucumber7-jvm.version>
<allure-report.version>2.27.0</allure-report.version>

<slf4j.version>2.22.0</slf4j.version>
<slf4j-log4j12.version>2.22.0</slf4j-log4j12.version>
Expand All @@ -37,22 +37,22 @@
<zt-zip.version>1.15</zt-zip.version>
<java.version>11</java.version>

<jvmMemory>2048</jvmMemory>
<jvmMemory>4000</jvmMemory>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.10.1</version>
<version>5.10.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-bom</artifactId>
<version>7.15.0</version>
<version>7.18.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -93,8 +93,22 @@
<artifactId>junit-platform-suite</artifactId>
<scope>test</scope>
</dependency>


<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber7-jvm</artifactId>
<version>${allure-cucumber7-jvm.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-attachments</artifactId>
<version>${allure-report.version}</version>
</dependency>
<dependency>
<groupId>org.dvsa.testing.lib</groupId>
<artifactId>active-support</artifactId>
Expand Down Expand Up @@ -148,22 +162,6 @@
<version>${zt-zip.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber7-jvm</artifactId>
<version>${allure-cucumber7-jvm.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-attachments</artifactId>
<version>${allure-report.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
Expand Down Expand Up @@ -204,12 +202,28 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/**.java</include>
</includes>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
-Dcucumber.options="--plugin io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm"
-Xmx${jvmMemory}m
</argLine>
<testFailureIgnore>true</testFailureIgnore>
<rerunFailingTestsCount>1</rerunFailingTestsCount>
<forkCount>2</forkCount>
<parallel>methods</parallel>
<threadCount>3</threadCount>
<reuseForks>true</reuseForks>
<properties>
<!-- Work around. Surefire does not include enough
information to disambiguate between different
Expand All @@ -227,30 +241,6 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<id>Run parallel tests</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>true</skip>
<testFailureIgnore>true</testFailureIgnore>
<argLine>-Xmx${jvmMemory}m</argLine>
<includes>
<include>**/**.java</include>
</includes>
<parallel>suites</parallel>
<threadCount>5</threadCount>
</configuration>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
Expand Down Expand Up @@ -281,4 +271,4 @@
<url>https://maven.pkg.github.com/dvsa/vol-functional-tests</url>
</repository>
</distributionManagement>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ public void iGenerateALetter() {
@Then("The pop up should contain letter details")
public void thePopUpShouldContainLetterDetails() {
waitForTextToBePresent("Amend letter");
// 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());
waitAndClick("//*[contains(text(),'GV - Blank letter to operator')]", SelectorType.XPATH); ArrayList<String> tabs = new ArrayList<String> (getWindowHandles());
switchToWindow(tabs.get(0));
}
String docStoreLink = getLink("//*[@id='letter-link']",SelectorType.XPATH);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.dvsa.testing.framework.stepdefs.vol;

import activesupport.IllegalBrowserException;
import activesupport.aws.s3.SecretsManager;
import activesupport.driver.Browser;
import activesupport.faker.FakerUtils;
import apiCalls.enums.LicenceType;
Expand Down Expand Up @@ -254,7 +255,7 @@ public void theUserShouldRemainOnTheSurrenderDetailsPage() {

@And("the licence should not displayed in selfserve")
public void theLicenceShouldNotDisplayedInSelfserve() {
world.selfServeNavigation.navigateToLogin(world.registerUser.getUserName(), world.registerUser.getEmailAddress());
world.globalMethods.signIn(world.registerUser.getUserName(), SecretsManager.getSecretValue("adminPassword"));;
assertFalse(isLinkPresent(world.applicationDetails.getLicenceNumber(), 3));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

import activesupport.driver.Browser;
import io.cucumber.java.After;
import io.cucumber.java.AfterAll;
import io.cucumber.java.Before;
import io.cucumber.java.Scenario;
import org.dvsa.testing.framework.Report.Config.Environments;
import org.dvsa.testing.framework.hooks.ScreenShotAttachment;
import org.dvsa.testing.framework.pageObjects.enums.SelectorType;

import java.util.Collection;
import java.util.List;

import static org.dvsa.testing.framework.pageObjects.BasePage.*;
import static org.dvsa.testing.framework.pageObjects.BasePage.isLinkPresent;
import static org.dvsa.testing.framework.pageObjects.BasePage.waitAndClick;

public class TestRunConfiguration {
@Before
Expand All @@ -35,7 +34,7 @@ public void tearDown(Scenario scenario) throws Exception {
}
}
if (Browser.isBrowserOpen()) {
Browser.closeBrowser();
Browser.getDriver().quit();
}
Browser.removeLocalDriverThread();
}
Expand Down
5 changes: 3 additions & 2 deletions src/test/resources/junit-platform.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cucumber.publish.quiet=true
cucumber.execution.parallel.enabled = true
cucumber.execution.parallel.config.strategy = custom
cucumber.execution.parallel.config.strategy = fixed
cucumber.execution.execution-mode.feature= concurrent
cucumber.execution.parallel.config.custom.class=org.dvsa.testing.framework.parallel.CustomRunner
cucumber.execution.parallel.config.fixed.parallelism=3
//cucumber.execution.parallel.config.custom.class=org.dvsa.testing.framework.parallel.CustomRunner
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Feature: Sign surrender
When I can navigate to gov sign in
And I sign in to gov sign in to complete the process
Then the post gov sign in page is displayed
And the surrender status is "Surrender under consideration"
And the surrender status is Surrender under consideration

0 comments on commit b629de5

Please sign in to comment.