Commit a630f732 authored by Christophe Maudoux's avatar Christophe Maudoux 🐛

WIP - Fix Protractor e2e tests (#1600)

parent f0142fe8
Pipeline #3791 passed with stages
in 11 minutes and 8 seconds
......@@ -3,11 +3,36 @@
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('00 Lemonldap::NG', function() {
describe('Auth mechanism', function() {
it('Portal should display 10 lang flags', function() {
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
browser.driver.findElements(by.className('langicon')).then(function(elems) {
expect(elems.length).toEqual(11);
});
browser.driver.findElement(by.xpath("//img[@title='en']")).click();
expect(browser.driver.findElement(by.css('[trmsg="9"]')).getText()).toEqual('Authentication required');
expect(browser.driver.findElement(by.css('[trspan="createAccount"]')).getText()).toEqual('Create an account');
browser.driver.findElement(by.xpath("//img[@title='it']")).click();
expect(browser.driver.findElement(by.css('[trmsg="9"]')).getText()).toEqual('Autenticazione necessaria');
expect(browser.driver.findElement(by.css('[trspan="createAccount"]')).getText()).toEqual('Crea un account');
browser.driver.findElement(by.xpath("//img[@title='fr']")).click();
expect(browser.driver.findElement(by.css('[trspan="createAccount"]')).getText()).toEqual('Créer un compte');
});
it('should want to crete an account', function() {
browser.driver.findElement(by.css('[trspan="createAccount"]')).click();
expect(browser.driver.findElement(by.css('[trmsg="78"]')).getText()).toEqual('Merci de saisir vos informations');
// A four inputs form + one captcha
browser.driver.findElements(by.className('input-group')).then(function(elems) {
expect(elems.length).toEqual(4);
});
browser.driver.findElements(by.className('img-thumbnail')).then(function(elems) {
expect(elems.length).toEqual(1);
});
});
it('should want to authenticate', function() {
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
expect(browser.driver.findElement(by.css('[trspan="back2Portal"]')).getText()).toEqual('Retourner au portail');
browser.driver.findElement(by.css('[trspan="back2Portal"]')).click();
browser.driver.findElement(by.xpath("//input[@name='user']")).sendKeys('dwho');
browser.driver.findElement(by.xpath("//input[@name='password']")).sendKeys('dwho');
browser.driver.findElement(by.xpath("//button[@type='submit']")).click();
......
......@@ -87,8 +87,7 @@ describe('01 Lemonldap::NG Manager', 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);
expect(element.all(by.id('hashkeyinput')).count()).toEqual(1);
});
// Issuer Modules
it('Main => should display 12 main nodes', function() {
......
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