/src/main/java/pageobjects/CreateIssuePage.java
Java | 52 lines | 35 code | 12 blank | 5 comment | 0 complexity | 993d43659f4b376528ab4bbfa0fb1ba0 MD5 | raw file
- package pageobjects;
-
- import com.atlassian.pageobjects.Page;
- import com.atlassian.pageobjects.PageBinder;
- import com.atlassian.pageobjects.binder.WaitUntil;
- import com.atlassian.pageobjects.elements.ElementBy;
- import com.atlassian.pageobjects.elements.Options;
- import com.atlassian.pageobjects.elements.PageElement;
- import com.atlassian.pageobjects.elements.SelectElement;
- import com.atlassian.pageobjects.elements.query.Poller;
-
- import javax.inject.Inject;
-
- /**
- * TODO: Document this class / interface here
- *
- * @since v4.3
- */
- public class CreateIssuePage implements Page {
-
- @Inject
- PageBinder binder;
-
- @ElementBy(id="project")
- SelectElement projectDropDown;
-
- @ElementBy(id="issue-create-submit")
- PageElement createIssueButton;
-
- @ElementBy(id="summary")
- PageElement summaryTextbox;
-
- @WaitUntil
- private void waitUntil(){
- Poller.waitUntilTrue(createIssueButton.timed().isVisible());
- }
-
- public String getUrl() {
- return "/secure/CreateIssue!default.jspa";
- }
-
- public ViewIssuePage createIssue(String projectKey, String summary){
- projectDropDown.select(Options.text(projectKey));
- createIssueButton.click();
-
- Poller.waitUntilTrue(summaryTextbox.timed().isVisible());
- summaryTextbox.type(summary);
-
- createIssueButton.click();
- return binder.bind(ViewIssuePage.class);
- }
- }