diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2018-06-18 13:28:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-18 13:28:07 +0200 |
commit | 4608a53c7acaeb46f4f6c89c3f81b2b7e6248164 (patch) | |
tree | f03efecb18be7eaf10f89ef587dfa024f422f7cd /uitest | |
parent | b8ed19d5e5597ebb82a4cdd53a941ca4dd06065f (diff) | |
download | vaadin-framework-4608a53c7acaeb46f4f6c89c3f81b2b7e6248164.tar.gz vaadin-framework-4608a53c7acaeb46f4f6c89c3f81b2b7e6248164.zip |
Add ACCEPT attribute to Upload (#10906)
Fixes #2410
Diffstat (limited to 'uitest')
4 files changed, 29 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/ImmediateUpload.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/ImmediateUpload.java index 32602d40ad..f84aeca14c 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/ImmediateUpload.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/ImmediateUpload.java @@ -6,6 +6,8 @@ import com.vaadin.ui.Upload; public class ImmediateUpload extends AbstractTestUI { + public static final String TEST_MIME_TYPE = "image/png"; + /* * (non-Javadoc) * @@ -18,6 +20,7 @@ public class ImmediateUpload extends AbstractTestUI { // by default is in immediate mode (since 8.0) Upload immediateUpload = new Upload(); immediateUpload.setId("immediateupload"); + immediateUpload.setAcceptMimeTypes(TEST_MIME_TYPE); addComponent(immediateUpload); Upload upload = new Upload(); diff --git a/uitest/src/test/java/com/vaadin/tests/resources/FrontendInitialResourceUITest.java b/uitest/src/test/java/com/vaadin/tests/resources/FrontendInitialResourceUITest.java index 7f2748461c..a387b89486 100644 --- a/uitest/src/test/java/com/vaadin/tests/resources/FrontendInitialResourceUITest.java +++ b/uitest/src/test/java/com/vaadin/tests/resources/FrontendInitialResourceUITest.java @@ -1,15 +1,24 @@ package com.vaadin.tests.resources; +import java.util.List; + import static org.junit.Assert.assertEquals; import org.junit.Test; import org.openqa.selenium.By; +import org.openqa.selenium.remote.DesiredCapabilities; +import com.vaadin.testbench.parallel.Browser; import com.vaadin.testbench.parallel.BrowserUtil; import com.vaadin.tests.tb3.MultiBrowserTest; public class FrontendInitialResourceUITest extends MultiBrowserTest { + @Override + protected List<DesiredCapabilities> getBrowserCapabilities(Browser... browsers) { + return getBrowsersExcludingPhantomJS(); + } + @Test public void correctEs5Es6FileImportedThroughFrontend() { openTestURL(); diff --git a/uitest/src/test/java/com/vaadin/tests/resources/FrontendLaterLoadedResourceUITest.java b/uitest/src/test/java/com/vaadin/tests/resources/FrontendLaterLoadedResourceUITest.java index f2e1583f15..2f3223317f 100644 --- a/uitest/src/test/java/com/vaadin/tests/resources/FrontendLaterLoadedResourceUITest.java +++ b/uitest/src/test/java/com/vaadin/tests/resources/FrontendLaterLoadedResourceUITest.java @@ -1,16 +1,25 @@ package com.vaadin.tests.resources; +import java.util.List; + import static org.junit.Assert.assertEquals; import org.junit.Test; import org.openqa.selenium.By; +import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.parallel.Browser; import com.vaadin.testbench.parallel.BrowserUtil; import com.vaadin.tests.tb3.MultiBrowserTest; public class FrontendLaterLoadedResourceUITest extends MultiBrowserTest { + @Override + protected List<DesiredCapabilities> getBrowserCapabilities(Browser... browsers) { + return getBrowsersExcludingPhantomJS(); + } + @Test public void correctEs5Es6FileImportedThroughFrontend() { openTestURL(); diff --git a/uitest/src/test/java/com/vaadin/tests/themes/valo/ImmediateUploadTest.java b/uitest/src/test/java/com/vaadin/tests/themes/valo/ImmediateUploadTest.java index f97b8e9b09..511c1a430c 100644 --- a/uitest/src/test/java/com/vaadin/tests/themes/valo/ImmediateUploadTest.java +++ b/uitest/src/test/java/com/vaadin/tests/themes/valo/ImmediateUploadTest.java @@ -1,5 +1,6 @@ package com.vaadin.tests.themes.valo; +import static com.vaadin.tests.themes.valo.ImmediateUpload.TEST_MIME_TYPE; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; @@ -74,4 +75,11 @@ public class ImmediateUploadTest extends MultiBrowserTest { // don't show the upload window, not at least in firefox. assertThat(input.getCssValue("z-index"), is("-1")); } + + @Test + public void testAcceptAttribute() + { + WebElement input = getUploadFileInput("immediateupload"); + assertThat(input.getAttribute("accept"),is(TEST_MIME_TYPE)); + } } |