From 66b3b9e3443aeb4f18a99a7e619ba5460093cef1 Mon Sep 17 00:00:00 2001 From: Borys Levytskyi Date: Sun, 12 Apr 2015 12:43:01 +0300 Subject: [PATCH] Started to implement webdriver tests --- conf.js | 17 +++++++++++++ karma.conf.js | 2 +- tests/integration/spec.js | 29 +++++++++++++++++++++++ tests/{ => unit}/core/diSpec.js | 0 tests/{ => unit}/core/htmlSpec.js | 0 tests/{ => unit}/domain/expressionSpec.js | 0 tests/{ => unit}/domain/formatterSpec.js | 0 7 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 conf.js create mode 100644 tests/integration/spec.js rename tests/{ => unit}/core/diSpec.js (100%) rename tests/{ => unit}/core/htmlSpec.js (100%) rename tests/{ => unit}/domain/expressionSpec.js (100%) rename tests/{ => unit}/domain/formatterSpec.js (100%) diff --git a/conf.js b/conf.js new file mode 100644 index 0000000..d6d3c09 --- /dev/null +++ b/conf.js @@ -0,0 +1,17 @@ +exports.config = { + seleniumAddress: 'http://127.0.0.1:4444/wd/hub', + + specs: [ + './tests/integration/spec.js' + ], + + capabilities: { + 'browserName': 'chrome' + }, + + chromeOptions: { + binary: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe", + args: [], + extensions: [] + } +}; diff --git a/karma.conf.js b/karma.conf.js index afcf036..13029a0 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -14,7 +14,7 @@ module.exports = function(config) { 'src/js/app.js', 'src/js/components/*.js', 'src/js/app/**/*.js', - 'tests/**/*.js' + 'tests/unit/**/*.js' ] }); }; diff --git a/tests/integration/spec.js b/tests/integration/spec.js new file mode 100644 index 0000000..46b07ad --- /dev/null +++ b/tests/integration/spec.js @@ -0,0 +1,29 @@ +var By = protractor.By; +var driver = browser.driver; +var appUrl = 'http://localhost:63342/BitwiseCmd/src/'; + +describe('a quick test', function(){ + it('should be true', function(){ + expect(true).toBe(true); + }); +}); + +describe('launch of application', function() { + it('should have title', function() { + driver.get(appUrl).then(function() { + expect(driver.getTitle()).toEqual('BitwiseCmd'); + }); + }); + + it('should have no errors title', function() { + driver.get(appUrl).then(function() { + driver.findElements(By.css('.result .error')).then(function(els) { + expect(els.length).toBe(0, "There should be no errors on autolaunch"); + }); + }); + }); + + + //el.sendKey('asd'); + //expect(el.text()).toBe('asd') +}); \ No newline at end of file diff --git a/tests/core/diSpec.js b/tests/unit/core/diSpec.js similarity index 100% rename from tests/core/diSpec.js rename to tests/unit/core/diSpec.js diff --git a/tests/core/htmlSpec.js b/tests/unit/core/htmlSpec.js similarity index 100% rename from tests/core/htmlSpec.js rename to tests/unit/core/htmlSpec.js diff --git a/tests/domain/expressionSpec.js b/tests/unit/domain/expressionSpec.js similarity index 100% rename from tests/domain/expressionSpec.js rename to tests/unit/domain/expressionSpec.js diff --git a/tests/domain/formatterSpec.js b/tests/unit/domain/formatterSpec.js similarity index 100% rename from tests/domain/formatterSpec.js rename to tests/unit/domain/formatterSpec.js