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

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

1)All the changes made as per the comment

2)some locator and method got changed as some feature changes for expanding metadata
parent 0942a4e7
No related branches found
No related tags found
No related merge requests found
...@@ -18,13 +18,11 @@ public class ServiceGroupRow extends PageComponent { ...@@ -18,13 +18,11 @@ public class ServiceGroupRow extends PageComponent {
} }
// private WebElement container;
@FindBy(tagName = "datatable-body-cell") @FindBy(tagName = "datatable-body-cell")
protected List<WebElement> cells; protected List<WebElement> cells;
/*@FindBy(className = "table-button-expand")
private WebElement expandMetadata;*/
@FindBy(css = ".ng-star-inserted.datatable-icon-right") @FindBy(css = ".ng-star-inserted.datatable-icon-right")
private WebElement expandMetadata; private WebElement expandMetadata;
......
...@@ -47,10 +47,10 @@ public class UserPopup extends PageComponent { ...@@ -47,10 +47,10 @@ public class UserPopup extends PageComponent {
@FindBy(css = ".mat-form-field-infix > div.has-error") @FindBy(css = ".mat-form-field-infix > div.has-error")
WebElement passMatchValidationError; WebElement passMatchValidationError;
@FindBy(css = "mat-dialog-content > table > tbody > tr > td > button:nth-child(1)") @FindBy(css = "mat-dialog-content > table > tr > td > button:nth-child(1)")
WebElement okBtn; WebElement okBtn;
@FindBy(css = "mat-dialog-content > table > tbody > tr > td > button:nth-child(2)") @FindBy(css = "mat-dialog-content > table > tr > td > button:nth-child(2)")
WebElement cancelBtn; WebElement cancelBtn;
@FindBy(css = "#role_id") @FindBy(css = "#role_id")
......
...@@ -29,49 +29,43 @@ public class UsersGrid extends BasicGrid { ...@@ -29,49 +29,43 @@ public class UsersGrid extends BasicGrid {
} }
public boolean isUserListed(String username) { public boolean isUserListed(String username) {
boolean end = false;
PaginationControls pagination = new PaginationControls(driver); PaginationControls pagination = new PaginationControls(driver);
pagination.skipToFirstPage(); pagination.skipToFirstPage();
List<UserRowInfo> rows;
int count = 0;
do { do {
List<UserRowInfo> rows = getRows(); if (count != 0) {
pagination.goToNextPage();
}
rows =getRows();
for (UserRowInfo row : rows) { for (UserRowInfo row : rows) {
if (row.getUsername().equalsIgnoreCase(username)) { if (row.getUsername().equalsIgnoreCase(username)) {
return true; return true;
} }
} }
count++;
try { }
pagination.goToNextPage(); while (pagination.hasNextPage());
} catch (Exception e) {
}
} while (pagination.hasNextPage());
return false; return false;
} }
public int scrollToUser(String username) { public int scrollToUser(String username) {
PaginationControls pagination = new PaginationControls(driver); PaginationControls pagination = new PaginationControls(driver);
pagination.skipToFirstPage(); pagination.skipToFirstPage();
List<UserRowInfo> rows;
int count = 0;
do { do {
if(count!=0){
List<UserRowInfo> rows = getRows(); pagination.goToNextPage();
}
rows = getRows();
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
if (rows.get(i).getUsername().equalsIgnoreCase(username)) { if (rows.get(i).getUsername().equalsIgnoreCase(username)) {
return i; return i;
} }
} }
try { count++;
pagination.goToNextPage();
} catch (Exception e) {
}
} while (pagination.hasNextPage()); } while (pagination.hasNextPage());
return -1; return -1;
} }
......
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