Skip to content

Commit

Permalink
Merge pull request #383 from bcgov/qa-ofmcc-5964-add-license-to-facility
Browse files Browse the repository at this point in the history
OFMCC-6222 - QA Auto - Smoke test script
  • Loading branch information
Rylan-cgi authored Oct 11, 2024
2 parents d82e2dc + f7e854c commit 3a8a63f
Show file tree
Hide file tree
Showing 16 changed files with 866 additions and 14 deletions.
4 changes: 4 additions & 0 deletions selenium-testing/config.properties.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ portal_url=https://ofm-frontend-test-e1800b-dev.apps.silver.devops.gov.bc.ca/log
portal_username=
portal_password=

internal_portal_url=https://ofm-frontend-test-e1800b-dev.apps.silver.devops.gov.bc.ca/internal
internal_portal_username=
internal_portal_password=

crm_url=https://mychildcareservicesdev.crm3.dynamics.com/main.aspx?appid=af54cb40-d463-ee11-8df0-000d3a09d499&pagetype=dashboard&id=73c44d9c-cfe6-ee11-a204-000d3af4865d&type=system&_canOverride=true
crm_username=
crm_password=
5 changes: 5 additions & 0 deletions selenium-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,10 @@
<artifactId>opencsv</artifactId>
<version>5.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,43 @@ public class CRMHomePage {

@FindBy(xpath = "//*[@aria-label='Edit']")
WebElement editButton;

@FindBy(xpath = "//*[@aria-label[contains(., 'Account Manager')]]")
WebElement profileButton;

@FindBy(xpath = "//*[@aria-label='Sign out of this account']")
WebElement signOut;

@FindBy(xpath = "//*[@aria-label='Organization-Facilities']")
WebElement orgFacButton;

@FindBy(xpath = "//*[@aria-label='Contacts']")
WebElement contactButton;

@FindBy(xpath = "//*[@aria-label='Licences']")
WebElement licenseButton;

@FindBy(xpath = "//*[@aria-label='Contact Lists']")
WebElement contactListButton;

@FindBy(xpath = "//*[@aria-label='Notifications']")
WebElement notificationButton;

@FindBy(xpath = "//*[@aria-label='Provider Reports']")
WebElement providerReportsButton;

@FindBy(xpath = "//*[@aria-label='Applications']")
WebElement applicationsButton;

@FindBy(xpath = "//*[@aria-label='Supplementaries']")
WebElement supplementariesButton;

@FindBy(xpath = "//*[@aria-label='Fundings']")
WebElement fundingsButton;

@FindBy(xpath = "//*[@aria-label='Assistance Requests']")
WebElement assistanceRequestsButton;


public CRMHomePage(WebDriver driver) {
this.driver = driver;
Expand All @@ -43,4 +80,52 @@ public void selectIrregularExpenseApplication() {
e.printStackTrace();
}
}

public void selectProfile() {
wait.until(ExpectedConditions.elementToBeClickable(profileButton)).click();
}

public void clickSignOut() {
wait.until(ExpectedConditions.elementToBeClickable(signOut)).click();
}

public void selectOrgFacButton() {
wait.until(ExpectedConditions.elementToBeClickable(orgFacButton)).click();
}

public void selectContacts() {
wait.until(ExpectedConditions.elementToBeClickable(contactButton)).click();
}

public void selectLicenses() {
wait.until(ExpectedConditions.elementToBeClickable(licenseButton)).click();
}

public void selectContactList() {
wait.until(ExpectedConditions.elementToBeClickable(contactListButton)).click();
}

public void selectNotifications() {
wait.until(ExpectedConditions.elementToBeClickable(notificationButton)).click();
}

public void selectProviderReports() {
wait.until(ExpectedConditions.elementToBeClickable(providerReportsButton)).click();
}

public void selectApplications() {
wait.until(ExpectedConditions.elementToBeClickable(applicationsButton)).click();
}

public void selectSupplementaries() {
wait.until(ExpectedConditions.elementToBeClickable(supplementariesButton)).click();
}

public void selectFundings() {
wait.until(ExpectedConditions.elementToBeClickable(fundingsButton)).click();
}

public void selectAssistanceRequests() {
wait.until(ExpectedConditions.elementToBeClickable(assistanceRequestsButton)).click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public class CRMSignInCredentialPage {

@FindBy(xpath = "//*[text()='Assistance Requests']")
WebElement buttonAssistanceRequest;

@FindBy(xpath = "//*[@aria-label[contains(., 'Sign in with')]]")
WebElement signInAccount;

public CRMSignInCredentialPage(WebDriver driver) {
this.driver = driver;
Expand Down Expand Up @@ -86,5 +89,9 @@ public void clickOrgFacilities() {
public void clickAssistanceRequest() {
wait.until(ExpectedConditions.elementToBeClickable(buttonAssistanceRequest)).click();
}

public void clickAccount() {
wait.until(ExpectedConditions.elementToBeClickable(signInAccount)).click();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class LicenseDetailsPage {
@FindBy(xpath = "//*[@aria-label='Save (CTRL+S)']")
WebElement saveButton;

@FindBy(xpath = "//*[@aria-label='Save & Close']")
WebElement saveAndCloseButton;

@FindBy(xpath = "//*[@aria-label='New Service Delivery Detail. Add New Service Delivery Detail']")
WebElement newServiceDeliveryDetail;

Expand Down Expand Up @@ -59,4 +62,12 @@ public void setStartDate() {
public void saveLicense() {
wait.until(ExpectedConditions.visibilityOf(saveButton)).click();
}

public void saveAndCloseLicense() {
wait.until(ExpectedConditions.visibilityOf(saveAndCloseButton)).click();
}

public void addNewSDD() {
wait.until(ExpectedConditions.visibilityOf(newServiceDeliveryDetail)).click();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package ca.bc.gov.ecc.ofm.selenium.v1.PageFactory_CRM;

import java.time.Duration;
import java.util.Base64;

import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class ServiceDeliveryDetailsPage {
WebDriver driver;
WebDriverWait wait;

@FindBy(xpath = "//*[@aria-label='Licence Type']")
WebElement licenseTypeField;

@FindBy(xpath = "//*[text()='Group Child Care (Under 36 Months)']")
WebElement licenseTypeOption;

@FindBy(xpath = "//*[@aria-label='Weeks in Operation']")
WebElement weeksInOperationField;

@FindBy(id = "ofm_week_days_ledit")
WebElement daysOfWeekField;

@FindBy(xpath = "//*[text()='Monday']")
WebElement daysOfWeekOption;

@FindBy(xpath = "//*[@aria-label='Hours of Operation From']")
WebElement hoursOfOperationFromField;

@FindBy(xpath = "//*[@aria-label='Hours of Operation To']")
WebElement hoursOfOperationToField;

@FindBy(xpath = "//*[@aria-label='Licensed Spaces']")
WebElement licenseSpacesField;

@FindBy(xpath = "//*[@aria-label='Operational Spaces']")
WebElement operationalSpacesField;

@FindBy(xpath = "//*[@aria-label='Enrolled Spaces']")
WebElement enrolledSpacesField;

@FindBy(xpath = "//*[@aria-label='Save & Close']")
WebElement saveAndCloseButton;


public ServiceDeliveryDetailsPage(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
wait = new WebDriverWait(driver, Duration.ofMillis(10000));
}

public void setLicenceType() {
wait.until(ExpectedConditions.visibilityOf(licenseTypeField)).click();
wait.until(ExpectedConditions.visibilityOf(licenseTypeOption)).click();
}

public void setWeeksInOperation(String weeksInOperation) {
weeksInOperationField.sendKeys(weeksInOperation);
}

public void setDaysOfWeek(String daysOfWeek) {
daysOfWeekField.sendKeys(daysOfWeek);
wait.until(ExpectedConditions.visibilityOf(daysOfWeekOption)).click();
daysOfWeekField.sendKeys(Keys.ESCAPE);
}

public void setHoursOfOperationFrom(String hoursOfOperationFrom) {
wait.until(ExpectedConditions.visibilityOf(hoursOfOperationFromField)).click();
hoursOfOperationFromField.sendKeys(hoursOfOperationFrom);
}

public void setHoursOfOperationTo(String hoursOfOperationTo) {
wait.until(ExpectedConditions.visibilityOf(hoursOfOperationToField)).click();
hoursOfOperationToField.sendKeys(hoursOfOperationTo);
}

public void setLicenseSpaces(String licenseSpaces) {
licenseSpacesField.sendKeys(licenseSpaces);
}

public void setOperationalSpaces(String operationalSpaces) {
operationalSpacesField.sendKeys(operationalSpaces);
}

public void setEnrolledSpacesField(String enrolledSpaces) {
enrolledSpacesField.sendKeys(enrolledSpaces);
}

public void saveAndCLoseSDD() {
wait.until(ExpectedConditions.visibilityOf(saveAndCloseButton)).click();
}
}
Loading

0 comments on commit 3a8a63f

Please sign in to comment.