From bd82053136c5a6d27e41ca7411d47c666be51b03 Mon Sep 17 00:00:00 2001 From: Rylan-cgi Date: Tue, 26 Nov 2024 11:25:17 -0800 Subject: [PATCH] Change pointing to repo --- selenium-testing/cicd/cicd-script.bat | 6 +-- .../ecc/ofm/selenium/v1/tests/BaseTest.java | 2 +- .../v1/tests/scripting/SmokeTestScript.java | 41 +++++++++++-------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/selenium-testing/cicd/cicd-script.bat b/selenium-testing/cicd/cicd-script.bat index 219f5262..c186d4d6 100644 --- a/selenium-testing/cicd/cicd-script.bat +++ b/selenium-testing/cicd/cicd-script.bat @@ -42,7 +42,7 @@ set "$assigneeUser=%accountId%" set "$mandatoryFields={\"reporter\":{\"id\":\"%accountId%\",\"label\":\"%jiraAccountName%\",\"name\":\"%jiraAccountName%\"}}" :: File path for results file -set "$resultPath=@\"%WORKSPACE%/target/surefire-reports/testng-results.xml\" +set "$resultPath=@\"%WORKSPACE%/selenium-testing/target/surefire-reports/testng-results.xml\" :: ========================================= :: Create an automation task, run it, send test results to Zephyr. @@ -84,9 +84,9 @@ set "$issueSelf=%issueSelf%" :: Attach test result screenshots to the Jira test case :: ========================================= -set "$imageDir=%WORKSPACE%/TestExecutionScreenshots" +set "$imageDir=%WORKSPACE%/selenium-testing/TestExecutionScreenshots" -for %%F in (%$imageDir%\*.png) do ( +for %%F in ("%$imageDir%\*.png") do ( echo Sending: %%F curl --location --request POST "%$issueSelf%/attachments" ^ --user "%$jiraRestAPIAuth%" ^ diff --git a/selenium-testing/src/test/java/ca/bc/gov/ecc/ofm/selenium/v1/tests/BaseTest.java b/selenium-testing/src/test/java/ca/bc/gov/ecc/ofm/selenium/v1/tests/BaseTest.java index 3b59fa84..b6dd29d6 100644 --- a/selenium-testing/src/test/java/ca/bc/gov/ecc/ofm/selenium/v1/tests/BaseTest.java +++ b/selenium-testing/src/test/java/ca/bc/gov/ecc/ofm/selenium/v1/tests/BaseTest.java @@ -103,7 +103,7 @@ public static void cleanTestExecutionScreenshots() { }); } catch(Exception e) { - e.printStackTrace(); + System.out.println("[INFO] There is no folder for screenshots created yet, one will be created"); } } diff --git a/selenium-testing/src/test/java/ca/bc/gov/ecc/ofm/selenium/v1/tests/scripting/SmokeTestScript.java b/selenium-testing/src/test/java/ca/bc/gov/ecc/ofm/selenium/v1/tests/scripting/SmokeTestScript.java index 5d0d1650..f2bcfa4c 100644 --- a/selenium-testing/src/test/java/ca/bc/gov/ecc/ofm/selenium/v1/tests/scripting/SmokeTestScript.java +++ b/selenium-testing/src/test/java/ca/bc/gov/ecc/ofm/selenium/v1/tests/scripting/SmokeTestScript.java @@ -1,31 +1,36 @@ package ca.bc.gov.ecc.ofm.selenium.v1.tests.scripting; -import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_Portal.*; -import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_CRM.*; -import ca.bc.gov.ecc.ofm.selenium.v1.tests.BaseTest; -import ca.bc.gov.ecc.ofm.selenium.v1.tests.CustomReporter; -import io.github.bonigarcia.wdm.WebDriverManager; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; -import org.openqa.selenium.*; +import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; +import org.openqa.selenium.logging.LogEntries; +import org.openqa.selenium.logging.LogEntry; +import org.openqa.selenium.logging.LogType; import org.testng.Assert; -import org.testng.TestNG; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Listeners; import org.testng.annotations.Test; -import org.openqa.selenium.logging.LogEntries; -import org.openqa.selenium.logging.LogEntry; -import org.openqa.selenium.logging.LogType; -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.logging.Level; +import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_CRM.CRMHomePage; +import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_CRM.CRMSignInCredentialPage; +import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_Portal.InternalPortalImpersonatePage; +import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_Portal.InternalPortalSignInFirstPage; +import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_Portal.PortalHomePage; +import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_Portal.PortalMessagesAndNotificationsPage; +import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_Portal.PortalSignInCredentialPage; +import ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_Portal.PortalSignInFirstPage; +import ca.bc.gov.ecc.ofm.selenium.v1.tests.BaseTest; +import ca.bc.gov.ecc.ofm.selenium.v1.tests.CustomReporter; +import io.github.bonigarcia.wdm.WebDriverManager; @Listeners(CustomReporter.class) public class SmokeTestScript extends BaseTest { @@ -240,7 +245,7 @@ public void SmokeTest() throws Exception { portalHomePage.clickImpersonate(); Thread.sleep(3000); - portalImpersonatePage.setImpersonateField("UAT_SECONDARY_PORTAL_USERNAME"); + portalImpersonatePage.setImpersonateField(UAT_SECONDARY_PORTAL_USERNAME); portalImpersonatePage.clickSearchButton(); test.info("Test #7 - Using impersonate, login to another user - Complete");