|
|
@ -46,12 +46,17 @@ public final class TenantPage extends NavBarPage implements SecurityPage.Tab { |
|
|
|
}) |
|
|
|
}) |
|
|
|
private WebElement buttonConfirm; |
|
|
|
private WebElement buttonConfirm; |
|
|
|
|
|
|
|
|
|
|
|
private final CreateTenantForm createTenantForm; |
|
|
|
@FindBy(className = "tenantCode") |
|
|
|
|
|
|
|
private WebElement tenantCode; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final TenantForm tenantForm; |
|
|
|
|
|
|
|
private final TenantForm editTenantForm; |
|
|
|
|
|
|
|
|
|
|
|
public TenantPage(RemoteWebDriver driver) { |
|
|
|
public TenantPage(RemoteWebDriver driver) { |
|
|
|
super(driver); |
|
|
|
super(driver); |
|
|
|
|
|
|
|
|
|
|
|
createTenantForm = new CreateTenantForm(); |
|
|
|
tenantForm = new TenantForm(); |
|
|
|
|
|
|
|
editTenantForm = new TenantForm(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public TenantPage create(String tenant) { |
|
|
|
public TenantPage create(String tenant) { |
|
|
@ -60,9 +65,27 @@ public final class TenantPage extends NavBarPage implements SecurityPage.Tab { |
|
|
|
|
|
|
|
|
|
|
|
public TenantPage create(String tenant, String description) { |
|
|
|
public TenantPage create(String tenant, String description) { |
|
|
|
buttonCreateTenant().click(); |
|
|
|
buttonCreateTenant().click(); |
|
|
|
createTenantForm().inputTenantCode().sendKeys(tenant); |
|
|
|
tenantForm().inputTenantCode().sendKeys(tenant); |
|
|
|
createTenantForm().inputDescription().sendKeys(description); |
|
|
|
tenantForm().inputDescription().sendKeys(description); |
|
|
|
createTenantForm().buttonSubmit().click(); |
|
|
|
tenantForm().buttonSubmit().click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TenantPage update(String tenant, String description) { |
|
|
|
|
|
|
|
tenantList().stream() |
|
|
|
|
|
|
|
.filter(it -> it.findElement(By.className("tenantCode")).getAttribute("innerHTML").contains(tenant)) |
|
|
|
|
|
|
|
.flatMap(it -> it.findElements(By.className("edit")).stream()) |
|
|
|
|
|
|
|
.filter(WebElement::isDisplayed) |
|
|
|
|
|
|
|
.findFirst() |
|
|
|
|
|
|
|
.orElseThrow(() -> new RuntimeException("No edit button in tenant list")) |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TenantForm editTenantForm = new TenantForm(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
editTenantForm.inputDescription().clear(); |
|
|
|
|
|
|
|
editTenantForm.inputDescription().sendKeys(description); |
|
|
|
|
|
|
|
editTenantForm.buttonSubmit().click(); |
|
|
|
|
|
|
|
|
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
@ -83,8 +106,8 @@ public final class TenantPage extends NavBarPage implements SecurityPage.Tab { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Getter |
|
|
|
@Getter |
|
|
|
public class CreateTenantForm { |
|
|
|
public class TenantForm { |
|
|
|
CreateTenantForm() { |
|
|
|
TenantForm() { |
|
|
|
PageFactory.initElements(driver, this); |
|
|
|
PageFactory.initElements(driver, this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|