lemonldap-ng/e2e-tests/e2e/01-tree.js
Xavier Guimard 537d5d2394 Move end-to-end test to root
New target also created in Makefile: `e2e_test`
NB: to launch it, install protractor. For example:

    npn install -g protractor && \
    webdriver-manager update
2015-12-07 20:56:39 +00:00

42 lines
1.4 KiB
JavaScript

'use strict';
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('my app', function() {
describe('Tree display', function() {
it('should display 9 main nodes', function() {
browser.get('/');
var mainNodes = element.all(by.repeater('node in data track by node.id'));
expect(mainNodes.count()).toEqual(9);
});
it('should find a default rule', function() {
browser.get('/#/confs/1');
var vhs = element(by.id('a-virtualHosts'));
vhs.click();
var vh = element(by.id('a-virtualHosts/manager.example.com'));
vh.click();
var r = element(by.id('a-virtualHosts/manager.example.com/locationRules'));
r.click();
var def = element.all(by.id("t-virtualHosts/manager.example.com/locationRules/1"));
expect(def.count()).toEqual(1);
expect(def.get(0).getText()).toEqual('default');
});
it('should find 19 auth/user modules but only Demo visible', function() {
browser.get('/#/confs/1');
element(by.id('a-generalParameters')).click();
element(by.id('a-authParams')).click();
/* todo */
});
it('should have a hash form if a key is clicked', function() {
element(by.id('a-demoParams')).click();
element(by.id('a-demoExportedVars')).click();
element(by.id('t-demoExportedVars/cn')).click();
var def = element.all(by.id('hashkeyinput'));
expect(def.count()).toEqual(1);
});
});
});