From eb81a3a3e82e70765e103b6cbac4a1d289adfd58 Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Fri, 18 Sep 2015 18:59:49 -0300 Subject: [PATCH] Add new test case to verify if angularjs is being loaded correctly Signed-off-by: Bruno Bottazzini --- test_case/02_angularjs.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test_case/02_angularjs.js diff --git a/test_case/02_angularjs.js b/test_case/02_angularjs.js new file mode 100644 index 0000000..9ef9478 --- /dev/null +++ b/test_case/02_angularjs.js @@ -0,0 +1,22 @@ +var expect = require('expect.js'); + +describe('Index Page', function(){ + it('should be able to get angularjs scopped variable', function() { + // Get Index + browser.get('/'); + browser.waitForAngular(); //Wait angularjs to load + /* + * This function will test if a repoUrl is NULL. (That means it is empty) + * This variable is scopped by angularjs and it is loaded null by default. + * If this scopped var is not found then we got an error on angularjs and the + * test will fail + */ + element(by.model('repoUrl')).evaluate('repoUrl').then(function(value) { + if (!value) { + return true; + } else { + return false; + } + }); + }); +});