Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
RossWebsterWork committed Jun 2, 2023
2 parents 63e3522 + 46c0787 commit 09a11e9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 60 deletions.
61 changes: 10 additions & 51 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>au.gov.qld.online</groupId>
<artifactId>seleniumHelper</artifactId>
<version>4.8.1.002-SNAPSHOT</version>
<version>4.9.1.002-SNAPSHOT</version>

<scm>
<url>https://github.com/qld-gov-au/seleniumHelper</url>
Expand Down Expand Up @@ -43,7 +43,7 @@
<owasp.dependency-check-maven.version>8.1.2</owasp.dependency-check-maven.version>

<io.netty.version>4.1.87.Final</io.netty.version> <!-- verify this matches in org.seleniumhq.selenium:selenium-remote-driver -->
<guava.version>31.1-jre</guava.version> <!-- verify this maches in selenium-chrome-driver -->
<guava.version>32.0.0-jre</guava.version> <!-- verify this matches in selenium-chrome-driver -->

<qa.directory>${project.basedir}/src/qa</qa.directory>
<maven-checkstyle-plugin.version>3.2.1</maven-checkstyle-plugin.version>
Expand All @@ -59,11 +59,6 @@
<surefire.skip>false</surefire.skip>
<dependency.skip>false</dependency.skip>

<sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/coverage-reports/jacoco-ut.exec</sonar.coverage.jacoco.xmlReportPaths>
<sonar.junit.reportPaths>${project.build.directory}/surefire-reports</sonar.junit.reportPaths>
<sonar.java.spotbugs.reportPaths>${project.build.directory}/spotbugsXml.xml</sonar.java.spotbugs.reportPaths>
<sonar.java.pmd.reportPaths>${project.build.directory}/pmd.xml</sonar.java.pmd.reportPaths>
<sonar.java.checkstyle.reportPaths>${project.build.directory}/checkstyle-result.xml</sonar.java.checkstyle.reportPaths>
</properties>

<dependencyManagement>
Expand All @@ -88,7 +83,7 @@
<dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.14.2</version></dependency>
<dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-annotations</artifactId><version>2.14.2</version></dependency>

<dependency><groupId>io.github.bonigarcia</groupId><artifactId>webdrivermanager</artifactId><version>5.3.2</version>
<dependency><groupId>io.github.bonigarcia</groupId><artifactId>webdrivermanager</artifactId><version>5.3.3</version>
<exclusions>
<exclusion><groupId>org.seleniumhq.selenium</groupId><artifactId>selenium-java</artifactId></exclusion>
<exclusion><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId></exclusion>
Expand All @@ -111,15 +106,15 @@

<dependency><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>2.0.6</version></dependency>

<dependency><groupId>org.seleniumhq.selenium</groupId><artifactId>selenium-java</artifactId><version>4.8.1</version>
<dependency><groupId>org.seleniumhq.selenium</groupId><artifactId>selenium-java</artifactId><version>4.9.1</version>
<exclusions>
<exclusion><groupId>org.seleniumhq.selenium</groupId><artifactId>selenium-opera-driver</artifactId></exclusion>
<exclusion><groupId>org.slf4j</groupId><artifactId>slf4j</artifactId></exclusion>
<exclusion><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId></exclusion>
<exclusion><groupId>com.google.code.findbugs</groupId><artifactId>jsr305</artifactId></exclusion>
</exclusions>
</dependency>
<dependency><groupId>org.seleniumhq.selenium</groupId><artifactId>htmlunit-driver</artifactId><version>4.8.3</version>
<dependency><groupId>org.seleniumhq.selenium</groupId><artifactId>htmlunit-driver</artifactId><version>4.9.1</version>
<exclusions>
<exclusion><groupId>org.seleniumhq.selenium</groupId><artifactId>selenium-api</artifactId></exclusion>
<exclusion><groupId>org.seleniumhq.selenium</groupId><artifactId>selenium-support</artifactId></exclusion>
Expand Down Expand Up @@ -249,17 +244,7 @@
<groupId>org.owasp</groupId><artifactId>dependency-check-maven</artifactId>
<version>${owasp.dependency-check-maven.version}</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId><artifactId>sonar-maven-plugin</artifactId><version>3.9.1.2184</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sonar</goal>
</goals>
</execution>
</executions>
</plugin>


</plugins>
<pluginManagement>
Expand Down Expand Up @@ -497,36 +482,6 @@
</build>

<profiles>
<!--maven runs top to bottom so mvn opts turns off sonar, but then no proxy turns it back on, then no url will turn it off again if not found -->
<profile>
<id>sonar-disable-mvn-ops-missing</id>
<activation>
<property><name>!env.MAVEN_OPTS</name></property>
</activation>
<properties>
<sonar.skip>true</sonar.skip>
</properties>
</profile>
<profile>
<id>sonar-enable-no-proxy</id>
<activation>
<property>
<name>!env.http_proxy</name>
</property>
</activation>
<properties>
<sonar.skip>false</sonar.skip>
</properties>
</profile>
<profile>
<id>sonar-disable-no-url</id>
<activation>
<property><name>!sonar.host.url</name></property>
</activation>
<properties>
<sonar.skip>true</sonar.skip>
</properties>
</profile>
<profile>
<id>local-proxy</id>
<activation>
Expand All @@ -544,6 +499,8 @@
<configuration>
<systemPropertyVariables>
<spring.profiles.include>PROXY</spring.profiles.include>
<http_proxy>http://proxy:3128</http_proxy>
<https_proxy>http://proxy:3128</https_proxy>
</systemPropertyVariables>
</configuration>
</plugin>
Expand All @@ -552,6 +509,8 @@
<configuration>
<systemPropertyVariables>
<spring.profiles.include>PROXY</spring.profiles.include>
<http_proxy>http://proxy:3128</http_proxy>
<https_proxy>http://proxy:3128</https_proxy>
</systemPropertyVariables>
</configuration>
</plugin>
Expand Down
1 change: 1 addition & 0 deletions src/qa/owasp-dependency-checker-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
]]></notes>
<packageUrl regex="true">^pkg:maven/com\.google\.guava/guava@.*$</packageUrl>
<vulnerabilityName>CVE-2020-8908</vulnerabilityName>
<vulnerabilityName>CVE-2023-2976</vulnerabilityName>
</suppress>
<suppress until="2023-11-30">
<notes><![CDATA[
Expand Down
18 changes: 9 additions & 9 deletions src/test/java/au/gov/qld/online/selenium/SeleniumHelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void shouldStartFirefoxBrowserMultiTest() {
WebDriverHolder holder2 = SeleniumHelper.getWebDriver(DriverTypes.FIREFOX);
holder.getWebDriver().navigate().to("https://google.com/");
SeleniumHelper.performScreenPrint(holder2, testName);
holder2.getWebDriver().navigate().to("https://www.qld.gov.au");
holder2.getWebDriver().navigate().to("https://site-down.services.qld.gov.au");
SeleniumHelper.performScreenPrint(holder, testName);
SeleniumHelper.performScreenPrint(holder2, testName);
SeleniumHelper.close(holder);
Expand All @@ -72,7 +72,7 @@ public void shouldStartFirefoxChromeBrowserMultiMixTest() {
WebDriverHolder holder2 = SeleniumHelper.getWebDriver(DriverTypes.CHROME);
holder.getWebDriver().navigate().to("https://google.com/");
SeleniumHelper.performScreenPrint(holder2, testName);
holder2.getWebDriver().navigate().to("https://www.qld.gov.au");
holder2.getWebDriver().navigate().to("https://site-down.services.qld.gov.au");
SeleniumHelper.performScreenPrint(holder, testName);
SeleniumHelper.performScreenPrint(holder2, testName);
SeleniumHelper.close(holder);
Expand Down Expand Up @@ -131,7 +131,7 @@ public void shouldStartChromeBrowserWithTwoInaRow() {
holder = SeleniumHelper.getWebDriver(DriverTypes.CHROME);
holder.getWebDriver().navigate().to("https://google.com/");
WebDriverHolder holder2 = SeleniumHelper.getWebDriver(DriverTypes.CHROME);
holder2.getWebDriver().navigate().to("https://www.qld.gov.au");
holder2.getWebDriver().navigate().to("https://site-down.services.qld.gov.au");
SeleniumHelper.performScreenPrint(holder, testName);
SeleniumHelper.performScreenPrint(holder2, testName);
SeleniumHelper.close(holder);
Expand Down Expand Up @@ -186,10 +186,10 @@ public void shouldSetDownloadDirectoryForChromeBrowser() throws IOException, Int
Path tempDownloadDirectory = Files.createTempDirectory("tempDownloads");
tempDownloadDirectory.toFile().deleteOnExit();
String downloadFilepath = tempDownloadDirectory.toFile().getAbsolutePath() + "/";
String filename = "ict-dashboard-dcyjma-dataset.csv";
String filename = "testfile.xlsx";
holder = SeleniumHelper.getWebDriver(DriverTypes.CHROME, downloadFilepath);
// Download a test CSV from dev.data.qld.gov.au: "ict-dashboard-dcyjma-dataset.csv"
holder.getWebDriver().navigate().to("https://dev.data.qld.gov.au/dataset/0aa564f0-32be-4aff-89af-565882fd4982/resource/0f623a2a-1ef3-4f7e-8a4c-45a4de31cef7/download/ict-dashboard-dcyjma-dataset.csv");
// Download a test file from staging.data.qld.gov.au: "testfile.xlsx"
holder.getWebDriver().navigate().to("https://staging.data.qld.gov.au/dataset/534a6213-bc2e-4b79-a8da-95438adf47f9/resource/c5098e4c-994d-48d7-a12b-c69c876897cc/download/testfile.xlsx");
FluentWait<WebDriver> wait = new FluentWait<>(holder.getWebDriver()).withTimeout(Duration.ofSeconds(10L)).pollingEvery(Duration.ofMillis(100));
File downloadedFile = new File(downloadFilepath + filename);
wait.until(x -> downloadedFile.exists());
Expand Down Expand Up @@ -236,12 +236,12 @@ public void shouldSetDownloadDirectoryForSafariBrowser() throws IOException, Int
Path tempDownloadDirectory = Files.createTempDirectory("tempDownloads");
tempDownloadDirectory.toFile().deleteOnExit();
String downloadFilepath = tempDownloadDirectory.toFile().getAbsolutePath() + "/";
String filename = "ict-dashboard-dcyjma-dataset.csv";
String filename = "testfile.xlsx";
// Not sure how safari has settings set up, so try download instead
try {
holder = SeleniumHelper.getWebDriver(DriverTypes.SAFARI, downloadFilepath);
// Download a test CSV from dev.data.qld.gov.au: "ict-dashboard-dcyjma-dataset.csv"
holder.getWebDriver().navigate().to("https://dev.data.qld.gov.au/dataset/0aa564f0-32be-4aff-89af-565882fd4982/resource/0f623a2a-1ef3-4f7e-8a4c-45a4de31cef7/download/ict-dashboard-dcyjma-dataset.csv");
// Download a test file from staging.data.qld.gov.au: "testfile.xlsx"
holder.getWebDriver().navigate().to("https://staging.data.qld.gov.au/dataset/534a6213-bc2e-4b79-a8da-95438adf47f9/resource/c5098e4c-994d-48d7-a12b-c69c876897cc/download/testfile.xlsx");
TimeUnit.SECONDS.sleep(3);
File downloadedFile = new File(downloadFilepath + filename);
Assertions.assertThat(downloadedFile).exists();
Expand Down

0 comments on commit 09a11e9

Please sign in to comment.