You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ElementQueryUITest.java 848B

1234567891011121314151617181920212223242526272829
  1. package com.vaadin.tests.elements;
  2. import java.util.List;
  3. import org.junit.Assert;
  4. import org.junit.Test;
  5. import com.vaadin.testbench.elements.ButtonElement;
  6. import com.vaadin.tests.tb3.MultiBrowserTest;
  7. public class ElementQueryUITest extends MultiBrowserTest {
  8. @Test
  9. public void firstGetAllLast() {
  10. openTestURL();
  11. Assert.assertEquals("Button 0",
  12. $(ButtonElement.class).first().getCaption());
  13. Assert.assertEquals("Button 9",
  14. $(ButtonElement.class).last().getCaption());
  15. List<ButtonElement> all = $(ButtonElement.class).all();
  16. for (int i = 0; i < 10; i++) {
  17. Assert.assertEquals("Button " + i, all.get(i).getCaption());
  18. Assert.assertEquals("Button " + i,
  19. $(ButtonElement.class).get(i).getCaption());
  20. }
  21. }
  22. }