Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions ui-test/src/main/java/pages/EsignetIdpPage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package pages;

import base.BasePage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

public class EsignetIdpPage extends BasePage {

public EsignetIdpPage(WebDriver driver) {
super(driver);
PageFactory.initElements(driver, this);
}

@FindBy(xpath = "//img[@class='brand-logo']")
WebElement brandLogo;

@FindBy(id = "login-header")
WebElement loginHeader;

public boolean isBrandLogoDisplayed() {
return isElementVisible(brandLogo);
}

public boolean isLoginHeaderDisplayed() {
return isElementVisible(loginHeader);
}

public boolean isIdpUIScreenDisplayed() {
return isBrandLogoDisplayed() && isLoginHeaderDisplayed();
}
}
37 changes: 37 additions & 0 deletions ui-test/src/main/java/pages/HealthServicesPage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package pages;

import base.BasePage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

public class HealthServicesPage extends BasePage {

public HealthServicesPage(WebDriver driver) {
super(driver);
PageFactory.initElements(driver, this);
}

@FindBy(xpath = "//span[@class='title-font text-3xl text-gray-900 font-medium']")
WebElement healthPortalTitle;

@FindBy(id = "sign-in-with-esignet")
WebElement signInWithEsignetButton;

public boolean isHealthPortalTitleDisplayed() {
return isElementVisible(healthPortalTitle);
}

public String getHealthPortalTitleText() {
return getText(healthPortalTitle);
}

public boolean isSignInWithEsignetButtonDisplayed() {
return isElementVisible(signInWithEsignetButton);
}

public void clickOnSignInWithEsignet() {
clickOnElement(signInWithEsignetButton);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package stepdefinitions;

import static org.junit.Assert.assertTrue;
import java.time.Duration;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import base.BaseTest;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import pages.HealthServicesPage;
import pages.EsignetIdpPage;
import utils.EsignetConfigManager;

public class MultilingualSupportStepDef {

public WebDriver driver;
BaseTest baseTest;
HealthServicesPage healthServicesPage;
EsignetIdpPage esignetIdpPage;

public MultilingualSupportStepDef(BaseTest baseTest) {
this.baseTest = baseTest;
this.driver = BaseTest.getDriver();
healthServicesPage = new HealthServicesPage(driver);
esignetIdpPage = new EsignetIdpPage(driver);
}

@When("Launch the health services url")
public void launchTheHealthServicesUrl() {
String url = EsignetConfigManager.getproperty("baseurl");
driver.get(url);
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
wait.until(ExpectedConditions.titleContains("Health"));
}

@Then("User should be redirected to Health service portal UI screen")
public void userShouldBeRedirectedToHealthServicePortalUIScreen() {
assertTrue("Health Portal title should be displayed",
healthServicesPage.isHealthPortalTitleDisplayed());
}

@Then("Verify whether launching url navigates to health service UI Screen")
public void verifyWhetherLaunchingUrlNavigatesToHealthServiceUIScreen() {
assertTrue("Health Portal title should be displayed",
healthServicesPage.isHealthPortalTitleDisplayed());
}

@When("User clicks on sign in with esignet option")
public void userClicksOnSignInWithEsignetOption() {
assertTrue("Sign in with esignet button should be displayed",
healthServicesPage.isSignInWithEsignetButtonDisplayed());
healthServicesPage.clickOnSignInWithEsignet();


WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
wait.until(ExpectedConditions.urlContains("esignet"));
}

@Then("User should be redirected to IDP UI screen")
public void userShouldBeRedirectedToIdpUIScreen() {
assertTrue("IDP UI screen should be displayed",
esignetIdpPage.isIdpUIScreenDisplayed());
}

@Then("Verify user is redirected to IDP UI screen")
public void verifyUserIsRedirectedToIdpUIScreen() {
assertTrue("Brand logo should be displayed",
esignetIdpPage.isBrandLogoDisplayed());
assertTrue("Login header should be displayed",
esignetIdpPage.isLoginHeaderDisplayed());
}
}
18 changes: 8 additions & 10 deletions ui-test/src/main/resources/config.properties
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
# url
baseurl =

baseurl = https://healthservices.es-qa.mosip.net/
# For single browser
browserName=chrome

# For multi-browser execution
runMultipleBrowsers=false
browsers=chrome,edge

# For BrowserStack (required fields)
browserVersion=latest
browserStackOs=Windows
osVersion=10
runOnBrowserStack=true
threadCount=4

runOnBrowserStack=false
threadCount=1
# BrowserStack credentials
browserstack_username=
browserstack_access_key=

# Other flags
headless=true
headless=false
mobileEmulation=false
mobileDevice=Pixel 5
explicitWaitTimeout=
explicitWaitTimeout=
keycloak-external-url = https://iam.es-qa.mosip.net
mosip_components_base_urls = idauthentication=api-internal.qa-base.mosip.net;
enableDebug=yes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@smokeAndRegression
Feature: Multilingual Support
This feature file contains test cases for multilingual support functionality

@smoke @multilingualSupport
Scenario: Verify whether launching url navigates to health service UI Screen
When Launch the health services url
Then Verify whether launching url navigates to health service UI Screen
And User should be redirected to Health service portal UI screen

@smoke @multilingualSupport
Scenario: User click on sign in with esignet option displayed in healthService.com screen
When Launch the health services url
Then User should be redirected to Health service portal UI screen
When User clicks on sign in with esignet option
Then Verify user is redirected to IDP UI screen
And User should be redirected to IDP UI screen