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.

MultiBrowserThemeTest.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2000-2014 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.tb3;
  17. import java.util.Arrays;
  18. import java.util.Collection;
  19. import java.util.HashSet;
  20. import java.util.List;
  21. import java.util.Set;
  22. import org.junit.runner.RunWith;
  23. import org.junit.runners.Parameterized.Parameters;
  24. import org.openqa.selenium.remote.DesiredCapabilities;
  25. import com.vaadin.tests.integration.ParameterizedTB3Runner;
  26. /**
  27. * Test which uses theme returned by {@link #getTheme()} for running the test
  28. */
  29. @RunWith(ParameterizedTB3Runner.class)
  30. public abstract class MultiBrowserThemeTest extends MultiBrowserTest {
  31. private String theme;
  32. public void setTheme(String theme) {
  33. this.theme = theme;
  34. }
  35. @Parameters
  36. public static Collection<String> getThemes() {
  37. return Arrays.asList(new String[] { "valo", "reindeer", "runo",
  38. "chameleon", "base" });
  39. }
  40. @Override
  41. protected boolean requireWindowFocusForIE() {
  42. return true;
  43. }
  44. @Override
  45. protected void openTestURL(Class<?> uiClass, String... parameters) {
  46. Set<String> params = new HashSet<String>(Arrays.asList(parameters));
  47. params.add("theme=" + theme);
  48. super.openTestURL(uiClass, params.toArray(new String[params.size()]));
  49. }
  50. @Override
  51. public List<DesiredCapabilities> getBrowsersToTest() {
  52. List<DesiredCapabilities> browsersToTest = getBrowsersExcludingPhantomJS();
  53. browsersToTest.add(PHANTOMJS2());
  54. return browsersToTest;
  55. }
  56. }