@Test(dependsOnMethods = "checkSearch") public void cancelInvite() { pendingInvitesPage.cancelInvitation(userNameTest); assertNotNull(pendingInvitesPage); verifyInviteCancelled(userNameTest); assertTrue(verifyInviteCancelled(userNameTest), "The invite wasn't cancelled!"); }
public void cancelInvitation(String username) { List<WebElement> searchResults = getInvitees(); if (username == null || searchResults == null || searchResults.isEmpty()) { throw new UnsupportedOperationException("user input required or no invites are retrieved"); } for (WebElement inviteeList : searchResults) { WebElement invitee = inviteeList.findElement(USER_NAME_FROM_LIST); String text = invitee.getText(); if (text != null && !text.isEmpty()) { if (text.equalsIgnoreCase("(" + username + ")")) { inviteeList.findElement(CANCEL_BTN).click(); break; } } } }
PendingInvitesPage extends SharePage { public void cancelInvitation(String username) { List<WebElement> searchResults = getInvitees(); if (username == null || searchResults == null || searchResults.isEmpty()) { throw new UnsupportedOperationException("user input required or no invites are retrieved"); } for (WebElement inviteeList : searchResults) { WebElement invitee = inviteeList.findElement(USER_NAME_FROM_LIST); String text = invitee.getText(); if (text != null && !text.isEmpty()) { if (text.equalsIgnoreCase("(" + username + ")")) { inviteeList.findElement(CANCEL_BTN).click(); break; } } } } }
PendingInvitesPage extends SharePage { public void cancelInvitation(String username) { List<WebElement> searchResults = getInvitees(); if (username == null || searchResults == null || searchResults.isEmpty()) { throw new UnsupportedOperationException("user input required or no invites are retrieved"); } for (WebElement inviteeList : searchResults) { WebElement invitee = inviteeList.findElement(USER_NAME_FROM_LIST); String text = invitee.getText(); if (text != null && !text.isEmpty()) { if (text.equalsIgnoreCase("(" + username + ")")) { inviteeList.findElement(CANCEL_BTN).click(); break; } } } } PendingInvitesPage(WebDrone drone); }
PendingInvitesPage extends SharePage { public void cancelInvitation(String username) { List<WebElement> searchResults = getInvitees(); if (username == null || searchResults == null || searchResults.isEmpty()) { throw new UnsupportedOperationException("user input required or no invites are retrieved"); } for (WebElement inviteeList : searchResults) { WebElement invitee = inviteeList.findElement(USER_NAME_FROM_LIST); String text = invitee.getText(); if (text != null && !text.isEmpty()) { if (text.equalsIgnoreCase("(" + username + ")")) { inviteeList.findElement(CANCEL_BTN).click(); break; } } } } PendingInvitesPage(WebDrone drone); @SuppressWarnings("unchecked") @Override PendingInvitesPage render(RenderTime timer); @SuppressWarnings("unchecked") PendingInvitesPage render(); @SuppressWarnings("unchecked") @Override PendingInvitesPage render(long time); List<WebElement> getInvitees(); void cancelInvitation(String username); void search(String searchText); }
PendingInvitesPage extends SharePage { public void cancelInvitation(String username) { List<WebElement> searchResults = getInvitees(); if (username == null || searchResults == null || searchResults.isEmpty()) { throw new UnsupportedOperationException("user input required or no invites are retrieved"); } for (WebElement inviteeList : searchResults) { WebElement invitee = inviteeList.findElement(USER_NAME_FROM_LIST); String text = invitee.getText(); if (text != null && !text.isEmpty()) { if (text.equalsIgnoreCase("(" + username + ")")) { inviteeList.findElement(CANCEL_BTN).click(); break; } } } } PendingInvitesPage(WebDrone drone); @SuppressWarnings("unchecked") @Override PendingInvitesPage render(RenderTime timer); @SuppressWarnings("unchecked") PendingInvitesPage render(); @SuppressWarnings("unchecked") @Override PendingInvitesPage render(long time); List<WebElement> getInvitees(); void cancelInvitation(String username); void search(String searchText);  }