Skip to content
Permalink
Browse files

update tests, update "isON"

  • Loading branch information...
ganlanyuan committed Oct 18, 2018
1 parent accd7bf commit 0dedc4274e578cab9806dc3530939055261cf1db
Showing with 681 additions and 1,990 deletions.
  1. +1 −1 dist/min/tiny-slider.js
  2. +1 −1 dist/sourcemaps/tiny-slider.js.map
  3. +7 −4 dist/tiny-slider.js
  4. +39 −35 gulpfile.js
  5. +23 −8 nightwatch.json
  6. +3 −3 package.json
  7. +7 −4 src/tiny-slider.js
  8. +7 −4 src/tiny-slider.module.js
  9. +0 −1 template/test/parts/layout.njk
  10. +0 −1 test/animation1.html
  11. +0 −1 test/animation2.html
  12. +0 −1 test/arrowKeys.html
  13. +0 −1 test/autoHeight.html
  14. +0 −1 test/autoplay.html
  15. +0 −1 test/base.html
  16. +0 −1 test/customize.html
  17. +0 −1 test/edgePadding-gutter.html
  18. +0 −1 test/edgePadding.html
  19. +0 −1 test/few-items.html
  20. +0 −1 test/fixedWidth-edgePadding-gutter.html
  21. +0 −1 test/fixedWidth-edgePadding.html
  22. +0 −1 test/fixedWidth-gutter.html
  23. +0 −1 test/fixedWidth.html
  24. +0 −1 test/frame.html
  25. +0 −1 test/gutter.html
  26. +0 −1 test/index.html
  27. +0 −7 test/js/imagesloaded.pkgd.min.js
  28. +205 −140 test/js/tests-async-es5.js
  29. +105 −59 test/js/tests-async.js
  30. +0 −1 test/lazyload.html
  31. +0 −1 test/mouse-drag.html
  32. +0 −1 test/mouse-drag2.html
  33. +0 −1 test/nested.html
  34. +0 −1 test/non-loop.html
  35. +79 −0 test/parts/layout.html
  36. +20 −0 test/reports/CHROME_18.0.1025.168_XP_first_test.xml
  37. +17 −0 test/reports/FIREFOX_undefined_undefined_first_test.xml
  38. +28 −0 test/reports/INTERNET EXPLORER_9_WINDOWS_first_test.xml
  39. +15 −0 test/reports/SAFARI_6.2.2_MAC_first_test.xml
  40. +30 −0 test/reports/first_test.xml
  41. +0 −1 test/responsive1-mobile.html
  42. +0 −1 test/responsive1.html
  43. +0 −1 test/responsive2-mobile.html
  44. +0 −1 test/responsive2.html
  45. +0 −1 test/responsive3-mobile.html
  46. +0 −1 test/responsive3.html
  47. +0 −1 test/responsive4-mobile.html
  48. +0 −1 test/responsive4.html
  49. +0 −1 test/responsive5-mobile.html
  50. +0 −1 test/responsive5.html
  51. +0 −1 test/responsive6-mobile.html
  52. +0 −1 test/responsive6.html
  53. +0 −1 test/rewind.html
  54. BIN test/screenshot/chrome/base.png
  55. BIN test/screenshot/chrome/vertical.png
  56. BIN test/screenshot/firefox/base.png
  57. BIN test/screenshot/ie/animation1.png
  58. BIN test/screenshot/ie/animation2.png
  59. BIN test/screenshot/ie/arrowKeys.png
  60. BIN test/screenshot/ie/autoplay.png
  61. BIN test/screenshot/ie/base.png
  62. BIN test/screenshot/safari/base.png
  63. +85 −5 test/scripts/first_test.js
  64. +0 −1 test/slide-by-page.html
  65. +0 −1 test/start-index.html
  66. +9 −1,677 test/tests-mobile.html
  67. +0 −1 test/vertical-edgePadding-gutter.html
  68. +0 −1 test/vertical-edgePadding.html
  69. +0 −1 test/vertical-gutter.html
  70. +0 −1 test/vertical.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -681,7 +681,7 @@ var tns = function(options) {
slideCount = slideItems.length,
breakpointZone,
windowWidth = getWindowWidth(),
isOn = true;
isOn = false;
if (responsive) { setBreakpointZone(); }

// fixedWidth: viewport > rightBoundary > indexMax
@@ -1438,8 +1438,6 @@ var tns = function(options) {
if (hasControls) {
if (controlsContainer || (prevButton && nextButton)) {
if (controlsContainer) {
prevButton = controlsContainer.children[0];
nextButton = controlsContainer.children[1];
setAttrs(controlsContainer, {
'aria-label': 'Carousel Navigation',
'tabindex': '0'
@@ -1456,6 +1454,9 @@ var tns = function(options) {
outerWrapper.insertAdjacentHTML('afterbegin', '<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button data-controls="prev" tabindex="-1" aria-controls="' + slideId +'" type="button">' + controlsText[0] + '</button><button data-controls="next" tabindex="-1" aria-controls="' + slideId +'" type="button">' + controlsText[1] + '</button></div>');

controlsContainer = outerWrapper.querySelector('.tns-controls');
}

if (!prevButton || !nextButton) {
prevButton = controlsContainer.children[0];
nextButton = controlsContainer.children[1];
}
@@ -1509,8 +1510,9 @@ var tns = function(options) {
if (disable) { disableSlider(); } else if (freeze) { freezeSlider(); }

events.on('indexChanged', additionalUpdates);
if (typeof onInit === 'function') { onInit(info()); }
if (nested === 'inner') { events.emit('innerLoaded', info()); }
if (typeof onInit === 'function') { onInit(info()); }
isOn = true;
}

function destroy () {
@@ -3020,6 +3022,7 @@ var tns = function(options) {
visibleNavIndexes: visibleNavIndexes,
visibleNavIndexesCached: visibleNavIndexesCached,
sheet: sheet,
isOn: isOn,
event: e || {},
};
}
@@ -10,6 +10,7 @@ const $ = require('gulp-load-plugins')({
const browserSync = require('browser-sync').create();
const nunjucks = require('nunjucks');
const path = require('path');
const fs = require('fs');

let sourcemapsDest = 'sourcemaps';
let libName = 'tiny-slider',
@@ -31,6 +32,44 @@ function errorlog (error) {
this.emit('end');
}

function readfiles (dir, arr) {
fs.readdirSync(dir).forEach( file => {
if (path.extname(file) === '.njk') {
arr.push(dir+file);
}
});
}

gulp.task('njk', function() {
let files = [];
readfiles('./template/demo/', files);
readfiles('./template/test/', files);

files.forEach(function(file) {
let dest = path.dirname(file).replace('/template', '');

return gulp.src(file)
.pipe($.plumber())
.pipe($.nunjucks.compile({}, {
watch: true,
noCache: true
}))
.pipe($.rename(function (path) {
path.extname = '.html';
}))
.pipe($.htmltidy({
doctype: 'html5',
wrap: 0,
hideComments: false,
indent: true,
'indent-attributes': false,
'drop-empty-elements': false,
'force-output': true
}))
.pipe(gulp.dest(dest));
});
});

function sassTask(src, dest) {
return gulp.src(src)
.pipe($.sourcemaps.init())
@@ -108,40 +147,6 @@ gulp.task('min', ['editPro'], function () {
.pipe(gulp.dest(pathDest + 'min'))
})

gulp.task('test', function () {
return rollup({
input: pathTest + testScript,
context: 'window',
// treeshake: false,
plugins: [
resolve({
jsnext: true,
main: true,
browser: true,
}),
// babel({
// exclude: 'node_modules/**' // only transpile our source code
// }),
],
}).then(function (bundle) {
return bundle.write({
file: pathTest + testName + '.min.js',
format: 'iife',
moduleName: 'tiny',
});
});
});

// let testcafeObj = {
// src: 'tests/tests.js',
// options: { browsers: ['chrome', 'safari'] },
// };
// testcafe
// gulp.task('testcafe', () => {
// return gulp.src(testcafeObj.src)
// .pipe(testcafe(testcafeObj.options));
// });

// browser-sync
gulp.task('server', function() {
browserSync.init({
@@ -198,6 +203,5 @@ gulp.task('default', [
// 'min',
// 'helper-ie8',
// 'makeDevCopy',
// 'test',
'server',
]);
@@ -1,6 +1,6 @@
{
"src_folders" : ["tests/scripts"],
"output_folder" : "reports",
"src_folders" : ["test/scripts"],
"output_folder" : "test/reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
@@ -34,20 +34,26 @@
},
"username": "${CBT_USERNAME}",
"access_key": "${CBT_ACCESS_KEY}",
"globals": {
"urlcode": "aecb2e78"
},
"desiredCapabilities": {
"acceptSslCerts": "1",
"browserName": "Internet Explorer",
"version": "8",
"version": "9",
"build": "1.0",
"javascriptEnabled": "1",
"name": "NightwatchJSExample",
"platform" : "Windows 7",
"platform" : "Windows 7 64-Bit",
"record_network" : "false",
"record_video" : "true",
"screen_resolution" : "1024x768"
"screen_resolution" : "1366x768"
}
},
"ie9": {
"ie": {
"globals": {
"browser_name": "ie"
},
"desiredCapabilities": {
"acceptSslCerts": "1",
"build": "1.0",
@@ -62,6 +68,9 @@
}
},
"firefox": {
"globals": {
"browser_name": "firefox"
},
"desiredCapabilities": {
"acceptSslCerts": "1",
"build": "1.0",
@@ -70,12 +79,15 @@
"record_network" : "false",
"record_video" : "true",
"browserName": "Firefox",
"version": "8",
"platform": "Windows 8",
"version": "9",
"platform": "Windows 7 64-Bit",
"screenResolution": "1366x768"
}
},
"chrome": {
"globals": {
"browser_name": "chrome"
},
"desiredCapabilities": {
"acceptSslCerts": "1",
"build": "1.0",
@@ -90,6 +102,9 @@
}
},
"safari": {
"globals": {
"browser_name": "safari"
},
"desiredCapabilities": {
"acceptSslCerts": "1",
"build": "1.0",
@@ -5,11 +5,11 @@
"main": "src/tiny-slider.js",
"types": "src/tiny-slider.d.ts",
"directories": {
"test": "tests"
"test": "test"
},
"scripts": {
"start": "nodemon --watch tests/js/tests-async.js --exec npm test",
"test": "npx babel tests/js/tests-async.js -o tests/js/tests-async-es5.js"
"start": "nodemon --watch test/js/tests-async.js --exec npm test",
"test": "npx babel test/js/tests-async.js -o test/js/tests-async-es5.js"
},
"repository": {
"type": "git",
@@ -251,7 +251,7 @@ export var tns = function(options) {
slideCount = slideItems.length,
breakpointZone,
windowWidth = getWindowWidth(),
isOn = true;
isOn = false;
if (responsive) { setBreakpointZone(); }

// fixedWidth: viewport > rightBoundary > indexMax
@@ -1008,8 +1008,6 @@ export var tns = function(options) {
if (hasControls) {
if (controlsContainer || (prevButton && nextButton)) {
if (controlsContainer) {
prevButton = controlsContainer.children[0];
nextButton = controlsContainer.children[1];
setAttrs(controlsContainer, {
'aria-label': 'Carousel Navigation',
'tabindex': '0'
@@ -1026,6 +1024,9 @@ export var tns = function(options) {
outerWrapper.insertAdjacentHTML('afterbegin', '<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button data-controls="prev" tabindex="-1" aria-controls="' + slideId +'" type="button">' + controlsText[0] + '</button><button data-controls="next" tabindex="-1" aria-controls="' + slideId +'" type="button">' + controlsText[1] + '</button></div>');

controlsContainer = outerWrapper.querySelector('.tns-controls');
}

if (!prevButton || !nextButton) {
prevButton = controlsContainer.children[0];
nextButton = controlsContainer.children[1];
}
@@ -1079,8 +1080,9 @@ export var tns = function(options) {
if (disable) { disableSlider(); } else if (freeze) { freezeSlider(); }

events.on('indexChanged', additionalUpdates);
if (typeof onInit === 'function') { onInit(info()); }
if (nested === 'inner') { events.emit('innerLoaded', info()); }
if (typeof onInit === 'function') { onInit(info()); }
isOn = true;
}

function destroy () {
@@ -2590,6 +2592,7 @@ export var tns = function(options) {
visibleNavIndexes: visibleNavIndexes,
visibleNavIndexesCached: visibleNavIndexesCached,
sheet: sheet,
isOn: isOn,
event: e || {},
};
}
@@ -251,7 +251,7 @@ export var tns = function(options) {
slideCount = slideItems.length,
breakpointZone,
windowWidth = getWindowWidth(),
isOn = true;
isOn = false;
if (responsive) { setBreakpointZone(); }

// fixedWidth: viewport > rightBoundary > indexMax
@@ -1008,8 +1008,6 @@ export var tns = function(options) {
if (hasControls) {
if (controlsContainer || (prevButton && nextButton)) {
if (controlsContainer) {
prevButton = controlsContainer.children[0];
nextButton = controlsContainer.children[1];
setAttrs(controlsContainer, {
'aria-label': 'Carousel Navigation',
'tabindex': '0'
@@ -1026,6 +1024,9 @@ export var tns = function(options) {
outerWrapper.insertAdjacentHTML('afterbegin', '<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button data-controls="prev" tabindex="-1" aria-controls="' + slideId +'" type="button">' + controlsText[0] + '</button><button data-controls="next" tabindex="-1" aria-controls="' + slideId +'" type="button">' + controlsText[1] + '</button></div>');

controlsContainer = outerWrapper.querySelector('.tns-controls');
}

if (!prevButton || !nextButton) {
prevButton = controlsContainer.children[0];
nextButton = controlsContainer.children[1];
}
@@ -1079,8 +1080,9 @@ export var tns = function(options) {
if (disable) { disableSlider(); } else if (freeze) { freezeSlider(); }

events.on('indexChanged', additionalUpdates);
if (typeof onInit === 'function') { onInit(info()); }
if (nested === 'inner') { events.emit('innerLoaded', info()); }
if (typeof onInit === 'function') { onInit(info()); }
isOn = true;
}

function destroy () {
@@ -2590,6 +2592,7 @@ export var tns = function(options) {
visibleNavIndexes: visibleNavIndexes,
visibleNavIndexesCached: visibleNavIndexesCached,
sheet: sheet,
isOn: isOn,
event: e || {},
};
}
@@ -251,7 +251,6 @@
</script>
<![endif]-->

<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/es6-promise.auto.min.js"></script>
<script src="js/helpers.js"></script>
<script src="js/babel-polyfill/dist/polyfill.min.js"></script>
@@ -135,7 +135,6 @@ <h2>
</script>
<![endif]-->

<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/es6-promise.auto.min.js"></script>
<script src="js/helpers.js"></script>
<script src="js/babel-polyfill/dist/polyfill.min.js"></script>
@@ -135,7 +135,6 @@ <h2>
</script>
<![endif]-->

<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/es6-promise.auto.min.js"></script>
<script src="js/helpers.js"></script>
<script src="js/babel-polyfill/dist/polyfill.min.js"></script>
@@ -135,7 +135,6 @@ <h2>
</script>
<![endif]-->

<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/es6-promise.auto.min.js"></script>
<script src="js/helpers.js"></script>
<script src="js/babel-polyfill/dist/polyfill.min.js"></script>
@@ -119,7 +119,6 @@ <h2>
</script>
<![endif]-->

<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/es6-promise.auto.min.js"></script>
<script src="js/helpers.js"></script>
<script src="js/babel-polyfill/dist/polyfill.min.js"></script>
@@ -135,7 +135,6 @@ <h2>
</script>
<![endif]-->

<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/es6-promise.auto.min.js"></script>
<script src="js/helpers.js"></script>
<script src="js/babel-polyfill/dist/polyfill.min.js"></script>
@@ -138,7 +138,6 @@ <h2>
</script>
<![endif]-->

<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/es6-promise.auto.min.js"></script>
<script src="js/helpers.js"></script>
<script src="js/babel-polyfill/dist/polyfill.min.js"></script>
@@ -149,7 +149,6 @@ <h2>
</script>
<![endif]-->

<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/es6-promise.auto.min.js"></script>
<script src="js/helpers.js"></script>
<script src="js/babel-polyfill/dist/polyfill.min.js"></script>

0 comments on commit 0dedc42

Please sign in to comment.
You can’t perform that action at this time.