Commit a35215b2 authored by Christophe Maudoux's avatar Christophe Maudoux

WIP - Improve e2e tests (#1600)

parent 2629a8a7
......@@ -70,6 +70,7 @@ describe('01 Lemonldap::NG Manager', function() {
});
it('General Parameters > Authn. parameters > Users modules => Should have 7 modules availabled with "Same" selected', function() {
element(by.id('t-userDB')).click();
browser.sleep(1000);
expect(element(by.css('option[selected="selected"]')).getAttribute('Value')).toEqual('Same');
expect(element.all(by.repeater('item in currentNode.select')).count()).toEqual(7);
});
......
......@@ -44,7 +44,7 @@ describe('05 Lemonldap::NG Manager', function() {
['exportedVars', 'macros', 'groups'].forEach(function(type) {
element(by.id('a-' + type)).click();
element(by.id('t-' + type)).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
expect(element(by.id('t-' + type + '/n' + id)).getText()).toEqual('new');
browser.sleep(3000);
id++;
......
......@@ -7,14 +7,19 @@ describe('06 Lemonldap::NG Manager', function() {
describe('Form control, part 2', function() {
it('should display portal skin choice', function() {
browser.get('/#/confs/1');
browser.get('/#!/confs/lastest');
element(by.id('a-generalParameters')).click();
element(by.id('a-portalParams')).click();
element(by.id('a-portalCustomization')).click();
element(by.id('t-portalSkin')).click();
element(by.css('[ng-click="showModal(\'portalSkinChoice.html\')"]')).click();
browser.sleep(1000);
var skinChoice = element.all(by.repeater('b in currentNode.select'));
expect(skinChoice.count()).toEqual(1);
element(by.css('[trspan="cancel"]')).click();
browser.sleep(1000);
});
});
});
......@@ -7,37 +7,57 @@ describe('07 Lemonldap::NG Manager', function() {
describe('Form control, part 3 - authParams', function() {
it('should display auth modules chosen', function() {
browser.get('/#/confs/1');
browser.get('/#!/confs/latest');
browser.sleep(2000);
element(by.id('a-generalParameters')).click();
browser.sleep(1000);
element(by.id('a-authParams')).click();
browser.sleep(1000);
element(by.id('t-authentication')).click();
browser.sleep(2000);
expect(element(by.id('t-demoParams')).isDisplayed()).toBeTruthy();
element(by.xpath("//option[@value='Apache']")).click();
browser.sleep(2000);
expect(element(by.id('t-apacheParams')).isDisplayed()).toBeTruthy();
});
it('should display auth modules chosen with authChoice', function() {
element(by.xpath("//option[@value='Choice']")).click();
browser.sleep(1000);
expect(element(by.id('t-choiceParams')).isDisplayed()).toBeTruthy();
element(by.id('a-choiceParams')).click();
browser.sleep(1000);
element(by.id('t-authChoiceModules')).click();
element(by.css('.glyphicon-plus-sign')).click();
browser.sleep(2000);
//element(by.css('.glyphicon-plus-sign')).click();
browser.sleep(2000);
element(by.id('a-authChoiceModules')).click();
browser.sleep(2000);
element.all(by.css('.glyphicon-plus-sign')).first().click();
element(by.id('t-authChoiceModules/n1')).click();
element(by.xpath("//option[@value='LDAP']")).click();
browser.sleep(2000);
element.all(by.xpath("//option[@value='LDAP']")).first().click();
expect(element(by.id('t-ldapParams')).isDisplayed()).toBeTruthy();
});
it('should display auth modules chosen with authCombination', function() {
element(by.id('t-authentication')).click();
browser.sleep(1000);
element(by.xpath("//option[@value='Combination']")).click();
browser.sleep(1000);
expect(element(by.id('t-combinationParams')).isDisplayed()).toBeTruthy();
element(by.id('a-combinationParams')).click();
browser.sleep(1000);
element(by.id('t-combModules')).click();
browser.sleep(2000);
element(by.css('.glyphicon-plus-sign')).click();
element(by.xpath("//option[@value='DBI']")).click();
expect(element(by.id('t-dbiParams')).isDisplayed()).toBeTruthy();
element(by.xpath("//option[@value='LDAP']")).click();
element.all(by.xpath("//option[@value='LDAP']")).first().click();
expect(element(by.id('t-ldapParams')).isDisplayed()).toBeTruthy();
});
});
......
......@@ -7,7 +7,7 @@ describe('07u Lemonldap::NG Manager', function() {
describe('Apply mechanism', function() {
it('should be able to send UTF-8 chars', function() {
browser.get('/#/confs/latest');
browser.get('/#!/confs/latest');
element(by.id('a-generalParameters')).click();
element(by.id('a-advancedParams')).click();
element(by.id('a-security')).click();
......@@ -18,6 +18,8 @@ describe('07u Lemonldap::NG Manager', function() {
element(by.id('save')).click();
element(by.id('longtextinput')).sendKeys('UTF-8 tests');
element(by.id('saveok')).click();
browser.sleep(2000);
element(by.id('messageok')).click();
expect(element(by.id('cfgnum')).getText()).toEqual('2');
});
......
......@@ -7,25 +7,38 @@ describe('08 Lemonldap::NG Manager', function() {
describe('Apply mechanism', function() {
it('should be able to add reload urls', function() {
browser.get('/#/confs/latest');
browser.get('/#!/confs/latest');
browser.sleep(1000);
element(by.id('a-generalParameters')).click();
element(by.id('t-reloadParams')).click();
element(by.id('a-reloadParams')).click();
element(by.id('t-reloadUrls')).click();
element(by.id('a-reloadUrls')).click();
browser.sleep(1000);
//element(by.id('a-reloadUrls')).click();
element(by.css('.glyphicon-plus-sign')).click();
element(by.id('a-reloadUrls')).click();
browser.sleep(1000);
element(by.id('t-reloadUrls/n1')).click();
element(by.id('hashkeyinput')).clear().sendKeys('auth.example.com:19876');
element(by.id('hashvalueinput')).clear().sendKeys('http://auth.example.com:19876/static/nothing');
browser.sleep(1000);
element(by.id('hashkeyinput')).clear().sendKeys('auth.example.com');
browser.sleep(1000);
element(by.id('hashvalueinput')).clear().sendKeys('http://auth.example.com:19876/static/common/icons/ok.png');
browser.sleep(1000);
element(by.css('.glyphicon-plus-sign')).click();
element(by.id('t-reloadUrls/n2')).click();
element(by.id('hashkeyinput')).clear().sendKeys('manager.example.com:19876');
element(by.id('hashvalueinput')).clear().sendKeys('http://auth.example.com:19876/static/js/manager.js');
element(by.id('hashkeyinput')).clear().sendKeys('manager.example.com');
element(by.id('hashvalueinput')).clear().sendKeys('http://manager.example.com:19876/static/js/manager.js');
browser.sleep(1000);
});
it('should save new configuration', function() {
element(by.id('save')).click();
element(by.id('longtextinput')).sendKeys('Reload URLs test');
element(by.id('saveok')).click();
expect(element.all(by.repeater('item in item.items')).count()).toEqual(2);
browser.sleep(1000);
element(by.id('messageok')).click();
expect(element(by.id('cfgnum')).getText()).toEqual('3');
});
......
......@@ -9,7 +9,7 @@ describe('11 Lemonldap::NG Manager', function() {
it('should add an OIDC OP', function() {
browser.get('/#/confs/latest');
element(by.id('t-oidcOPMetaDataNodes')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
element(by.id('promptok')).click();
browser.sleep(500);
element(by.id('a-oidcOPMetaDataNodes/new__op-example')).click();
......@@ -18,7 +18,7 @@ describe('11 Lemonldap::NG Manager', function() {
element(by.id('t-oidcOPMetaDataNodes/new__op-example/oidcOPMetaDataJWKS')).click();
element(by.id('filetext')).sendKeys('{"c":"d"}');
element(by.id('t-oidcOPMetaDataNodes/new__op-example/oidcOPMetaDataExportedVars')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
//element(by.id('a-oidcOPMetaDataNodes/new__op-example/oidcOPMetaDataExportedVars')).click();
element(by.id('t-oidcOPMetaDataNodes/new__op-example/oidcOPMetaDataExportedVars/n1')).click();
element(by.id('hashkeyinput')).clear().sendKeys('MyKey');
......
......@@ -9,12 +9,12 @@ describe('12 Lemonldap::NG Manager', function() {
it('should add an OIDC RP', function() {
browser.get('/#/confs/latest');
element(by.id('t-oidcRPMetaDataNodes')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
element(by.id('promptok')).click();
browser.sleep(500);
element(by.id('a-oidcRPMetaDataNodes/new__rp-example')).click();
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataExportedVars')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
//element(by.id('a-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataExportedVars')).click();
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataExportedVars/n1')).click();
element(by.id('hashkeyinput')).clear().sendKeys('MyKey');
......@@ -24,7 +24,7 @@ describe('12 Lemonldap::NG Manager', function() {
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataOptionsClientID')).click();
element(by.id('textinput')).clear().sendKeys('MyClientID');
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataOptionsExtraClaims')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
//element(by.id('a-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataOptionsExtraClaims')).click();
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataOptionsExtraClaims/n2')).click();
element(by.id('hashkeyinput')).clear().sendKeys('MyClaim');
......
......@@ -7,7 +7,9 @@ describe('36 Lemonldap::NG Manager', function() {
describe('Diff interface', function() {
it('should find key changed', function() {
browser.get('/diff.html#!/6/7');
browser.get('/diff.html#!/5/6');
browser.sleep(5000);
element(by.id('t-generalParameters')).click();
element(by.id('t-advancedParams')).click();
element(by.id('t-security')).click();
......
......@@ -6,7 +6,7 @@ describe('40 Lemonldap::NG Manager', function() {
browser.get('/');
var links = element.all(by.repeater('l in links'));
expect(links.count()).toEqual(4);
element(by.xpath("//a[@href='sessions.html']")).click();
element.all(by.xpath("//a[@href='sessions.html']")).first().click();
});
});
......
exports.config = {
allScriptsTimeout: 11000,
allScriptsTimeout: 300000,
// Specific test
specs: process.env.E2E_TESTS,
// specs: process.env.E2E_TESTS,
// All tests
//specs: ['handler/*.js', 'portal/*.js', 'manager/*.js' ],
specs: ['portal/*.js', 'handler/*.js', 'manager/*.js' ],
capabilities: {
'browserName': 'chrome'
......@@ -17,6 +17,6 @@ exports.config = {
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
defaultTimeoutInterval: 60000
}
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment