WIP - Improve e2e tests (#1600)

This commit is contained in:
Christophe Maudoux 2019-01-12 21:51:12 +01:00
parent b656f7d460
commit 1ebe67cf34
3 changed files with 13 additions and 4 deletions

View File

@ -56,7 +56,7 @@ describe('10 Lemonldap::NG', function() {
// Back to Portal
links[3].click();
browser.driver.findElement(by.xpath("//button[@type='button']")).click();
browser.sleep(1000);
browser.sleep(500);
expect(browser.driver.findElement(by.css('[trspan="yourApps"]')).getText()).toEqual('Vos applications');
});
});

View File

@ -3,9 +3,17 @@
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('99 Lemonldap::NG auth mechanism', function() {
it('should allow logout', function() {
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/?logout=1');
browser.driver.findElements(by.xpath('//li/a/span/img')).then(function(links) {
expect(links.length).toEqual(4);
links[3].click();
browser.sleep(1000);
expect(browser.driver.findElement(by.css('[trspan="areYouSure"]')).getText()).toEqual('Êtes-vous sûr ?');
browser.driver.findElement(by.css('[trspan="imSure"]')).click();
expect(browser.driver.findElement(by.css('[trmsg="47"]')).getText()).toEqual('Vous avez été déconnecté');
browser.sleep(500);
browser.driver.findElement(by.css('[trspan="goToPortal"]')).click();
expect(browser.driver.findElement(by.css('[trmsg="9"]')).getText()).toEqual('Veuillez vous authentifier');
});
});
});

View File

@ -7,6 +7,7 @@ exports.config = {
//specs: ['handler/*.js', 'portal/*.js', 'manager/*.js' ],
capabilities: {
//'browserName': 'firefox'
'browserName': 'chrome'
},