-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Polymer 2 test module and configure travis to use Chrome for it (#…
- Loading branch information
Showing
17 changed files
with
451 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
hummingbird-test-util/src/main/java/com/vaadin/hummingbird/testutil/SingleBrowserTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2000-2017 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package com.vaadin.hummingbird.testutil; | ||
|
||
import org.junit.Before; | ||
import org.openqa.selenium.chrome.ChromeDriver; | ||
import org.openqa.selenium.firefox.FirefoxDriver; | ||
import org.openqa.selenium.remote.DesiredCapabilities; | ||
|
||
import com.vaadin.testbench.parallel.Browser; | ||
|
||
/** | ||
* Base class for TestBench tests for some dedicated browser which is specified | ||
* via {@link #getBrowser()}. | ||
* <p> | ||
* By default Chrome is used. | ||
* <p> | ||
* It is required to set system property with path to the driver to be able to | ||
* run the test. | ||
* | ||
* @author Vaadin Ltd | ||
* | ||
*/ | ||
public class SingleBrowserTest extends ViewOrUITest { | ||
|
||
/** | ||
* Setup the driver for the active browser. | ||
*/ | ||
@Before | ||
public void setupDriver() { | ||
switch (getBrowser()) { | ||
case FIREFOX: | ||
setDriver(new FirefoxDriver(DesiredCapabilities.firefox())); | ||
break; | ||
case CHROME: | ||
setDriver(new ChromeDriver(DesiredCapabilities.chrome())); | ||
break; | ||
case PHANTOMJS: | ||
setupPhantomJsDriver(); | ||
break; | ||
default: | ||
throw new IllegalStateException( | ||
"Don't know how to execute test with the browser " | ||
+ getBrowser() | ||
+ ". Make a custom driver set up for it."); | ||
} | ||
} | ||
|
||
protected Browser getBrowser() { | ||
return Browser.CHROME; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ | |
"polymer": "1.5.0" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
"author": "", | ||
"license": "Apache-2.0" | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
hummingbird-tests/test-root-context/frontend/v2/bower.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "test-polymer2", | ||
"homepage": "https://github.com/vaadin/hummingbird", | ||
"authors": [ | ||
], | ||
"description": "", | ||
"main": "", | ||
"license": "Apache2", | ||
"private": true, | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"polymer": "Polymer/polymer#2.0-preview" | ||
} | ||
} | ||
|
15 changes: 15 additions & 0 deletions
15
hummingbird-tests/test-root-context/frontend/v2/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "test-polymer2", | ||
"version": "1.0.0", | ||
"description": "This file exists only to define the Bower version", | ||
"main": "", | ||
"dependencies": { | ||
"bower": "^1.8.0" | ||
}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "Apache-2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,119 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>hummingbird-tests</artifactId> | ||
<version>0.0.19-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>hummingbird-test-root-context</artifactId> | ||
<name>Hummingbird root context tests</name> | ||
<packaging>war</packaging> | ||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
<!-- uses default ports 8888 and 8889 --> | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>hummingbird-tests</artifactId> | ||
<version>0.0.19-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>hummingbird-test-root-context</artifactId> | ||
<name>Hummingbird root context tests</name> | ||
<packaging>war</packaging> | ||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
<!-- uses default ports 8888 and 8889 --> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>hummingbird-test-resources</artifactId> | ||
<version>0.0.19-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>hummingbird-test-resources</artifactId> | ||
<version>0.0.19-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<webResources> | ||
<resource> | ||
<!-- this is relative to the pom.xml directory --> | ||
<directory>frontend</directory> | ||
<include>bower_components/**</include> | ||
</resource> | ||
</webResources> | ||
</configuration> | ||
</plugin> | ||
|
||
<!-- This module is mapped to default web context --> | ||
<plugin> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-maven-plugin</artifactId> | ||
<executions> | ||
<!-- start and stop jetty (running our app) when running integration | ||
tests --> | ||
<execution> | ||
<id>start-jetty</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>start</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>stop-jetty</id> | ||
<phase>post-integration-test</phase> | ||
<goals> | ||
<goal>stop</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>frontend-maven-plugin</artifactId> | ||
<version>1.0</version> | ||
<configuration> | ||
<nodeVersion>${node.version}</nodeVersion> | ||
<npmVersion>${npm.version}</npmVersion> | ||
<workingDirectory>frontend</workingDirectory> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>install-node-and-npm</id> | ||
<goals> | ||
<goal>install-node-and-npm</goal> | ||
<goal>npm</goal> <!-- runs 'install' by default --> | ||
<goal>bower</goal> <!-- runs 'install' by default --> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<build> | ||
<plugins> | ||
<!-- This module is mapped to default web context --> | ||
<plugin> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-maven-plugin</artifactId> | ||
<executions> | ||
<!-- start and stop jetty (running our app) when running | ||
integration tests --> | ||
<execution> | ||
<id>start-jetty</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>start</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>stop-jetty</id> | ||
<phase>post-integration-test</phase> | ||
<goals> | ||
<goal>stop</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>frontend-maven-plugin</artifactId> | ||
<version>1.0</version> | ||
<configuration> | ||
<nodeVersion>${node.version}</nodeVersion> | ||
<npmVersion>${npm.version}</npmVersion> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>install-node-and-npm-1</id> | ||
<goals> | ||
<goal>install-node-and-npm</goal> | ||
<goal>npm</goal> <!-- runs 'install' by default --> | ||
<goal>bower</goal> <!-- runs 'install' by default --> | ||
</goals> | ||
<configuration> | ||
<workingDirectory>frontend</workingDirectory> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>install-node-and-npm-2</id> | ||
<goals> | ||
<goal>install-node-and-npm</goal> | ||
<goal>npm</goal> <!-- runs 'install' by default --> | ||
<goal>bower</goal> <!-- runs 'install' by default --> | ||
</goals> | ||
<configuration> | ||
<workingDirectory>frontend/v2</workingDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<webResources> | ||
<resource> | ||
<!-- this is relative to the pom.xml directory --> | ||
<directory>frontend</directory> | ||
<include>bower_components/**</include> | ||
<include>v2/bower_components/**</include> | ||
</resource> | ||
</webResources> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.lazerycode.selenium</groupId> | ||
<artifactId>driver-binary-downloader-maven-plugin</artifactId> | ||
<version>1.0.10</version> | ||
<configuration> | ||
<!-- root directory that downloaded driver binaries will | ||
be stored in --> | ||
<onlyGetDriversForHostOperatingSystem>true</onlyGetDriversForHostOperatingSystem> | ||
<rootStandaloneServerDirectory>driver</rootStandaloneServerDirectory> | ||
<customRepositoryMap>repo.xml</customRepositoryMap> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>selenium</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<root> | ||
<windows> | ||
<driver id="googlechrome"> | ||
<version id="2.27"> | ||
<bitrate thirtytwobit="true" sixtyfourbit="true"> | ||
<filelocation>http://chromedriver.storage.googleapis.com/2.27/chromedriver_win32.zip | ||
</filelocation> | ||
<hash>d9d38707ed22f5549a1b5ed53ad054c2a0a1ada6</hash> | ||
<hashtype>sha1</hashtype> | ||
</bitrate> | ||
</version> | ||
</driver> | ||
</windows> | ||
<linux> | ||
<driver id="googlechrome"> | ||
<version id="2.27"> | ||
<bitrate sixtyfourbit="true"> | ||
<filelocation>http://chromedriver.storage.googleapis.com/2.27/chromedriver_linux64.zip | ||
</filelocation> | ||
<hash>d2d5a41e7bdac88fd031095337fb3e20a812836c</hash> | ||
<hashtype>sha1</hashtype> | ||
</bitrate> | ||
</version> | ||
</driver> | ||
</linux> | ||
<osx> | ||
<driver id="googlechrome"> | ||
<version id="2.27"> | ||
<bitrate thirtytwobit="true" sixtyfourbit="true"> | ||
<filelocation>http://chromedriver.storage.googleapis.com/2.27/chromedriver_mac64.zip | ||
</filelocation> | ||
<hash>3ebf455e5f461c8f7cabb825af40205b53fce58b</hash> | ||
<hashtype>sha1</hashtype> | ||
</bitrate> | ||
</version> | ||
</driver> | ||
</osx> | ||
</root> |
Oops, something went wrong.