Skip to content

Commit f93f97e

Browse files
authored
MOSIP-42736 Create framework for esignet similar to esignet signup (mosip#1410)
Signed-off-by: maheswaras <maheswara.s@cyberpwn.com>
1 parent f90aaba commit f93f97e

9 files changed

Lines changed: 20 additions & 1718 deletions

File tree

ui-test/src/main/java/base/BasePage.java

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010

1111
import org.openqa.selenium.Alert;
1212
import org.openqa.selenium.JavascriptExecutor;
13-
import org.openqa.selenium.Keys;
1413
import org.openqa.selenium.NoAlertPresentException;
1514
import org.openqa.selenium.NoSuchElementException;
1615
import org.openqa.selenium.OutputType;
1716
import org.openqa.selenium.TakesScreenshot;
1817
import org.openqa.selenium.WebDriver;
1918
import org.openqa.selenium.WebElement;
20-
import org.openqa.selenium.interactions.Actions;
2119
import org.openqa.selenium.support.ui.ExpectedConditions;
2220
import org.openqa.selenium.support.ui.WebDriverWait;
2321
import org.slf4j.Logger;
@@ -175,53 +173,4 @@ public void captureScreenshot(String filename) {
175173
LOGGER.error("Failed to capture screenshot: {}", e.getMessage());
176174
}
177175
}
178-
179-
public void enterTextJS(WebElement element, String text) {
180-
try {
181-
waitForElementVisible(element);
182-
183-
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView({block: 'center'});", element);
184-
new Actions(driver).moveToElement(element).click().perform();
185-
((JavascriptExecutor) driver).executeScript("arguments[0].value = '';", element);
186-
187-
Actions actions = new Actions(driver);
188-
for (char c : text.toCharArray()) {
189-
actions.sendKeys(String.valueOf(c)).pause(Duration.ofMillis(150));
190-
}
191-
actions.perform();
192-
193-
((JavascriptExecutor) driver).executeScript(
194-
"arguments[0].dispatchEvent(new Event('input', { bubbles: true }));" +
195-
"arguments[0].dispatchEvent(new Event('change', { bubbles: true }));" +
196-
"arguments[0].blur();",
197-
element
198-
);
199-
200-
String finalValue = element.getAttribute("value");
201-
if (finalValue == null) {
202-
throw new RuntimeException("Value was rejected by frontend (null).");
203-
}
204-
}
205-
206-
catch (Exception e) {
207-
throw new RuntimeException("Failed to set filedvalue due to UI behavior", e);
208-
}
209-
}
210-
211-
public String getElementValue(WebElement element) {
212-
waitForElementVisible(element);
213-
return element.getAttribute("value");
214-
}
215-
216-
public String getElementAttribute(WebElement element, String attribute) {
217-
waitForElementVisible(element);
218-
return element.getAttribute(attribute);
219-
}
220-
221-
public void clearField(WebElement element) {
222-
waitForElementVisible(element);
223-
element.click();
224-
element.sendKeys(Keys.CONTROL + "a");
225-
element.sendKeys(Keys.DELETE);
226-
}
227176
}

ui-test/src/main/java/base/BaseTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import io.cucumber.plugin.event.PickleStepTestStep;
3131
import io.cucumber.plugin.event.TestCase;
3232
import io.cucumber.plugin.event.TestStep;
33-
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
3433
import io.mosip.testrig.apirig.utils.S3Adapter;
3534
import utils.BaseTestUtil;
3635
import utils.EsignetConfigManager;
@@ -283,9 +282,6 @@ public static String getEnvName() {
283282
String domainPart = baseUrl.replace("https://", "").replace("http://", ""); // remove protocol
284283
domainPart = domainPart.split("/")[0]; // remove path if any
285284
String[] parts = domainPart.split("\\.");
286-
287-
LOGGER.info("--- ApplnURI ---" + BaseTestCase.ApplnURI);
288-
BaseTestCase.ApplnURI = System.getProperty("env.endpoint");
289285

290286
String envName = "";
291287
if (parts.length >= 3) {

ui-test/src/main/java/pages/LoginOptionsPage.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ public LoginOptionsPage(WebDriver driver) {
1818

1919
@FindBy(xpath = "//img[@class='brand-logo']")
2020
WebElement brandLogo;
21-
22-
@FindBy(id = "signup-url-button")
23-
WebElement signUpWithUnifiedLogin;
2421

2522
public void clickOnSignInWIthEsignet() {
2623
clickOnElement(signInWithEsignet);
@@ -29,13 +26,5 @@ public void clickOnSignInWIthEsignet() {
2926
public boolean isLogoDisplayed() {
3027
return isElementVisible(brandLogo);
3128
}
32-
33-
public boolean isSignUpWithUnifiedLoginOptionDisplayed() {
34-
return isElementVisible(signUpWithUnifiedLogin);
35-
}
36-
37-
public void clickOnSignUpWithUnifiedLogin() {
38-
clickOnElement(signUpWithUnifiedLogin);
39-
}
4029

4130
}

0 commit comments

Comments
 (0)