本文整理汇总了Java中com.vaadin.testbench.elements.ButtonElement类的典型用法代码示例。如果您正苦于以下问题:Java ButtonElement类的具体用法?Java ButtonElement怎么用?Java ButtonElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ButtonElement类属于com.vaadin.testbench.elements包,在下文中一共展示了ButtonElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: removeColumnButton
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
@Test
/**
* Regression Test for
* Issue #26: After removing one ComponentRenderer column the other renderer stop working
*
* https://github.com/datenhahn/componentrenderer/issues/26
*/
public void removeColumnButton() throws InterruptedException, IOException {
//String expectedFirefox = "<div style=\"\" class=\"cr-component-cell\"><div style=\"width: 30px; height: 24px;\" class=\"v-label v-widget v-has-width v-has-height\"><span class=\"v-icon\" style=\"font-family: FontAwesome;\">.*</span></div></div>";
String expectedChrome = "<div class=\"cr-component-cell\"><div class=\"v-label v-widget v-has-width "
+ "v-has-height\" style=\"width: 30px; height: 24px;\"><span class=\"v-icon\" "
+ "style=\"font-family: FontAwesome;\">.*</span></div></div>";
setupChromiumDriver();
getDriver().get("http://localhost:8080/testbench");
assertTrue($(GridElement.class).first().getCell(0,6).getAttribute("innerHTML").matches(expectedChrome));
$(ButtonElement.class).id("removeColumnButton").click();
assertTrue($(GridElement.class).first().getCell(0,6).getAttribute("innerHTML").matches(expectedChrome));
}
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:21,代码来源:RemoveColumnIT.java
示例2: conv
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
static Function<Class<? extends AbstractComponent>, Optional<Class<? extends AbstractElement>>> conv() {
return (componentClass) -> {
final Predicate<Class<? extends AbstractComponent>> is = componentClass::isAssignableFrom;
if (is.test(Button.class)) return Optional.of(ButtonElement.class);
if (is.test(TextField.class)) return Optional.of(TextFieldElement.class);
return Optional.empty();
};
}
开发者ID:Java-Publications,项目名称:vaadin-016-helloworld-14,代码行数:11,代码来源:TestbenchFunctions.java
示例3: test001
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
@DisplayName("Login positive")
@Test
void test001(@PageObject LoginUIPageObject pageObject) {
pageObject.loadPage();
pageObject.login.get().setValue("root");
pageObject.password.get().setValue("secret");
pageObject.buttonOK.get().click();
// Assert if new layout is loaded
// the Caption "Dashboard" is not refactoring safe
ButtonElement dashboard = pageObject.btn().id(buttonID().apply(MenuComponent.class, "Dashboard"));
Assert.assertNotNull(dashboard);
}
开发者ID:Java-Publications,项目名称:vaadin-016-helloworld-14,代码行数:16,代码来源:LoginUITest.java
示例4: openDashboardView
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public TBDashboardView openDashboardView() {
ButtonElement dashboard = getDashboardMenu().$(ButtonElement.class).caption("Dashboard").first();
// TODO: This hack shouldn't be needed
new WebDriverWait(driver, 2).until(ExpectedConditions
.elementToBeClickable(dashboard));
dashboard.click();
return new TBDashboardView(driver);
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:11,代码来源:TBMainView.java
示例5: openTransactionsView
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public TBTransactionsView openTransactionsView() {
ButtonElement transactions = getDashboardMenu().$(ButtonElement.class).caption("Transactions").first();
// TODO: This hack shouldn't be needed
new WebDriverWait(driver, 2).until(ExpectedConditions
.elementToBeClickable(transactions));
transactions.click();
return new TBTransactionsView(driver);
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:11,代码来源:TBMainView.java
示例6: openReportsView
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public TBReportsView openReportsView() {
ButtonElement reports = getDashboardMenu().$(ButtonElement.class).caption("Reports").first();
// TODO: This hack shouldn't be needed
new WebDriverWait(driver, 2).until(ExpectedConditions
.elementToBeClickable(reports));
reports.click();
return new TBReportsView(driver);
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:11,代码来源:TBMainView.java
示例7: getUnreadNotificationsCount
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public int getUnreadNotificationsCount() {
int result = 0;
String caption = $(ButtonElement.class).id(DashboardView.NotificationsButton.ID)
.getCaption();
if (caption != null && !caption.isEmpty()) {
result = Integer.parseInt(caption);
}
return result;
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:10,代码来源:TBDashboardView.java
示例8: testClickButton
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
@Test
public void testClickButton() throws Exception {
openTestUrl();
// At first there should be no labels
assertFalse($(LabelElement.class).exists());
// Click the button
ButtonElement clickMeButton = $(ButtonElement.class).
caption("Click Me").first();
clickMeButton.click();
// There should now be one label
assertEquals(1, $(LabelElement.class).all().size());
// ... with the specified text
assertEquals("Thank you for clicking",
$(LabelElement.class).first().getText());
// Click the button again
clickMeButton.click();
// There should now be two labels
List<LabelElement> allLabels = $(LabelElement.class).all();
assertEquals(2, allLabels.size());
// ... and the last label should have the correct text
LabelElement lastLabel = allLabels.get(1);
assertEquals("Thank you for clicking", lastLabel.getText());
}
开发者ID:jmarranz,项目名称:relproxy_examples,代码行数:29,代码来源:Relproxy_ex_vaadinTest.java
示例9: btn
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public WithID<ButtonElement> btn() {
return (id) -> $(ButtonElement.class).id(id);
}
开发者ID:Java-Publications,项目名称:vaadin-016-helloworld-14,代码行数:4,代码来源:AbstractVaadinPageObject.java
示例10: registerPatientAtRegistrationKiosk
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
private void registerPatientAtRegistrationKiosk(String patientName) {
$(TextFieldElement.class).first().setValue(patientName);
$(ButtonElement.class).get(3).click();
}
开发者ID:mrts,项目名称:vaadin-javaee-clinic-patient-queue-example,代码行数:5,代码来源:ClinicPatientQueueAppIT.java
示例11: callPatientInAtDoctorsOffice
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
private void callPatientInAtDoctorsOffice() {
$(GridElement.class).first().getRow(0).click();
$(ButtonElement.class).caption("Call in").first().click();
}
开发者ID:mrts,项目名称:vaadin-javaee-clinic-patient-queue-example,代码行数:5,代码来源:ClinicPatientQueueAppIT.java
示例12: loginToDoctorsOffice
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
private void loginToDoctorsOffice(String username, String password) {
$(TextFieldElement.class).get(0).setValue(username);
$(TextFieldElement.class).get(1).setValue(password);
$(ButtonElement.class).first().click();
}
开发者ID:mrts,项目名称:vaadin-javaee-clinic-patient-queue-example,代码行数:6,代码来源:ClinicPatientQueueAppIT.java
示例13: commit
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public void commit() {
scope.$(ButtonElement.class).caption("OK").first().click();
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:4,代码来源:TBProfileWindow.java
示例14: getLoginButton
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
private ElementQuery<ButtonElement> getLoginButton() {
return $(ButtonElement.class).caption("Sign In");
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:4,代码来源:TBLoginView.java
示例15: createEmptyReport
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public void createEmptyReport() {
$(ButtonElement.class).caption("Create New").first().click();
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:4,代码来源:TBReportsView.java
示例16: discard
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public void discard() {
$(ButtonElement.class).caption("Discard Changes").first().click();
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:4,代码来源:TBConfirmDialog.java
示例17: save
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public void save() {
scope.$(ButtonElement.class).caption("Save").first().click();
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:4,代码来源:TBTextBlock.java
示例18: openDashboardEdit
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public TBDashboardEdit openDashboardEdit() {
$(ButtonElement.class).id(DashboardView.EDIT_ID).click();
return new TBDashboardEdit(driver);
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:5,代码来源:TBDashboardView.java
示例19: openNotifications
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
public void openNotifications() {
$(ButtonElement.class).id(DashboardView.NotificationsButton.ID).click();
}
开发者ID:imotSpot,项目名称:imotSpot,代码行数:4,代码来源:TBDashboardView.java
示例20: test1New
import com.vaadin.testbench.elements.ButtonElement; //导入依赖的package包/类
@Test
public void test1New() throws InterruptedException {
$(ButtonElement.class).caption("Caractéristiques").first().click();
crudPO = PageFactory.initElements(getDriver(), CrudPageObject.class);
assertTrue(isElementPresent(By.id("filterText")));
assertTrue(isElementPresent(By.id("clearFilterButton")));
assertTrue(isElementPresent(By.id("crudAddButton")));
GridElement crudGrid = $(GridElement.class).id("crudGrid");
assertTrue(crudGrid.isDisplayed());
crudPO.clickAdd();
assertTrue($(TextFieldElement.class).caption("Nom").exists());
assertTrue($(TextFieldElement.class).caption("Abbréviation").exists());
assertTrue($(TextAreaElement.class).caption("Description").exists());
assertFalse($(ButtonElement.class).id("crudSaveButton").isEnabled());
assertFalse($(ButtonElement.class).id("crudResetButton").isEnabled());
assertTrue($(ButtonElement.class).id("crudCancelButton").isEnabled());
assertTrue($(ButtonElement.class).id("crudDeleteButton").isEnabled());
TextFieldElement nameTextField = $(TextFieldElement.class).caption("Nom").first();
nameTextField.setValue(name);
TextFieldElement abbreviationTextField = $(TextFieldElement.class).caption("Abbréviation").first();
abbreviationTextField.setValue("TI");
TextAreaElement descriptionTextArea = $(TextAreaElement.class).caption("Description").first();
descriptionTextArea.setValue("Testing new ability");
assertTrue($(ButtonElement.class).id("crudSaveButton").isEnabled());
assertTrue($(ButtonElement.class).id("crudResetButton").isEnabled());
assertTrue($(ButtonElement.class).id("crudCancelButton").isEnabled());
assertTrue($(ButtonElement.class).id("crudDeleteButton").isEnabled());
crudPO.clickSave();
assertTrue(crudGrid.isDisplayed());
GridRowElement newRow = crudGrid.getRow((int) (crudGrid.getRowCount() - 1));
assertEquals(name, newRow.getCell(0).getText());
assertEquals("TI", newRow.getCell(1).getText());
}
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:45,代码来源:CrudIT.java
注:本文中的com.vaadin.testbench.elements.ButtonElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论