Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove vaadin-uitest-common dependency from server tests (#8551)
Uses custom reference and error files in test project.
- Loading branch information
1 parent
21544c9
commit a2d3155
Showing
17 changed files
with
350 additions
and
402 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
Binary file added
BIN
+11.3 KB
test/servlet-containers/generic/reference-screenshots/finland-phantomjs.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.5 KB
test/servlet-containers/generic/reference-screenshots/initial-phantomjs.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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: 3 additions & 63 deletions
66
...rs/generic/src/test/java/com/vaadin/tests/integration/AbstractServletIntegrationTest.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,81 +1,21 @@ | |||
/* | |||
* Copyright 2000-2016 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.tests.integration; | package com.vaadin.tests.integration; | ||
|
|
||
import java.io.IOException; | |||
import java.util.ArrayList; | |||
import java.util.Collection; | |||
import java.util.Collections; | |||
|
|||
import org.junit.Test; | import org.junit.Test; | ||
import org.junit.runner.RunWith; | |||
import org.junit.runners.Parameterized.Parameters; | |||
|
|
||
import com.vaadin.testbench.elements.TableElement; | import com.vaadin.testbench.elements.TableElement; | ||
import com.vaadin.tests.tb3.ParameterizedTB3Runner; | |||
|
|
||
/** | |||
* Base class for servlet integration tests. Automatically prepends "/demo" to | |||
* the deployment path | |||
* | |||
* @author Vaadin Ltd | |||
*/ | |||
@RunWith(ParameterizedTB3Runner.class) | |||
public abstract class AbstractServletIntegrationTest | public abstract class AbstractServletIntegrationTest | ||
extends AbstractIntegrationTest { | extends AbstractIntegrationTest { | ||
|
|
||
private String contextPath = "/demo"; | |||
|
|||
@Test | @Test | ||
public void runTest() throws IOException, AssertionError { | public void runTest() throws Exception { | ||
openTestURL(); | |||
// make sure no fading progress indicator from table update is lingering | // make sure no fading progress indicator from table update is lingering | ||
sleep(2000); | Thread.sleep(2000); | ||
compareScreen("initial"); | compareScreen("initial"); | ||
$(TableElement.class).first().getCell(0, 1).click(); | $(TableElement.class).first().getCell(0, 1).click(); | ||
// without this, table fetch might have a fading progress indicator | // without this, table fetch might have a fading progress indicator | ||
sleep(2000); | Thread.sleep(2000); | ||
compareScreen("finland"); | compareScreen("finland"); | ||
} | } | ||
|
|
||
@Override | |||
protected String getDeploymentPath(Class<?> uiClass) { | |||
return contextPath + super.getDeploymentPath(uiClass); | |||
} | |||
|
|||
public void setContextPath(String contextPath) { | |||
this.contextPath = contextPath; | |||
} | |||
|
|||
@Parameters | |||
public static Collection<String> getContextPaths() { | |||
if (getServerName().equals("wildfly9-nginx")) { | |||
ArrayList<String> paths = new ArrayList<>(); | |||
paths.add("/buffering/demo"); | |||
paths.add("/nonbuffering/demo"); | |||
paths.add("/buffering-timeout/demo"); | |||
paths.add("/nonbuffering-timeout/demo"); | |||
return paths; | |||
} else { | |||
return Collections.emptyList(); | |||
} | |||
} | |||
|
|||
protected static String getServerName() { | |||
return System.getProperty("server-name"); | |||
} | |||
|
|||
} | } |
21 changes: 21 additions & 0 deletions
21
...t-containers/generic/src/test/java/com/vaadin/tests/integration/CustomBrowserFactory.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
package com.vaadin.tests.integration; | |||
|
|||
import org.openqa.selenium.remote.DesiredCapabilities; | |||
|
|||
import com.vaadin.testbench.parallel.Browser; | |||
import com.vaadin.testbench.parallel.BrowserUtil; | |||
import com.vaadin.testbench.parallel.DefaultBrowserFactory; | |||
|
|||
public class CustomBrowserFactory extends DefaultBrowserFactory { | |||
|
|||
@Override | |||
public DesiredCapabilities create(Browser browser) { | |||
DesiredCapabilities capabilities = super.create(browser); | |||
if (BrowserUtil.isPhantomJS(capabilities)) { | |||
capabilities.setVersion("2"); | |||
capabilities.setCapability("phantomjs.binary.path", | |||
"/usr/bin/phantomjs2"); | |||
} | |||
return capabilities; | |||
} | |||
} |
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
Oops, something went wrong.