Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few tests for IE11 #4317

Merged
merged 5 commits into from
Jun 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.openqa.selenium.WebElement;

import com.vaadin.flow.testutil.ChromeBrowserTest;
import com.vaadin.testbench.TestBenchElement;

public abstract class AbstractAttachExistingElementByIdIT
extends ChromeBrowserTest {
Expand All @@ -39,7 +40,8 @@ protected void assertTemplate(String id, String initialLabelText,
Assert.assertEquals("Text from input Harley!", getLabel(id).getText());

// Reset values to defaults
getInShadowRoot(findElement(By.id(id)), By.id("button")).click();
$(TestBenchElement.class).id(id).$(TestBenchElement.class).id("button")
.click();

Assert.assertEquals("default", getLabel(id).getText());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.openqa.selenium.logging.LogEntry;

import com.vaadin.flow.testutil.ChromeBrowserTest;
import com.vaadin.testbench.parallel.BrowserUtil;

public class WebComponentsIT extends ChromeBrowserTest {

Expand All @@ -37,6 +38,11 @@ public void testPolyfillLoaded() {
.anyMatch(element -> element.getAttribute("src")
.endsWith("webcomponents-loader.js")));

if (BrowserUtil.isIE(getDesiredCapabilities())) {
// Console logs are not available from IE11
return;
}

LogEntries logs = driver.manage().logs().get("browser");
if (logs != null) {
Optional<LogEntry> anyError = StreamSupport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected void assertTemplate(String id, String initialLabelText,
Assert.assertEquals(placeholder, input.getAttribute("placeholder"));

input.sendKeys("Harley!");
input.sendKeys(Keys.ENTER);
input.sendKeys(Keys.TAB);

Assert.assertEquals("Text from input Harley!", getLabel(id).getText());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;

import com.vaadin.flow.testutil.ChromeBrowserTest;
Expand All @@ -31,12 +32,13 @@ public void paperInputIsFunctional() {

WebElement input = findElement(By.tagName("paper-input"));
String originalValue = input.getAttribute("value");
input.sendKeys("bar");
input.sendKeys(Keys.END + "bar");

List<WebElement> updateValueElements = findElements(
By.className("update-value"));
WebElement lastUpdateValue = updateValueElements
.get(updateValueElements.size() - 1);
org.junit.Assert.assertEquals(originalValue + "bar", lastUpdateValue.getText());
org.junit.Assert.assertEquals(originalValue + "bar",
lastUpdateValue.getText());
}
}