disconnectProxy(); | disconnectProxy(); | ||||
helloButton.click(); | helloButton.click(); | ||||
testBench().disableWaitForVaadin(); | testBench().disableWaitForVaadin(); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
boolean present = isElementPresent(reconnectDialogBy); | |||||
return present; | |||||
} | |||||
}); | |||||
waitUntil(driver -> isElementPresent(reconnectDialogBy)); | |||||
WebElement dialog = findElement(reconnectDialogBy); | WebElement dialog = findElement(reconnectDialogBy); | ||||
WebElement spinner = dialog.findElement(By.className("spinner")); | WebElement spinner = dialog.findElement(By.className("spinner")); |
package com.vaadin.tests.components; | package com.vaadin.tests.components; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.elements.ProgressBarElement; | |||||
import com.vaadin.testbench.elements.ButtonElement; | import com.vaadin.testbench.elements.ButtonElement; | ||||
import com.vaadin.testbench.elements.ProgressBarElement; | |||||
import com.vaadin.tests.tb3.SingleBrowserTest; | import com.vaadin.tests.tb3.SingleBrowserTest; | ||||
public class NoLayoutUpdateWhichNeedsLayoutTest extends SingleBrowserTest { | public class NoLayoutUpdateWhichNeedsLayoutTest extends SingleBrowserTest { | ||||
ButtonElement open = $(ButtonElement.class).id("openWindow"); | ButtonElement open = $(ButtonElement.class).id("openWindow"); | ||||
open.click(); | open.click(); | ||||
final ProgressBarElement progress = $(ProgressBarElement.class).first(); | final ProgressBarElement progress = $(ProgressBarElement.class).first(); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
double p = progress.getValue(); | |||||
return Math.abs(p - 0.5) < 0.01; | |||||
} | |||||
waitUntil(driver -> { | |||||
double p = progress.getValue(); | |||||
return Math.abs(p - 0.5) < 0.01; | |||||
}); | }); | ||||
ButtonElement close = $(ButtonElement.class).id("closeWindow"); | ButtonElement close = $(ButtonElement.class).id("closeWindow"); |
import org.junit.Before; | import org.junit.Before; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.WebElement; | import org.openqa.selenium.WebElement; | ||||
import org.openqa.selenium.interactions.Actions; | import org.openqa.selenium.interactions.Actions; | ||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.By; | import com.vaadin.testbench.By; | ||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
assertTrue(isPagingActive()); | assertTrue(isPagingActive()); | ||||
goToNextPage(); | goToNextPage(); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
List<WebElement> filteredItems = getFilteredItems(popup); | |||||
return filteredItems.size() == 1 | |||||
&& "Item 129".equals(filteredItems.get(0).getText()); | |||||
} | |||||
waitUntil(input -> { | |||||
List<WebElement> items = getFilteredItems(popup); | |||||
return items.size() == 1 | |||||
&& "Item 129".equals(items.get(0).getText()); | |||||
}); | }); | ||||
} | } | ||||
WebElement loadingIndicator = findElement( | WebElement loadingIndicator = findElement( | ||||
By.className("v-loading-indicator")); | By.className("v-loading-indicator")); | ||||
Pattern pattern = Pattern.compile("display: *none;"); | Pattern pattern = Pattern.compile("display: *none;"); | ||||
waitUntil(driver -> { | |||||
return pattern.matcher(loadingIndicator.getAttribute("style")) | |||||
.find(); | |||||
}); | |||||
waitUntil(driver -> pattern | |||||
.matcher(loadingIndicator.getAttribute("style")).find()); | |||||
compareScreen("dateFieldStates"); | compareScreen("dateFieldStates"); | ||||
} | } |
WebElement loadingIndicator = findElement( | WebElement loadingIndicator = findElement( | ||||
By.className("v-loading-indicator")); | By.className("v-loading-indicator")); | ||||
Pattern pattern = Pattern.compile("display: *none;"); | Pattern pattern = Pattern.compile("display: *none;"); | ||||
waitUntil(driver -> { | |||||
return pattern.matcher(loadingIndicator.getAttribute("style")) | |||||
.find(); | |||||
}); | |||||
waitUntil(driver -> pattern | |||||
.matcher(loadingIndicator.getAttribute("style")).find()); | |||||
compareScreen("dateFieldStates"); | compareScreen("dateFieldStates"); | ||||
} | } |
WebElement loadingIndicator = findElement( | WebElement loadingIndicator = findElement( | ||||
By.className("v-loading-indicator")); | By.className("v-loading-indicator")); | ||||
Pattern pattern = Pattern.compile("display: *none;"); | Pattern pattern = Pattern.compile("display: *none;"); | ||||
waitUntil(driver -> { | |||||
return pattern.matcher(loadingIndicator.getAttribute("style")) | |||||
.find(); | |||||
}); | |||||
waitUntil(driver -> pattern | |||||
.matcher(loadingIndicator.getAttribute("style")).find()); | |||||
compareScreen("grid-v8-initialRender"); | compareScreen("grid-v8-initialRender"); | ||||
} | } | ||||
import static org.junit.Assert.assertTrue; | import static org.junit.Assert.assertTrue; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.WebElement; | import org.openqa.selenium.WebElement; | ||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.By; | import com.vaadin.testbench.By; | ||||
import com.vaadin.testbench.TestBenchElement; | import com.vaadin.testbench.TestBenchElement; | ||||
$(ButtonElement.class).first().click(); | $(ButtonElement.class).first().click(); | ||||
final TestBenchElement gridBody = grid.getBody(); | final TestBenchElement gridBody = grid.getBody(); | ||||
// Can't use element API because it scrolls | // Can't use element API because it scrolls | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return gridBody.findElements(By.className("v-grid-row")) | |||||
.size() == 1; | |||||
} | |||||
}); | |||||
waitUntil(input -> gridBody.findElements(By.className("v-grid-row")) | |||||
.size() == 1); | |||||
WebElement cell = gridBody.findElements(By.className("v-grid-cell")) | WebElement cell = gridBody.findElements(By.className("v-grid-cell")) | ||||
.get(0); | .get(0); | ||||
assertEquals("Test", cell.getText()); | assertEquals("Test", cell.getText()); |
package com.vaadin.tests.components.layout; | package com.vaadin.tests.components.layout; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.WebElement; | import org.openqa.selenium.WebElement; | ||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
final WebElement expandedElement = vaadinElementById("expandedElement"); | final WebElement expandedElement = vaadinElementById("expandedElement"); | ||||
final WebElement containerElement = vaadinElementById("container"); | final WebElement containerElement = vaadinElementById("container"); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
int expandedElementBottom = expandedElement.getLocation().getY() | |||||
+ expandedElement.getSize().getHeight(); | |||||
int containerElementBottom = containerElement.getLocation() | |||||
.getY() + containerElement.getSize().getHeight(); | |||||
waitUntil(input -> { | |||||
int expandedElementBottom = expandedElement.getLocation().getY() | |||||
+ expandedElement.getSize().getHeight(); | |||||
int containerElementBottom = containerElement.getLocation().getY() | |||||
+ containerElement.getSize().getHeight(); | |||||
return expandedElementBottom + 1 == containerElementBottom; | |||||
} | |||||
return expandedElementBottom + 1 == containerElementBottom; | |||||
}); | }); | ||||
} | } | ||||
} | } |
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.By; | import org.openqa.selenium.By; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.interactions.Actions; | import org.openqa.selenium.interactions.Actions; | ||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
assertTrue("No notification found", hasNotification()); | assertTrue("No notification found", hasNotification()); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
waitUntil(input -> { | |||||
new Actions(getDriver()).moveByOffset(10, 10).perform(); | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
new Actions(getDriver()).moveByOffset(10, 10).perform(); | |||||
return !hasNotification(); | |||||
} | |||||
return !hasNotification(); | |||||
}); | }); | ||||
} | } | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.By; | import org.openqa.selenium.By; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.interactions.Actions; | import org.openqa.selenium.interactions.Actions; | ||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.TestBenchElement; | import com.vaadin.testbench.TestBenchElement; | ||||
import com.vaadin.testbench.elements.TableElement; | import com.vaadin.testbench.elements.TableElement; | ||||
private void closeWindow() { | private void closeWindow() { | ||||
WindowElement window = $(WindowElement.class).first(); | WindowElement window = $(WindowElement.class).first(); | ||||
window.findElement(By.className("v-window-closebox")).click(); | window.findElement(By.className("v-window-closebox")).click(); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver driver) { | |||||
return findElements(By.className("v-window")).isEmpty(); | |||||
} | |||||
}); | |||||
waitUntil(input -> findElements(By.className("v-window")).isEmpty()); | |||||
} | } | ||||
} | } |
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.By; | import org.openqa.selenium.By; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.WebElement; | import org.openqa.selenium.WebElement; | ||||
import org.openqa.selenium.interactions.Actions; | import org.openqa.selenium.interactions.Actions; | ||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.elements.TableElement; | |||||
import com.vaadin.testbench.elements.ButtonElement; | import com.vaadin.testbench.elements.ButtonElement; | ||||
import com.vaadin.testbench.elements.TableElement; | |||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
/** | /** | ||||
} | } | ||||
private void waitUntilTextFieldWidthIs(final int width) { | private void waitUntilTextFieldWidthIs(final int width) { | ||||
waitUntil(new ExpectedCondition<Object>() { | |||||
@Override | |||||
public Object apply(WebDriver input) { | |||||
return getTextFieldWidth() == width; | |||||
} | |||||
}); | |||||
waitUntil(input -> getTextFieldWidth() == width); | |||||
} | } | ||||
private int getTextFieldWidth() { | private int getTextFieldWidth() { |
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.Dimension; | import org.openqa.selenium.Dimension; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.interactions.Actions; | import org.openqa.selenium.interactions.Actions; | ||||
import org.openqa.selenium.remote.DesiredCapabilities; | import org.openqa.selenium.remote.DesiredCapabilities; | ||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.elements.ButtonElement; | import com.vaadin.testbench.elements.ButtonElement; | ||||
import com.vaadin.testbench.elements.LabelElement; | import com.vaadin.testbench.elements.LabelElement; | ||||
private void waitUntilPollingOccurs() { | private void waitUntilPollingOccurs() { | ||||
final String timestamp = getPollTimestamp(); | final String timestamp = getPollTimestamp(); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return !timestamp.equals(getPollTimestamp()); | |||||
} | |||||
}); | |||||
waitUntil(input -> !timestamp.equals(getPollTimestamp())); | |||||
} | } | ||||
private String getPollTimestamp() { | private String getPollTimestamp() { |
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.elements.TreeGridElement; | import com.vaadin.testbench.elements.TreeGridElement; | ||||
import com.vaadin.tests.tb3.SingleBrowserTestPhantomJS2; | import com.vaadin.tests.tb3.SingleBrowserTestPhantomJS2; | ||||
} | } | ||||
private void waitUntilRowCountEquals(int expectedCount) { | private void waitUntilRowCountEquals(int expectedCount) { | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return grid.getRowCount() == expectedCount; | |||||
} | |||||
}); | |||||
waitUntil(input -> grid.getRowCount() == expectedCount); | |||||
} | } | ||||
} | } |
import java.net.URI; | import java.net.URI; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.By; | import com.vaadin.testbench.By; | ||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
private void assertUri(String uri) { | private void assertUri(String uri) { | ||||
final String expectedText = "Current Location: " + uri; | final String expectedText = "Current Location: " + uri; | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return expectedText.equals(getLocationLabelValue()); | |||||
} | |||||
}); | |||||
waitUntil(input -> expectedText.equals(getLocationLabelValue())); | |||||
assertEquals(uri, driver.getCurrentUrl()); | assertEquals(uri, driver.getCurrentUrl()); | ||||
} | } |
import static org.junit.Assert.assertTrue; | import static org.junit.Assert.assertTrue; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.elements.ButtonElement; | import com.vaadin.testbench.elements.ButtonElement; | ||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
} | } | ||||
private void waitForLogToContainText(final String text) { | private void waitForLogToContainText(final String text) { | ||||
waitUntil(new ExpectedCondition<Object>() { | |||||
@Override | |||||
public Object apply(WebDriver input) { | |||||
return logContainsText(text); | |||||
} | |||||
}); | |||||
waitUntil(input -> logContainsText(text)); | |||||
} | } | ||||
@Test | @Test |
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.JavascriptExecutor; | import org.openqa.selenium.JavascriptExecutor; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.By; | import com.vaadin.testbench.By; | ||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
private void assertFragment(String fragment) { | private void assertFragment(String fragment) { | ||||
final String expectedText = "Current URI fragment: " + fragment; | final String expectedText = "Current URI fragment: " + fragment; | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return expectedText.equals(getFragmentLabelValue()); | |||||
} | |||||
}); | |||||
waitUntil(input -> expectedText.equals(getFragmentLabelValue())); | |||||
} | } | ||||
private void navigateToEmptyFragment() { | private void navigateToEmptyFragment() { |
package com.vaadin.tests.extensions; | package com.vaadin.tests.extensions; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.By; | import com.vaadin.testbench.By; | ||||
import com.vaadin.testbench.elements.PanelElement; | import com.vaadin.testbench.elements.PanelElement; | ||||
// Resize below 600px width breakpoint | // Resize below 600px width breakpoint | ||||
testBench().resizeViewPortTo(400, 768); | testBench().resizeViewPortTo(400, 768); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return panelElement.getSize().getWidth() < 500; | |||||
} | |||||
}); | |||||
waitUntil(input -> panelElement.getSize().getWidth() < 500); | |||||
compareScreen("small"); | compareScreen("small"); | ||||
} | } | ||||
} | } |
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.WebElement; | import org.openqa.selenium.WebElement; | ||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.elements.NativeSelectElement; | import com.vaadin.testbench.elements.NativeSelectElement; | ||||
import com.vaadin.testbench.parallel.TestCategory; | import com.vaadin.testbench.parallel.TestCategory; | ||||
protected void waitForServerCounterToUpdate() { | protected void waitForServerCounterToUpdate() { | ||||
int counter = getServerCounter(); | int counter = getServerCounter(); | ||||
final int waitCounter = counter + 2; | final int waitCounter = counter + 2; | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return (getServerCounter() >= waitCounter); | |||||
} | |||||
}); | |||||
waitUntil(input -> getServerCounter() >= waitCounter); | |||||
} | } | ||||
} | } |
package com.vaadin.tests.push; | package com.vaadin.tests.push; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.parallel.TestCategory; | import com.vaadin.testbench.parallel.TestCategory; | ||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
public void testPushFromInit() { | public void testPushFromInit() { | ||||
openTestURL(); | openTestURL(); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return ("3. " + PushFromInit.LOG_AFTER_INIT) | |||||
.equals(getLogRow(0)); | |||||
} | |||||
}); | |||||
waitUntil(input -> ("3. " + PushFromInit.LOG_AFTER_INIT) | |||||
.equals(getLogRow(0))); | |||||
} | } | ||||
} | } |
} | } | ||||
protected void waitForElementNotPresent(final By by) { | protected void waitForElementNotPresent(final By by) { | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return input.findElements(by).isEmpty(); | |||||
} | |||||
}); | |||||
waitUntil(input -> input.findElements(by).isEmpty()); | |||||
} | } | ||||
protected void waitForElementVisible(final By by) { | protected void waitForElementVisible(final By by) { |
import java.util.List; | import java.util.List; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.remote.DesiredCapabilities; | import org.openqa.selenium.remote.DesiredCapabilities; | ||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
private void assertFragment(String fragment) { | private void assertFragment(String fragment) { | ||||
final String expectedText = fragment; | final String expectedText = fragment; | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
String currentURL = getDriver().getCurrentUrl(); | |||||
String currentURIFragment = ""; | |||||
if (currentURL.contains("#") && !currentURL.endsWith("#")) { | |||||
currentURIFragment = currentURL.split("#")[1]; | |||||
} | |||||
return expectedText.equals(currentURIFragment); | |||||
waitUntil(input -> { | |||||
String currentURL = getDriver().getCurrentUrl(); | |||||
String currentURIFragment = ""; | |||||
if (currentURL.contains("#") && !currentURL.endsWith("#")) { | |||||
currentURIFragment = currentURL.split("#")[1]; | |||||
} | } | ||||
return expectedText.equals(currentURIFragment); | |||||
}); | }); | ||||
} | } | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.By; | import org.openqa.selenium.By; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.tests.tb3.MultiBrowserTest; | import com.vaadin.tests.tb3.MultiBrowserTest; | ||||
import com.vaadin.tests.widgetset.client.csrf.CsrfButtonConnector; | import com.vaadin.tests.widgetset.client.csrf.CsrfButtonConnector; | ||||
getDriver().findElement(By.id(CsrfTokenDisabled.PRESS_ID)).click(); | getDriver().findElement(By.id(CsrfTokenDisabled.PRESS_ID)).click(); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
waitUntil(input -> { | |||||
getDriver().findElement(debugButton).click(); | |||||
String debugMessage2 = input.findElement(debugButton).getText(); | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
getDriver().findElement(debugButton).click(); | |||||
String debugMessage2 = input.findElement(debugButton).getText(); | |||||
LOGGER.log(Level.INFO, "1: " + debugMessage1); | |||||
LOGGER.log(Level.INFO, "2: " + debugMessage2); | |||||
LOGGER.log(Level.INFO, "1: " + debugMessage1); | |||||
LOGGER.log(Level.INFO, "2: " + debugMessage2); | |||||
if (!debugMessage1.equals(debugMessage2)) { | |||||
if (!debugMessage1.equals(debugMessage2)) { | |||||
compareMessage(split(debugMessage1), split(debugMessage2)); | |||||
compareMessage(split(debugMessage1), split(debugMessage2)); | |||||
LOGGER.log(Level.INFO, "DONE"); | |||||
LOGGER.log(Level.INFO, "DONE"); | |||||
return true; | |||||
} else { | |||||
return false; | |||||
} | |||||
return true; | |||||
} else { | |||||
return false; | |||||
} | } | ||||
}); | }); | ||||
} | } |
import static org.hamcrest.MatcherAssert.assertThat; | import static org.hamcrest.MatcherAssert.assertThat; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openqa.selenium.WebDriver; | |||||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||||
import com.vaadin.testbench.By; | import com.vaadin.testbench.By; | ||||
import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicClientFeaturesTest; | import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicClientFeaturesTest; | ||||
private void toggleSideBarMenuAndDisable() { | private void toggleSideBarMenuAndDisable() { | ||||
selectMenuPath("Component", "Sidebar", "Open sidebar and disable grid"); | selectMenuPath("Component", "Sidebar", "Open sidebar and disable grid"); | ||||
waitUntil(new ExpectedCondition<Boolean>() { | |||||
@Override | |||||
public Boolean apply(WebDriver input) { | |||||
return !findElement(By.className("v-grid-sidebar-button")) | |||||
.isEnabled(); | |||||
} | |||||
}); | |||||
waitUntil(input -> !findElement(By.className("v-grid-sidebar-button")) | |||||
.isEnabled()); | |||||
} | } | ||||
private void clickSideBarButton() { | private void clickSideBarButton() { |