TagSpaces is an offline, open source, document manager with tagging support
adding support for ui tests
uggrock1ca5b216bb72
diff --git a/Gruntfile.js b/Gruntfile.jsindex 323a98678..1641f219a 100644--- a/Gruntfile.js+++ b/Gruntfile.js@@ -59,17 +59,6 @@ module.exports = function(grunt) {}},- uglify: {- pro: {- files: {- 'data/pro/js/thumbsgenerator-u.js': ['data/pro/js/thumbsgenerator.js']- },- options: {- //compress: false- }- },- },-watch: {scripts: {files: ['**/*.css'],@@ -273,7 +262,6 @@ module.exports = function(grunt) {grunt.loadNpmTasks('grunt-replace');grunt.loadNpmTasks('grunt-contrib-watch');grunt.loadNpmTasks('grunt-contrib-compress');- grunt.loadNpmTasks('grunt-contrib-uglify');grunt.loadNpmTasks("grunt-jscs");grunt.loadNpmTasks('grunt-shell');grunt.loadNpmTasks('grunt-fixmyjs');diff --git a/package.json b/package.jsonindex ac19451db..8eadabd2c 100644--- a/package.json+++ b/package.json@@ -35,7 +35,6 @@"grunt-contrib-concat": "~0.3.0","grunt-contrib-copy": "~0.8.0","grunt-contrib-jshint": "~0.10.0",- "grunt-contrib-uglify": "^1.0.0","grunt-contrib-watch": "^0.6.1","grunt-fixmyjs": "~0.3.0","grunt-jsbeautifier": "~0.2.8",diff --git a/test/webdav-test.js b/test/webdav-test.jsindex b1cf8f6f9..8a7848dd6 100644--- a/test/webdav-test.js+++ b/test/webdav-test.js@@ -1,43 +1,28 @@var Nightmare = require('nightmare');var expect = require('chai').expect; // jshint ignore:line-describe('test yahoo search results', function() {- it('should find the nightmare github link first', function*() {- var nightmare = Nightmare();- var link = yield nightmare- .goto('http://yahoo.com')- .type('input[title="Search"]', 'github nightmare')- .click('#UHSearchWeb')- .wait('#main')- .evaluate(function () {- return document.querySelector('#main .searchCenterMiddle li a').href- })- expect(link).to.equal('https://github.com/segmentio/nightmare');- });-});-+var locationName = "TSDemo";-describe('test webdav login', function() {- it('should find the nightmare github link first', function*() {+describe('test connecting location', function() {+ it('should create a new location and proof it ', function*() {var nightmare = Nightmare();- var link = yield nightmare- .goto('http://demo:[email protected]:8000/index.html')- .wait('#main')+ var result = yield nightmare+ .goto('file:///home/na/TagSpaces/repo/data/index.html') // file:///e:/TagSpaces/repo/data/index.html+ .wait(2000)+ .click('#selectLocation')+ .click('#createNewLocation')+ .wait(1000)+ .click('#folderLocation')+ .type('#folderLocation', '/home/na/TagSpaces')+ .type('#connectionName', locationName)+ .click('#createFolderConnectionButton')+ .wait(1000).evaluate(function () {- return true;- })- expect(link).to.equal(true);+ return document.querySelector("#locationName").innerText;+ });++ console.log("---" + result);+ expect(result).to.equal(locationName);});});-describe('test the electron app', function() {- it('should find the nightmare github link first', function*() {- var nightmare = Nightmare();- var link = yield nightmare- .goto('file:///home/na/TagSpaces/repo/data/index.html')- .evaluate(function () {- return true;- })- expect(link).to.equal(1);- });-});\ No newline at end of filediff --git a/testdev.js b/testdev.jsindex ada919f71..71b9a2ded 100644--- a/testdev.js+++ b/testdev.js@@ -1,17 +1,25 @@var Nightmare = require('nightmare');-var nightmare = Nightmare({ show: true })+var nightmare = Nightmare({show: true});nightmare//.goto('http://demo:[email protected]:8000/index.html')- .goto('file:///home/na/TagSpaces/repo/data/index.html')- .type('input[title="Search"]', 'github nightmare')- .click('#UHSearchWeb')- .wait('#main')+ .goto('file:///home/na/TagSpaces/repo/data/index.html') // file:///e:/TagSpaces/repo/data/index.html+ .wait(2000)+ .click('#selectLocation')+ .click('#createNewLocation')+ .wait(1000)+ .click('#folderLocation')+ .type('#folderLocation', '/home/na/TagSpaces')+ .type('#connectionName', 'TSDemo')+ .click('#createFolderConnectionButton')+ .wait(1000).evaluate(function () {- return document.querySelector('#main .searchCenterMiddle li a').href+ console.log("Location name" + document.querySelector("#locationName").textContent);+ return document.querySelector("#locationName").textContent === "TSDemo";})+ .end().then(function (result) {- console.log(result)+ console.log("Test result: " + result);})nightmare.end()