-
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.
test: Test reusable custom theme with embedded application (#9831)
Add a reusable theme module for embedded tests. Add module to test using reusable theme from dependency with embedded application. Fixes: #9828 # Conflicts: # flow-tests/test-embedding/pom.xml
- Loading branch information
Showing
19 changed files
with
615 additions
and
2 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
66 changes: 66 additions & 0 deletions
66
flow-tests/test-embedding/embedding-reusable-custom-theme/pom.xml
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2000-2021 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. | ||
--> | ||
|
||
<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"> | ||
<parent> | ||
<artifactId>test-embedding</artifactId> | ||
<groupId>com.vaadin</groupId> | ||
<version>2.6-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>flow-reusable-embedded-theme</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Reusable custom theme for Flow Embedding test</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-server</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<configuration> | ||
<skipITs>true</skipITs> | ||
</configuration> | ||
</plugin> | ||
|
||
<!-- Export the test-jar so it can be used by other modules --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<finalName>${project.artifactId}</finalName> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>test-jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
9 changes: 9 additions & 0 deletions
9
...ng/embedding-reusable-custom-theme/src/main/java/com/vaadin/reusabletheme/Dependency.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,9 @@ | ||
|
||
package com.vaadin.reusabletheme; | ||
|
||
import com.vaadin.flow.component.dependency.NpmPackage; | ||
|
||
@NpmPackage(value = "@fortawesome/fontawesome-free", version = "5.15.1") | ||
public class Dependency { | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
...ain/resources/META-INF/resources/themes/reusable-theme/components/vaadin-radio-button.css
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,3 @@ | ||
[part='radio'] { | ||
background-color: red; | ||
} |
3 changes: 3 additions & 0 deletions
3
.../main/resources/META-INF/resources/themes/reusable-theme/components/vaadin-text-field.css
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,3 @@ | ||
[part="input-field"] { | ||
background: red; | ||
} |
8 changes: 8 additions & 0 deletions
8
...ble-custom-theme/src/main/resources/META-INF/resources/themes/reusable-theme/document.css
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,8 @@ | ||
@font-face { | ||
font-family: "Ostrich"; | ||
src: url("./font/ostrich-sans-regular.ttf") format("TrueType"); | ||
} | ||
|
||
.global { | ||
color: blue; | ||
} |
Binary file added
BIN
+17.6 KB
...src/main/resources/META-INF/resources/themes/reusable-theme/font/ostrich-sans-regular.ttf
Binary file not shown.
Binary file added
BIN
+280 KB
...om-theme/src/main/resources/META-INF/resources/themes/reusable-theme/img/bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions
11
...sable-custom-theme/src/main/resources/META-INF/resources/themes/reusable-theme/styles.css
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,11 @@ | ||
:host { | ||
width: 1200px; | ||
height: 600px; | ||
display: block; | ||
background-image: url("./img/bg.jpg"); | ||
font-family: "Ostrich"; | ||
} | ||
|
||
.internal { | ||
color: green; | ||
} |
8 changes: 8 additions & 0 deletions
8
...sable-custom-theme/src/main/resources/META-INF/resources/themes/reusable-theme/theme.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,8 @@ | ||
{ | ||
"documentCss": ["@fortawesome/fontawesome-free/css/all.css"], | ||
"assets": { | ||
"@fortawesome/fontawesome-free": { | ||
"svgs/regular/**": "fortawesome/icons" | ||
} | ||
} | ||
} |
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
122 changes: 122 additions & 0 deletions
122
flow-tests/test-embedding/test-embedding-reusable-theme/pom.xml
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,122 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2000-2019 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. | ||
--> | ||
|
||
<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"> | ||
<parent> | ||
<artifactId>test-embedding</artifactId> | ||
<groupId>com.vaadin</groupId> | ||
<version>2.6-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>test-embedding-reusable-theme</artifactId> | ||
<packaging>war</packaging> | ||
<name>Flow Embedding resuable application theme tests</name> | ||
|
||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>vaadin-lumo-theme</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-html-components-testbench</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-reusable-embedded-theme</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<!-- This module is mapped to default web context --> | ||
<plugin> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-maven-plugin</artifactId> | ||
<version>${jetty.version}</version> | ||
<!-- do not allow faulty app shell annotations for module --> | ||
<!-- This should be removed when flow-tests do not break app shell annotation--> | ||
<!-- flow-tests should not allow faulty annotations --> | ||
<configuration> | ||
<systemProperties> | ||
<systemProperty> | ||
<name>vaadin.allow.appshell.annotations</name> | ||
<value>false</value> | ||
</systemProperty> | ||
</systemProperties> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>prepare-frontend</goal> | ||
<goal>build-frontend</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>local-run</id> | ||
<activation> | ||
<property> | ||
<name>!test.use.hub</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.lazerycode.selenium</groupId> | ||
<artifactId>driver-binary-downloader-maven-plugin</artifactId> | ||
<version>${driver.binary.downloader.maven.plugin.version}</version> | ||
<configuration> | ||
<onlyGetDriversForHostOperatingSystem>true</onlyGetDriversForHostOperatingSystem> | ||
<rootStandaloneServerDirectory>${project.rootdir}/driver</rootStandaloneServerDirectory> | ||
<downloadedZipFileDirectory>${project.rootdir}/driver_zips</downloadedZipFileDirectory> | ||
<customRepositoryMap>${project.rootdir}/drivers.xml</customRepositoryMap> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>selenium</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
42 changes: 42 additions & 0 deletions
42
.../test-embedding-reusable-theme/src/main/java/com/vaadin/flow/webcomponent/MyLitField.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,42 @@ | ||
/* | ||
* Copyright 2000-2020 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.flow.webcomponent; | ||
|
||
import com.vaadin.flow.component.Component; | ||
import com.vaadin.flow.component.Tag; | ||
import com.vaadin.flow.component.dependency.JsModule; | ||
import com.vaadin.flow.component.dependency.NpmPackage; | ||
|
||
/** | ||
* LIT version of vaadin radio button for testing component theming. | ||
*/ | ||
@JsModule("@vaadin/vaadin-radio-button/vaadin-radio-button.js") | ||
@Tag("vaadin-radio-button") | ||
@NpmPackage(value = "@vaadin/vaadin-radio-button", version = "2.0.0-alpha1") | ||
public class MyLitField extends Component { | ||
|
||
/** | ||
* Set the component id. | ||
* | ||
* @param id | ||
* value to set | ||
* @return this component | ||
*/ | ||
public Component withId(String id) { | ||
setId(id); | ||
return this; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...t-embedding-reusable-theme/src/main/java/com/vaadin/flow/webcomponent/MyPolymerField.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,42 @@ | ||
/* | ||
* Copyright 2000-2020 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.flow.webcomponent; | ||
|
||
import com.vaadin.flow.component.Component; | ||
import com.vaadin.flow.component.Tag; | ||
import com.vaadin.flow.component.dependency.JsModule; | ||
import com.vaadin.flow.component.dependency.NpmPackage; | ||
|
||
/** | ||
* Polymer version of vaadin text field for testing component theming. | ||
*/ | ||
@JsModule("@vaadin/vaadin-text-field/vaadin-text-field.js") | ||
@Tag("vaadin-text-field") | ||
@NpmPackage(value="@vaadin/vaadin-text-field", version = "2.7.1") | ||
public class MyPolymerField extends Component { | ||
|
||
/** | ||
* Set the component id. | ||
* | ||
* @param id | ||
* value to set | ||
* @return this component | ||
*/ | ||
public Component withId(String id) { | ||
setId(id); | ||
return this; | ||
} | ||
} |
Oops, something went wrong.