Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit b09d82cf authored by Sonali MOHANTY's avatar Sonali MOHANTY
Browse files

1)Duplicate domain code validation in domain pop up page

2)domain code is showing as strikethrough in domain grid page when only domain code is used to create new domain
3)Error message is showing while creating duplicate user
4)Error message is showing when password and confirm password doesn't match in user pop up page
parent 9d7a239d
No related branches found
No related tags found
No related merge requests found
......@@ -75,9 +75,10 @@ public class BasicGrid extends PageComponent {
public int getRowsNo(){
return gridRows.size();
}
public void scrollRow(int index) {
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].scrollIntoView();",gridRows.get(index));
waitForXMillis(500);
}
}
......@@ -3,6 +3,7 @@ package pages.domain;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import pages.components.grid.BasicGrid;
import java.util.ArrayList;
......@@ -15,7 +16,7 @@ public class DomainGrid extends BasicGrid {
private By cellSelector = By.tagName("datatable-body-cell");
public List<DomainRow> getRowsInfo(){
public List<DomainRow> getRowsInfo() {
log.info("getting all row info");
List<DomainRow> rowInfos = new ArrayList<>();
......@@ -25,7 +26,7 @@ public class DomainGrid extends BasicGrid {
DomainRow row = new DomainRow();
for (int i = 0; i < headerTxt.size(); i++) {
switch (headerTxt.get(i)){
switch (headerTxt.get(i)) {
case "Domain code":
row.setDomainCode(cells.get(i).getText().trim());
break;
......@@ -47,6 +48,11 @@ public class DomainGrid extends BasicGrid {
return rowInfos;
}
public void mouseHoverOnDomainCode(int rowNumber)
{
WebElement element = driver.findElement(By.cssSelector(".datatable-row-wrapper:nth-child(" + rowNumber + ") .datatable-body-cell:nth-child(1) .datatable-body-cell-label span"));
Actions action = new Actions(driver);
action.moveToElement(element).build().perform();
}
}
}
\ No newline at end of file
......@@ -38,6 +38,13 @@ public class DomainPopup extends PageComponent {
@FindBy(css = "#smlSMPId_id")
WebElement smlSMPIdInput;
@FindBy(xpath = "//div[contains(text(),' The Domain code already exists! ')]")
WebElement duplicateDomainErrorMsg;
// @FindBy(css = "#smlClientHeader_id")
// WebElement smlClientHeaderInput;
......@@ -87,6 +94,40 @@ public class DomainPopup extends PageComponent {
smlClientAliasSelect.selectFirstOption();
}
public String getDuplicateDomainErrorMsgText()
{
String duplicateDomainMsg = duplicateDomainErrorMsg.getText();
return duplicateDomainMsg;
}
public boolean isEnableOkButton()
{
try {
return okBtn.isEnabled();
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
public boolean isEnableCancelButton()
{
try {
return cancelBtn.isEnabled();
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
public void clearAndFillDomainCodeInput(String domainCode) {
log.info("filling only domain code data for new domain");
clearAndFillInput(domainCodeInput, domainCode);
}
}
......@@ -49,6 +49,9 @@ public class UserPopup extends PageComponent {
@FindBy(css = "mat-dialog-content > table > tbody > tr > td > button:nth-child(2)")
WebElement cancelBtn;
@FindBy(xpath = "//div[text()=\'Passwords do not match \']")
WebElement passwordUnmatchingMsg;
@FindBy(css = "#role_id")
WebElement rolesSelectContainer;
public GenericSelect rolesSelect;
......@@ -129,4 +132,9 @@ public class UserPopup extends PageComponent {
}
return null;
}
public String getPasswordUnmatchingMsg()
{
return passwordUnmatchingMsg.getText();
}
}
......@@ -41,6 +41,9 @@ public class UsersPage extends SMPPage {
@FindBy(id = "deleteButton")
private WebElement deleteBtn;
@FindBy(xpath = "//div[contains(text(),'Unexpected technical error occurred.')]")
private WebElement duplicateUserCreationMsg;
public boolean isLoaded(){
......@@ -113,10 +116,26 @@ public class UsersPage extends SMPPage {
popup.clickOK();
}
public boolean isNewButtonEnabled()
{
try{
return newBtn.isEnabled();
}
catch(Exception e)
{
e.printStackTrace();
throw e;
}
}
public String getDuplicateUserErrorMsg()
{
return duplicateUserCreationMsg.getText();
}
}
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment