Browse Source

first gemini test works

gemini
Alexander Wunschik 7 years ago
parent
commit
471b54b0de
20 changed files with 120 additions and 537 deletions
  1. +6
    -2
      .gemini.js
  2. +1
    -0
      .gitignore
  3. BIN
      gemini/reports/images/yandex-icons/plain/PhantomJS~current.png
  4. BIN
      gemini/reports/images/yandex-icons/plain/PhantomJS~ref.png
  5. BIN
      gemini/reports/images/yandex-search/plain/PhantomJS~ref.png
  6. BIN
      gemini/reports/images/yandex-search/with text/PhantomJS~ref.png
  7. +0
    -221
      gemini/reports/index.html
  8. +0
    -286
      gemini/reports/report.css
  9. +0
    -2
      gemini/reports/report.min.js
  10. BIN
      gemini/screens/yandex-icons/plain/PhantomJS.png
  11. BIN
      gemini/screens/yandex-search/plain/PhantomJS.png
  12. BIN
      gemini/screens/yandex-search/with text/PhantomJS.png
  13. +38
    -12
      gulpfile.js
  14. +4
    -1
      package.json
  15. +0
    -8
      test/gemini/demo1.js
  16. +0
    -5
      test/gemini/demo2.js
  17. +18
    -0
      test/gemini/gemini.config.js
  18. BIN
      test/gemini/screens/timline/BasicExample/plain/PhantomJS.png
  19. +45
    -0
      test/gemini/tests/timeline/BasicExample/index.html
  20. +8
    -0
      test/gemini/tests/timeline/BasicExample/test.js

+ 6
- 2
.gemini.js View File

@ -1,5 +1,9 @@
var geminiConfig = require('./test/gemini/gemini.config.js');
module.exports = {
rootUrl: "http://yandex.com",
rootUrl: 'http://localhost' + ':' + geminiConfig.webserver.port,
screenshotsDir: geminiConfig.gemini.screens,
browsers: {
PhantomJS: {
@ -13,7 +17,7 @@ module.exports = {
plugins: {
'html-reporter': {
enabled: true,
path: 'gemini/reports'
path: geminiConfig.gemini.reports
}
}
}

+ 1
- 0
.gitignore View File

@ -16,3 +16,4 @@ npm-debug.log
# temporary files
.*.sw[op]
.commits.tmp
test/gemini/reports/

BIN
gemini/reports/images/yandex-icons/plain/PhantomJS~current.png View File

Before After
Width: 1366  |  Height: 768  |  Size: 19 KiB

BIN
gemini/reports/images/yandex-icons/plain/PhantomJS~ref.png View File

Before After
Width: 760  |  Height: 82  |  Size: 11 KiB

BIN
gemini/reports/images/yandex-search/plain/PhantomJS~ref.png View File

Before After
Width: 900  |  Height: 106  |  Size: 5.8 KiB

BIN
gemini/reports/images/yandex-search/with text/PhantomJS~ref.png View File

Before After
Width: 900  |  Height: 106  |  Size: 7.3 KiB

+ 0
- 221
gemini/reports/index.html View File

@ -1,221 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Gemini report</title>
<link rel="stylesheet" type="text/css" href="report.css">
</head>
<body class="report">
<dl class="summary">
<dt class="summary__key">Total Tests</dt><dd class="summary__value">3</dd>
<dt class="summary__key">Passed</dt><dd class="summary__value">2</dd>
<dt class="summary__key summary__key_has-fails">Failed</dt><dd class="summary__value">1</dd>
<dt class="summary__key">Skipped</dt><dd class="summary__value">0</dd>
<dt class="summary__key">Retries</dt><dd class="summary__value">0</dd>
</dl>
<button id="expandAll" class="button">Expand all</button>
<button id="collapseAll" class="button">Collapse all</button>
<button id="expandErrors" class="button">Expand errors</button>
<button id="showSkipped" class="button">Show skipped</button>
<button id="showRetries" class="button">Expand retries</button>
<button id="showOnlyDiff" class="button">Show only diff</button>
<input id="viewHostInput" class="text-input" size="40" placeholder="change original host for view in browser"/>
<div id="skippedList" class="skipped__list collapsed">
There are no skipped tests
</div>
<div class="section section_status_success ">
<div class="section__title">
yandex-search
<button
class="button section__icon section__icon_copy-to-clipboard"
title="copy to clipboard"
data-clipboard-text="yandex-search">
</button>
</div>
<div class="section__body section__body_guided">
<div class="section section_status_success ">
<div class="section__title">
plain
<button
class="button section__icon section__icon_copy-to-clipboard"
title="copy to clipboard"
data-clipboard-text="yandex-search,plain">
</button>
</div>
<div class="section__body section__body_guided">
<div class="section section_collapsed section_status_success ">
<div class="section__title">
PhantomJS
<a
class="button section__icon section__icon_view-local"
data-suite-view-link="http://yandex.com/" href="http://yandex.com/"
title="view in browser"
target="_blank">
</a>
</div>
<div class="section__body">
<div class="image-box ">
<div class="cswitcher">
<button data-id="1" class="state-button cswitcher__item cswitcher_color_1 cswitcher__item_selected">&nbsp;</button>
<button data-id="2" class="state-button cswitcher__item cswitcher_color_2">&nbsp;</button>
<button data-id="3" class="state-button cswitcher__item cswitcher_color_3">&nbsp;</button>
</div>
<div class="tab">
<div class="tab__item tab__item_active" data-position="0">
<div class="meta-info meta-info_collapsed">
<div class="meta-info__switcher">Meta-info</div>
<div class="meta-info__content">
<pre>{
&quot;url&quot;: &quot;/&quot;,
&quot;file&quot;: &quot;test/gemini/demo1.js&quot;,
&quot;sessionId&quot;: &quot;20cafe60-5a4f-11e7-8dde-e99d1aa2245a&quot;
}</pre>
</div>
</div>
<div class="image-box__image">
<img data-src="images/yandex-search/plain/PhantomJS~ref.png">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="section section_status_success ">
<div class="section__title">
with text
<button
class="button section__icon section__icon_copy-to-clipboard"
title="copy to clipboard"
data-clipboard-text="yandex-search,with text">
</button>
</div>
<div class="section__body section__body_guided">
<div class="section section_collapsed section_status_success ">
<div class="section__title">
PhantomJS
<a
class="button section__icon section__icon_view-local"
data-suite-view-link="http://yandex.com/" href="http://yandex.com/"
title="view in browser"
target="_blank">
</a>
</div>
<div class="section__body">
<div class="image-box ">
<div class="cswitcher">
<button data-id="1" class="state-button cswitcher__item cswitcher_color_1 cswitcher__item_selected">&nbsp;</button>
<button data-id="2" class="state-button cswitcher__item cswitcher_color_2">&nbsp;</button>
<button data-id="3" class="state-button cswitcher__item cswitcher_color_3">&nbsp;</button>
</div>
<div class="tab">
<div class="tab__item tab__item_active" data-position="0">
<div class="meta-info meta-info_collapsed">
<div class="meta-info__switcher">Meta-info</div>
<div class="meta-info__content">
<pre>{
&quot;url&quot;: &quot;/&quot;,
&quot;file&quot;: &quot;test/gemini/demo1.js&quot;,
&quot;sessionId&quot;: &quot;20cafe60-5a4f-11e7-8dde-e99d1aa2245a&quot;
}</pre>
</div>
</div>
<div class="image-box__image">
<img data-src="images/yandex-search/with%20text/PhantomJS~ref.png">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="section section_status_fail ">
<div class="section__title">
yandex-icons
<button
class="button section__icon section__icon_copy-to-clipboard"
title="copy to clipboard"
data-clipboard-text="yandex-icons">
</button>
</div>
<div class="section__body section__body_guided">
<div class="section section_status_fail ">
<div class="section__title">
plain
<button
class="button section__icon section__icon_copy-to-clipboard"
title="copy to clipboard"
data-clipboard-text="yandex-icons,plain">
</button>
</div>
<div class="section__body section__body_guided">
<div class="section section_collapsed section_status_fail ">
<div class="section__title">
PhantomJS
<a
class="button section__icon section__icon_view-local"
data-suite-view-link="http://yandex.com/foo" href="http://yandex.com/foo"
title="view in browser"
target="_blank">
</a>
</div>
<div class="section__body">
<div class="image-box image-box_error">
<div class="cswitcher">
<button data-id="1" class="state-button cswitcher__item cswitcher_color_1 cswitcher__item_selected">&nbsp;</button>
<button data-id="2" class="state-button cswitcher__item cswitcher_color_2">&nbsp;</button>
<button data-id="3" class="state-button cswitcher__item cswitcher_color_3">&nbsp;</button>
</div>
<div class="tab">
<div class="tab__item tab__item_active" data-position="0">
<div class="meta-info meta-info_collapsed">
<div class="meta-info__switcher">Meta-info</div>
<div class="meta-info__content">
<pre>{
&quot;url&quot;: &quot;/foo&quot;,
&quot;file&quot;: &quot;test/gemini/demo2.js&quot;,
&quot;sessionId&quot;: &quot;20cafe60-5a4f-11e7-8dde-e99d1aa2245a&quot;
}</pre>
</div>
</div>
<div class="image-box__image">
<pre class="reason">Error
at /home/delphin/workspaces/workspace_vis/vis/node_modules/gemini/lib/browser/client-bridge.js:42:39
at tryCatcher (/home/delphin/workspaces/workspace_vis/vis/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/delphin/workspaces/workspace_vis/vis/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/delphin/workspaces/workspace_vis/vis/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/delphin/workspaces/workspace_vis/vis/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/delphin/workspaces/workspace_vis/vis/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/home/delphin/workspaces/workspace_vis/vis/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/home/delphin/workspaces/workspace_vis/vis/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/home/delphin/workspaces/workspace_vis/vis/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)</pre>
<img data-src="images/yandex-icons/plain/PhantomJS~current.png">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="report.min.js"></script>
</body>
</html>

+ 0
- 286
gemini/reports/report.css View File

@ -1,286 +0,0 @@
.report {
font: 14px Helvetica Neue, Arial, sans-serif;
}
.summary__key {
font-weight: bold;
display: inline;
}
.summary__key::after {
content: ':';
}
.summary__key_has-fails {
color: #c00;
}
.summary__value {
margin-left: 5px;
margin-right: 20px;
display: inline;
}
.button {
background: #fff;
border: 1px solid #ccc;
border-radius: 2px;
outline: 0;
}
.button:hover {
border-color: #555;
}
.button.pressed,
.button:active {
background: #eee;
}
.button_checked {
background: #ffeba0;
border-color: #cebe7d;
}
.image-box {
padding: 5px;
border: 1px solid #ccc;
background: #c9c9c9;
}
.image-box__exp-with-act {
display: inline-block;
}
.report_show-only-diff .image-box__exp-with-act {
display: none;
}
.image-box__image {
padding: 0 5px;
display: inline-block;
vertical-align: top;
}
.section__title {
font-weight: bold;
cursor: pointer;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.section__title_skipped {
color: #ccc;
cursor: default;
-moz-user-select: text;
-webkit-user-select: text;
-ms-user-select: text;
user-select: text;
}
.section__title:before, .meta-info__switcher:before {
display: inline-block;
margin-right: 2px;
vertical-align: middle;
content: '\25bc';
color: black;
}
.section_status_success > .section__title {
color: #038035;
}
.section_status_fail > .section__title {
color: #c00;
}
.section_status_skip > .section__title,
.section_status_skip > .section__title:hover {
color: #ccc;
cursor: default;
}
.section_status_skip > .section__title::before {
content: none;
}
.section__title:hover {
color: #2d3e50;
}
.section__body {
padding-left: 15px;
}
.section__body_guided {
border-left: 1px dotted #ccc;
}
.section_collapsed .section__body {
display: none;
}
.section__icon {
display: inline-block;
width: 19px;
height: 19px;
vertical-align: top;
padding: 0 3px;
border: none;
opacity: 0.5;
cursor: pointer;
}
.section__icon:hover {
opacity: 1;
}
.section__icon:before {
display: block;
width: 100%;
height: 100%;
content: '';
background-repeat: no-repeat;
background-size: 100%;
background-position: center;
}
.section__icon_view-local:before {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgLTAuNzA5IC0zMi4wODEgMTQxLjczMiAxNDEuNzMyIiBoZWlnaHQ9IjE0MS43MzJweCIgaWQ9IkxpdmVsbG9fMSIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSItMC43MDkgLTMyLjA4MSAxNDEuNzMyIDE0MS43MzIiIHdpZHRoPSIxNDEuNzMycHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxnIGlkPSJMaXZlbGxvXzgwIj48cGF0aCBkPSJNODkuNjY4LDM4Ljc4NmMwLTEwLjc3My04LjczMS0xOS41MTItMTkuNTEtMTkuNTEyUzUwLjY0NiwyOC4wMSw1MC42NDYsMzguNzg2YzAsMTAuNzc0LDguNzMyLDE5LjUxMSwxOS41MTIsMTkuNTExICAgQzgwLjkzNCw1OC4yOTcsODkuNjY4LDQ5LjU2MSw4OS42NjgsMzguNzg2IE0xMjguMzUyLDM4LjcyN2MtMTMuMzE1LDE3LjU5OS0zNC40MjYsMjguOTcyLTU4LjE5MywyOC45NzIgICBjLTIzLjc3LDAtNDQuODc5LTExLjM3My01OC4xOTQtMjguOTcyQzI1LjI3OSwyMS4xMjksNDYuMzg5LDkuNzU2LDcwLjE1OCw5Ljc1NkM5My45MjcsOS43NTYsMTE1LjAzNiwyMS4xMjksMTI4LjM1MiwzOC43MjcgICAgTTE0MC4zMTQsMzguNzZDMTI1LjY2NiwxNS40NzgsOTkuNzI1LDAsNzAuMTU4LDBTMTQuNjQ4LDE1LjQ3OCwwLDM4Ljc2YzE0LjY0OCwyMy4zMTIsNDAuNTkxLDM4LjgxLDcwLjE1OCwzOC44MSAgIFMxMjUuNjY2LDYyLjA3MiwxNDAuMzE0LDM4Ljc2Ii8+PC9nPjxnIGlkPSJMaXZlbGxvXzFfMV8iLz48L3N2Zz4=);
}
.section__icon_copy-to-clipboard:before {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUxMiA1MTIiIGhlaWdodD0iNTEycHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiB3aWR0aD0iNTEycHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxwYXRoIGQ9Ik00NjguNDkzLDEwMS42MzdMMzcxLjk1NSw1LjA5OEgxNTkuNTd2NzcuMjMxSDQzLjcyNHY0MjQuNzY5aDMwOC45MjN2LTc3LjIzMWgxMTUuODQ2VjEwMS42Mzd6ICAgTTM3MS45NTUsMzIuNDAxbDY5LjIzNiw2OS4yMzVoLTY5LjIzNlYzMi40MDF6IE02My4wMzEsNDg3Ljc5VjEwMS42MzdoMTczLjc2OXY5Ni41MzhoOTYuNTM4VjQ4Ny43OUg2My4wMzF6IE0yNTYuMTA4LDEwOS42MzIgIGw2OS4yMzYsNjkuMjM1aC02OS4yMzZWMTA5LjYzMnogTTM1Mi42NDcsNDEwLjU2VjE3OC44NjdsLTk2LjUzOC05Ni41MzhoLTc3LjIzMVYyNC40MDZoMTczLjc2OXY5Ni41MzhoOTYuNTM4VjQxMC41NkgzNTIuNjQ3eiIgZmlsbD0iIzM3NDA0RCIvPjwvc3ZnPg==);
}
.section_collapsed .section__title:before,
.meta-info_collapsed .meta-info__switcher:before {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);
}
.reason {
background: #f6f5f3;
border: 1px solid #ccc;
padding: 5px;
font: 12px Consolas, Monaco, monospace;
}
.state-button {
position: relative;
height: 22px;
display: inline-block;
box-shadow: 0 0 1px #000;
border: 1px solid #fff;
outline: none;
background: #fff;
cursor: pointer;
}
.cswitcher__item, .tab-switcher__button {
width: 22px;
}
.cswitcher__item_selected.cswitcher__item::before {
content: '';
position: absolute;
top: 0;
left: 0;
background: rgba(4, 4, 4, 0.3) no-repeat 3px 2px url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 97.619 97.618" fill="#eee" fill-opacity="0.8"><path d="m96.94 17.358l-12.971-11.399c-.398-.352-.927-.531-1.449-.494-.529.035-1.023.278-1.373.677l-47.05 53.55-16.728-22.14c-.319-.422-.794-.701-1.319-.773-.524-.078-1.059.064-1.481.385l-13.778 10.408c-.881.666-1.056 1.92-.39 2.801l30.974 40.996c.362.479.922.771 1.522.793.024 0 .049 0 .073 0 .574 0 1.122-.246 1.503-.68l62.64-71.3c.73-.829.649-2.094-.181-2.822"/></svg>');
height: 20px;
width: 20px;
}
.cswitcher_color_1 {
background: #c9c9c9;
}
.cswitcher_color_2 {
background: #d5ff09;
}
.cswitcher_color_3 {
background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 70 70" xmlns="http://www.w3.org/2000/svg"><path fill="#cecece" d="m0 0h35c0 11.67 0 23.33 0 35-11.67 0-23.33 0-35 0v-35"/><g fill="#fff"><path d="m35 0h35v35c-11.67 0-23.33 0-35 0 0-11.67 0-23.33 0-35"/><path d="m0 35c11.67 0 23.33 0 35 0 0 11.67 0 23.33 0 35h-35v-35"/></g><path fill="#cecece" d="m35 35c11.67 0 23.33 0 35 0v35h-35c0-11.67 0-23.33 0-35"/></svg>');
}
.collapsed {
display: none;
}
.skipped__list {
margin: 10px 0;
font-weight: bold;
color: #ccc;
}
a:link,
a:visited {
text-decoration: none;
}
a:hover,
a:active {
text-decoration: underline;
}
.tab__item {
display: none;
}
.tab__item_active {
display: block;
}
.tab-switcher, .cswitcher {
display: inline-block;
vertical-align: top;
padding: 5px;
}
.cswitcher:before {
content: 'Background:';
padding-right: 4px;
}
.tab-switcher:before {
content: 'Attempts:';
padding-right: 4px;
}
.tab-switcher__button_active {
background: #ffeba0;
}
.meta-info {
margin: 5px;
}
.meta-info__switcher {
display: inline-block;
cursor: pointer;
}
.meta-info__content {
margin: 5px 0;
background: #f6f5f3;
padding: 5px;
}
.meta-info_collapsed .meta-info__content {
display: none;
}
.text-input {
outline: 0;
line-height: 14px;
padding: 2px 5px;
border: 1px solid #ccc;
border-radius: 2px;
}

+ 0
- 2
gemini/reports/report.min.js
File diff suppressed because it is too large
View File


BIN
gemini/screens/yandex-icons/plain/PhantomJS.png View File

Before After
Width: 760  |  Height: 82  |  Size: 11 KiB

BIN
gemini/screens/yandex-search/plain/PhantomJS.png View File

Before After
Width: 900  |  Height: 106  |  Size: 5.8 KiB

BIN
gemini/screens/yandex-search/with text/PhantomJS.png View File

Before After
Width: 900  |  Height: 106  |  Size: 7.3 KiB

+ 38
- 12
gulpfile.js View File

@ -1,7 +1,6 @@
var fs = require('fs');
var async = require('async');
var gulp = require('gulp');
var opn = require('opn');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var cleanCSS = require('gulp-clean-css');
@ -10,8 +9,11 @@ var webpack = require('webpack');
var uglify = require('uglify-js');
var rimraf = require('rimraf');
var argv = require('yargs').argv;
var opn = require('opn');
var exec = require('child_process').exec;
var spawn = require('child_process').spawn;
var webserver = require('gulp-webserver');
var geminiConfig = require('./test/gemini/gemini.config.js');
var ENTRY = './index.js';
var HEADER = './lib/header.js';
@ -82,7 +84,7 @@ var webpackConfig = {
plugins: [bannerPlugin],
cache: true,
// generate details sourcempas of webpack modules
// generate details s tests: root + 'tests/',ourcempas of webpack modules
devtool: 'source-map'
//debug: true,
@ -116,9 +118,23 @@ function handleCompilerCallback(err, stats) {
}
}
var phantomjsPort = 4444;
gulp.task('gemini-tests', function(cb) {
var phantomjsProcess = spawn('phantomjs', ['--webdriver=' + phantomjsPort]);
function startDevWebserver(cb) {
return gulp.src('./').pipe(webserver({
path: '/',
port: geminiConfig.webserver.port
}));
}
gulp.task('gemini-webserver', function(cb) {
startDevWebserver(cb);
});
function runGemini(mode, cb) {
var server = startDevWebserver();
var phantomjsProcess = spawn('phantomjs', [
'--webdriver=' + geminiConfig.phantomjs.port
]);
var completed = false;
var hasError = false;
@ -126,7 +142,7 @@ gulp.task('gemini-tests', function(cb) {
if (data.toString().indexOf('running on port') >= 0) {
gutil.log("Started phantomjs webdriver");
var geminiProcess = spawn('gemini', ['test', 'test/gemini']);
var geminiProcess = spawn('gemini', [mode, geminiConfig.gemini.tests]);
geminiProcess.stdout.on('data', function(data) {
var msg = data.toString().replace(/\n$/g, '');
if (msg.startsWith('✓')) {
@ -141,13 +157,15 @@ gulp.task('gemini-tests', function(cb) {
geminiProcess.stderr.on('data', function(data) {
if (!(data.toString().indexOf('DeprecationWarning:') >= 0)) {
hasError = true;
gutil.log(gutil.colors.red(data.toString().replace(/\n$/g,
'')));
gutil.log(gutil.colors.red(
data.toString().replace(/\n$/g, '')
));
}
});
geminiProcess.on('close', function(code) {
completed = true;
phantomjsProcess.kill();
server.emit('kill');
});
}
});
@ -156,20 +174,28 @@ gulp.task('gemini-tests', function(cb) {
});
phantomjsProcess.on('close', function(code) {
if (code && !completed) {
return cb(new Error('✘ phantomjs failed with code: ' + code +
'\n' +
'Check that port ' + phantomjsPort +
return cb(new Error('✘ phantomjs failed with code: ' + code + '\n' +
'Check that port ' + geminiConfig.phantomjs.port +
' is free and that there are no other ' +
'instances of phantomjs running. (`killall phantomjs`)'));
}
gutil.log("Stoped phantomjs webdriver");
if (hasError) {
opn('./gemini/reports/index.html');
gutil.log("Opening report in webbrowser");
opn(geminiConfig.gemini.reports);
}
cb();
});
}
gulp.task('gemini-update', function(cb) {
runGemini('update', cb);
});
gulp.task('gemini-test', function(cb) {
runGemini('test', cb);
});
// clean the dist/img directory

+ 4
- 1
package.json View File

@ -24,7 +24,9 @@
"main": "./dist/vis.js",
"scripts": {
"test": "mocha --compilers js:babel-core/register",
"gemini": "gulp gemini-tests",
"gemini": "gemini",
"gemini-tests": "gulp gemini-tests",
"gulp": "gulp",
"build": "gulp",
"lint": "eslint lib",
"watch": "gulp watch",
@ -57,6 +59,7 @@
"gulp-concat": "^2.6.1",
"gulp-rename": "^1.2.2",
"gulp-util": "^3.0.8",
"gulp-webserver": "^0.9.1",
"jsdom": "9.9.1",
"jsdom-global": "^2.1.1",
"mocha": "^3.2.0",

+ 0
- 8
test/gemini/demo1.js View File

@ -1,8 +0,0 @@
gemini.suite('yandex-search', function(suite) {
suite.setUrl('/')
.setCaptureElements('.main-table')
.capture('plain')
.capture('with text', function(actions, find) {
actions.sendKeys(find('.input__control'), 'hello gemini');
});
});

+ 0
- 5
test/gemini/demo2.js View File

@ -1,5 +0,0 @@
gemini.suite('yandex-icons', function(suite) {
suite.setUrl('/foo')
.setCaptureElements('.tabs')
.capture('plain');
});

+ 18
- 0
test/gemini/gemini.config.js View File

@ -0,0 +1,18 @@
var root = './test/gemini/';
module.exports = {
gemini: {
baseDir: root,
reports: root + 'reports/',
screens: root + 'screens/',
tests: root + 'tests/'
},
webserver: {
port: 8182
},
phantomjs: {
port: 4444
}
}

BIN
test/gemini/screens/timline/BasicExample/plain/PhantomJS.png View File

Before After
Width: 1350  |  Height: 150  |  Size: 11 KiB

+ 45
- 0
test/gemini/tests/timeline/BasicExample/index.html View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Timeline | Basic demo</title>
<style type="text/css">
body, html {
font-family: sans-serif;
}
</style>
<script src="/dist/vis.js"></script>
<link href="/dist/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p>
A basic timeline. You can move and zoom the timeline, and select items.
</p>
<div id="timeline" class="gemini-test-timeline"></div>
<script type="text/javascript">
// DOM element where the Timeline will be attached
var container = document.getElementById('timeline');
// Create a DataSet (allows two way data-binding)
var items = new vis.DataSet([
{id: 1, content: 'item 1', start: '2014-04-20'},
{id: 2, content: 'item 2', start: '2014-04-14'},
{id: 3, content: 'item 3', start: '2014-04-18'},
{id: 4, content: 'item 4', start: '2014-04-16', end: '2014-04-19'},
{id: 5, content: 'item 5', start: '2014-04-25'},
{id: 6, content: 'item 6', start: '2014-04-27', type: 'point'}
]);
// Configuration for the Timeline
var options = {};
// Create a Timeline
var timeline = new vis.Timeline(container, items, options);
</script>
</body>
</html>

+ 8
- 0
test/gemini/tests/timeline/BasicExample/test.js View File

@ -0,0 +1,8 @@
gemini.suite('timline/BasicExample', function(suite) {
suite.setUrl('/test/gemini/tests/timeline/BasicExample/')
.before(function(actions) {
actions.waitForElementToShow('.gemini-test-timeline', 5000);
})
.setCaptureElements('.gemini-test-timeline')
.capture('plain');
});

Loading…
Cancel
Save