Skip to content

Commit

Permalink
Added visual tests for Material theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
sohrabtaee committed Aug 23, 2018
1 parent 3d91b18 commit 2c3fca0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ node_modules
package-lock.json
yarn.lock
coverage
analysis.json
9 changes: 6 additions & 3 deletions test/visual/default.html
Expand Up @@ -4,13 +4,16 @@
<meta charset="UTF-8">
<title></title>
<script src="../../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link href="../../vaadin-radio-button.html" rel="import">
<link href="../../vaadin-radio-group.html" rel="import">
<script>
const theme = window.location.search.replace(/.*theme=(\w+).*/, '$1') || 'lumo';
document.write(`<link rel="import" href="../../theme/${theme}/vaadin-radio-button.html">`);
document.write(`<link rel="import" href="../../theme/${theme}/vaadin-radio-group.html">`);
</script>
</head>

<body>

<div id="default-tests" style="padding: 6px">
<div id="default-tests" style="padding: 6px;">
<vaadin-radio-group label="Foo">
<vaadin-radio-button checked>1</vaadin-radio-button>
<vaadin-radio-button disabled>2</vaadin-radio-button>
Expand Down
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.
13 changes: 7 additions & 6 deletions test/visual/test.js
Expand Up @@ -13,12 +13,13 @@ gemini.suite('vaadin-radio-button', function(rootSuite) {
rootSuite
.before(wait)
.after(goToAboutBlank);

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

});

0 comments on commit 2c3fca0

Please sign in to comment.