Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class CreateNewRepositoryPage extends AbstractPage
@FindBy(xpath = "//form[@id='new_repository']//button[@type='submit']")
private WebElement buttonCreate;

private final By buttonCreateEnableLocator = By.xpath("//form[@id='new_repository']//button[@type='submit'][not(@disabled)]");

private final By labelEmptyRepoSetupOptionLocator = By.xpath("//h3/strong[text()='Quick setup']");

@FindBy(xpath = "//a[@data-pjax='#js-repo-pjax-container']")
Expand All @@ -42,10 +44,18 @@ public boolean isCurrentRepositoryEmpty()
return labelEmptyRepoSetupOption.isDisplayed();
}

public boolean waitButtonCreate() {
WebElement button = new WebDriverWait(driver, WAIT_TIMEOUT_SECONDS)
.until(ExpectedConditions.presenceOfElementLocated(buttonCreateEnableLocator));
logger.info("Wait until the create button is visible");
return button.isDisplayed();
}

public CreateNewRepositoryPage createNewRepository(String repositoryName, String repositoryDescription)
{
inputRepositoryName.sendKeys(repositoryName);
inputRepositoryDescription.sendKeys(repositoryDescription);
waitButtonCreate();
buttonCreate.click();
logger.info("Created repository with name: [" + repositoryName +
"[ and description: [" + repositoryDescription + "]");
Expand Down