Skip to content

Commit

Permalink
Merge fc42e5c into 23c6f52
Browse files Browse the repository at this point in the history
  • Loading branch information
Phan-ThanhDat committed Apr 2, 2020
2 parents 23c6f52 + fc42e5c commit 661584c
Show file tree
Hide file tree
Showing 28 changed files with 439 additions and 423 deletions.
12 changes: 3 additions & 9 deletions .gemini.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
rootUrl: http://localhost:8080/components/vaadin-progress-bar/test/visual/
rootUrl: http://localhost:8080/test/visual/
gridUrl: http://localhost:4444/wd/hub
screenshotsDir: ./test/visual/screens

system:
plugins:
polyserve:
esm:
port: 8080
sauce: true

browsers:
chrome:
desiredCapabilities:
browserName: "chrome"
version: "67.0"
platform: "Windows 10"

firefox:
desiredCapabilities:
browserName: "firefox"
version: "47.0"
version: "69.0"
platform: "Windows 10"
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ addons:

script:
- if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
npm run test:sauce;
npm run test:sauce && npm run test:visual;
else
npm run check:version &&
npm run lint &&
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"gemini": "gemini update test/visual",
"lint": "npm-run-all --parallel lint:*",
"lint:css": "stylelint src/*.ts theme/**/*.ts test/*.ts",
"lint:js": "eslint src test --ext .ts --ignore-path .gitignore",
"lint:js": "eslint src theme test --ext .ts --ignore-path .gitignore",
"lint:lit": "lit-analyzer src --strict",
"prestart": "npm run analyze",
"prepublishOnly": "npm run build",
Expand Down
54 changes: 29 additions & 25 deletions test/visual/default.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Progress bar default tests</title>
</head>

<body>

<span id="default-tests">
<vaadin-progress-bar value="0.1">
</vaadin-progress-bar>
</span>

<script type="module">
(async() => {
const progressBar = document.querySelector('vaadin-progress-bar');
const theme = window.location.search.replace(/.*theme=(\w+).*/, '$1') || 'lumo';

await import('../../theme/' + theme + '/vaadin-progress-bar.js');

await progressBar.updateComplete;

window.requestAnimationFrame(() => {
window.webComponentsAreReady = true;
});
})();
</script>
</body>
</html>

<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="../../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<script>
const theme = window.location.search.replace(/.*theme=(\w+).*/, '$1') || 'lumo';
document.write(`<link rel="import" href="../../theme/${theme}/vaadin-progress-bar.html">`);

window.addEventListener('WebComponentsReady', function() {
customElements.whenDefined('vaadin-progress-bar').then(function() {
window.ShadyDOM && window.ShadyDOM.flush(); // Force DOM composition
window.webComponentsAreReady = true; // Checked in gemini before capture callback
});
});
</script>
</head>

<body>

<span id="default-tests">
<vaadin-progress-bar value="0.1">
</vaadin-progress-bar>
</span>

</body>
38 changes: 38 additions & 0 deletions test/visual/lumo-variants.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Progress bar lumo-variants tests</title>

</head>

<body>

<span id="variants">
<vaadin-progress-bar value="0.1" theme="contrast">
</vaadin-progress-bar>
<vaadin-progress-bar value="1" theme="sucess">
</vaadin-progress-bar>
<vaadin-progress-bar value="0.1" theme="error">
</vaadin-progress-bar>
</span>


<script type="module">
import '../../theme/lumo/vaadin-progress-bar.js';

(async() => {
(async() => {
const progressBar = document.querySelector('vaadin-progress-bar');

await progressBar.updateComplete;

window.requestAnimationFrame(() => {
window.webComponentsAreReady = true;
});
})();
})();
</script>

</body>
</html>
28 changes: 0 additions & 28 deletions test/visual/rtl.html

This file was deleted.

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.
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 18 additions & 24 deletions test/visual/test.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
gemini.suite('vaadin-progress-bar', function(rootSuite) {
gemini.suite('vaadin-progress-bar', rootSuite => {
function wait(actions, find) {
return actions
.waitForJSCondition(function(window) {
return window.webComponentsAreReady;
}, 80000);
return actions.waitForJSCondition(window => {
return window.webComponentsAreReady;
}, 80000);
}

function goToAboutBlank(actions, find) {
// Firefox stops responding on socket after a test, workaround:
return actions.executeJS(function(window) {
window.location.href = 'about:blank'; // just go away, please!
});
}

rootSuite
.before(wait)
.after(goToAboutBlank);
rootSuite.before(wait);

['lumo', 'material'].forEach(theme => {
gemini.suite(`default-tests-${theme}`, function(suite) {
gemini.suite(`default-tests-${theme}`, suite => {
suite
.setUrl(`default.html?theme=${theme}`)
.setCaptureElements('#default-tests')
.capture('vaadin-progress-bar');
});

gemini.suite(`default-rtl-${theme}`, function(suite) {
suite
.setUrl(`rtl.html?theme=${theme}`)
.setCaptureElements('#rtl-tests')
.capture('vaadin-progress-bar');
.capture('default')
.capture('rtl', actions => {
actions.executeJS(window => {
window.document.documentElement.setAttribute('dir', 'rtl');
});
});
});
});

gemini.suite('lumo-variants', suite => {
suite
.setUrl('lumo-variants.html')
.setCaptureElements('#variants')
.capture('variants');
});
});

0 comments on commit 661584c

Please sign in to comment.