Skip to content

Commit

Permalink
chore: Update browsers for ITs (#1320)
Browse files Browse the repository at this point in the history
Update browsers in AbstractIT
Simplify browser factory
Update screenshot references
Update gitignore
  • Loading branch information
alvarezguille authored Feb 10, 2022
1 parent 00c65b5 commit 0ec6660
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 80 deletions.
49 changes: 31 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
.DS_Store
# /
.classpath
.project
.settings
*.project
*.settings
**/bin
**/target
**/error-screenshots

# Mac
*.DS_Store

# Intellij Idea files
.idea
*.iml
*/target/
vaadin-testbench-standalone/dependency-reduced-pom.xml
vaadin-testbench-recorder/selenium-extensions/core/user-extensions.js
vaadin-testbench-recorder/chrome/content/selenium/scripts/selenium-api.js
vaadin-testbench-recorder/chrome/content/selenium/scripts/selenium-browserbot.js
vaadin-testbench-recorder/chrome/testbench-recorder.jar
vaadin-testbench-recorder/extension/
vaadin-testbench-recorder/install.rdf
vaadin-testbench-playground
vaadin-testbench-integration-tests/error-screenshots/
vaadin-testbench-integration-tests/config/testbench.properties
chromedriver.log
phantomjsdriver.log
error-screenshots/
test/temp/

# VS Code
.vscode

# Selenium driver folders
selenium_standalone_zips
driver_zips
driver

types.d.ts
tsconfig.json
webpack.*
node_modules
.driver
package*json
pnpm*
error-screenshots
.npmrc

**/frontend/generated
**/frontend/index.html
31 changes: 0 additions & 31 deletions vaadin-testbench-integration-tests/.gitignore

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public abstract class AbstractTB6Test extends ParallelTest {

@BrowserConfiguration
public List<DesiredCapabilities> getBrowserConfiguration() {
return Arrays.asList(BrowserUtil.ie11(), BrowserUtil.firefox(),
return Arrays.asList(BrowserUtil.firefox(),
BrowserUtil.chrome(), BrowserUtil.safari(), BrowserUtil.edge());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
*/
package com.vaadin.tests;

import java.util.HashMap;
import java.util.Map;

import org.openqa.selenium.Platform;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxDriver.Capability;
import org.openqa.selenium.remote.DesiredCapabilities;

import com.vaadin.testbench.parallel.Browser;
Expand All @@ -31,25 +28,14 @@
*/
public class TB6TestBrowserFactory extends DefaultBrowserFactory {

private static Map<Browser, String> defaultBrowserVersion = new HashMap<>();
static {
defaultBrowserVersion.put(Browser.CHROME, "");
defaultBrowserVersion.put(Browser.SAFARI, "11");
defaultBrowserVersion.put(Browser.IE11, "11");
defaultBrowserVersion.put(Browser.FIREFOX, "");
}

@Override
public DesiredCapabilities create(Browser browser, String version,
Platform platform) {
DesiredCapabilities desiredCapabilities = super.create(browser,
version, platform);

if ("".equals(version) && defaultBrowserVersion.containsKey(browser)) {
desiredCapabilities.setVersion(defaultBrowserVersion.get(browser));
}
if(browser.equals(Browser.FIREFOX)) {
desiredCapabilities.setCapability(FirefoxDriver.MARIONETTE, false);
desiredCapabilities.setCapability(Capability.MARIONETTE, false);
}
desiredCapabilities.setCapability("screenResolution", "1600x1200");
return desiredCapabilities;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
package com.vaadin.tests.elements;

import java.util.ArrayList;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;

import com.vaadin.testUI.ElementQueryView;
import com.vaadin.testbench.TestBenchElement;
import com.vaadin.testbench.parallel.BrowserUtil;
import com.vaadin.tests.AbstractTB6Test;

public class ElementScreenCompareIT extends AbstractTB6Test {
Expand All @@ -20,15 +15,6 @@ protected Class<ElementQueryView> getTestView() {
return ElementQueryView.class;
}

@Override
public List<DesiredCapabilities> getBrowserConfiguration() {
List<DesiredCapabilities> browsers = new ArrayList<>(
super.getBrowserConfiguration());
// Resize viewport does not work in Safari
browsers.remove(BrowserUtil.safari());
return browsers;
}

@Override
public void setup() throws Exception {
super.setup();
Expand Down

0 comments on commit 0ec6660

Please sign in to comment.