Skip to content

Commit

Permalink
Update platform (#744)
Browse files Browse the repository at this point in the history
* Update to stable platform

* Fix failing tests

Workaround for issue reported in vaadin/vaadin-crud-flow#78
  • Loading branch information
alvarezguille authored Mar 5, 2019
1 parent d015469 commit b049c8b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 35 deletions.
18 changes: 1 addition & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Dependencies -->
<vaadin.version>13.0.0.beta2</vaadin.version>
<vaadin.version>13.0.0</vaadin.version>

<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Overrides the old version specified by the Spring Boot parent -->
Expand Down Expand Up @@ -59,24 +59,8 @@
<enabled>false</enabled>
</snapshots>
</repository>

<repository>
<id>vaadin-prereleases</id>
<url>https://maven.vaadin.com/vaadin-prereleases/</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>https://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
</pluginRepositories>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.Keys;
import org.openqa.selenium.support.ui.ExpectedCondition;

import com.vaadin.flow.component.grid.testbench.GridElement;
Expand Down Expand Up @@ -33,15 +34,21 @@ public void editProductTwice() {

Assert.assertTrue(productsPage.isEditorOpen());
String newValue = "New " + uniqueName;
productsPage.getProductName().setValue(newValue);
TextFieldElement nameField = productsPage.getProductName();
nameField.setValue("");
nameField.sendKeys(newValue, Keys.TAB);

productsPage.getEditorSaveButton().click();
Assert.assertFalse(productsPage.isEditorOpen());
GridElement grid = productsPage.getGrid();
Assert.assertEquals(rowNum, grid.getCell(newValue).getRow());

productsPage.openRowForEditing(rowNum);
newValue = "The " + newValue;
productsPage.getProductName().setValue(newValue);
nameField = productsPage.getProductName();
nameField.setValue("");
nameField.sendKeys(newValue, Keys.TAB);

productsPage.getEditorSaveButton().click();
Assert.assertFalse(productsPage.isEditorOpen());
Assert.assertEquals(rowNum, grid.getCell(newValue).getRow());
Expand All @@ -65,8 +72,8 @@ public void editProduct() {
TextFieldElement price = productsPage.getPrice();
Assert.assertEquals(initialPrice, price.getValue());

price.focus();
price.setValue("123.45");
price.setValue("");
price.sendKeys("123.45", Keys.TAB);

productsPage.getEditorSaveButton().click();

Expand All @@ -80,8 +87,8 @@ public void editProduct() {
Assert.assertEquals("123.45", price.getValue());

// Return initial value
price.focus();
price.setValue(initialPrice);
price.setValue("");
price.sendKeys(initialPrice, Keys.TAB);

productsPage.getEditorSaveButton().click();
Assert.assertFalse(productsPage.isEditorOpen());
Expand Down Expand Up @@ -110,11 +117,9 @@ private int createProduct(ProductsViewElement productsPage, String name, String
TextFieldElement nameField = productsPage.getProductName();
TextFieldElement priceField = productsPage.getPrice();

nameField.focus();
nameField.setValue(name);

priceField.focus();
priceField.setValue(price);
priceField.sendKeys(price, Keys.TAB);

productsPage.getEditorSaveButton().click();
Assert.assertFalse(productsPage.isEditorOpen());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public void updatePassword() {
// Saving any field without changing password should save and close
TextFieldElement emailField = usersView.getEmailField();
String newEmail = "foo" + r.nextInt() + "@bar.com";
emailField.setValue(newEmail);
emailField.setValue("");
emailField.sendKeys(newEmail, Keys.TAB);

usersView.getEditorSaveButton().click();
Assert.assertFalse(usersView.isEditorOpen());
Expand All @@ -71,9 +72,7 @@ public void updatePassword() {
password = usersView.getPasswordField(); // Requery password field.

// Good password
password.focus();
password.setValue("Abc123");
password.sendKeys(Keys.TAB);
password.sendKeys("Abc123", Keys.TAB);
usersView.getEditorSaveButton().click();
Assert.assertFalse(usersView.isEditorOpen());

Expand All @@ -96,11 +95,7 @@ private void createUser(
usersView.getLastName().setValue(lastName);
usersView.getPasswordField().setValue(password);

// TODO: Fix combo selection as soon as API updated
// https://github.com/vaadin/vaadin-components-testbench/issues/60
usersView.getRole().openPopup();
usersView.getRole().setFilter(role);
usersView.getRole().sendKeys(Keys.ENTER);
usersView.getRole().selectByText(role);

usersView.getEditorSaveButton().click();
Assert.assertFalse(usersView.isEditorOpen());
Expand Down

0 comments on commit b049c8b

Please sign in to comment.