/src/main/java/pageobjects/DeleteProjectPage.java
Java | 51 lines | 36 code | 10 blank | 5 comment | 2 complexity | 67280a057732813ee7edae448834073d MD5 | raw file
- package pageobjects;
-
- import com.atlassian.pageobjects.Page;
- import com.atlassian.pageobjects.binder.WaitUntil;
- import com.atlassian.pageobjects.elements.ElementBy;
- import com.atlassian.pageobjects.elements.PageElement;
- import com.atlassian.pageobjects.elements.PageElementFinder;
- import com.atlassian.pageobjects.elements.query.Poller;
- import org.junit.Assert;
- import org.openqa.selenium.By;
-
- import javax.inject.Inject;
-
- /**
- * TODO: Document this class / interface here
- *
- * @since v4.3
- */
- public class DeleteProjectPage implements Page{
- @Inject
- PageElementFinder finder;
-
- @ElementBy(name = "delete")
- PageElement deleteButton;
-
- private final String id;
-
- public DeleteProjectPage(String id){
- this.id = id;
- }
-
- @Override
- public String getUrl() {
- return "/secure/admin/DeleteProject!default.jspa?pid=" + id;
- }
-
- @WaitUntil
- private void waitUntil(){
- Poller.waitUntilTrue(deleteButton.timed().isVisible());
- }
-
- public void delete(){
- deleteButton.click();
-
- for(PageElement form: finder.findAll(By.className("jiraform"))){
- if(!"ccffcc".equals(form.findAll(By.tagName("tr")).get(1).getAttribute("bgcolor"))){
- throw new RuntimeException("Expected project to be deleted successfully");
- }
- }
- }
- }