Commit 1ebe67cf authored by Christophe Maudoux's avatar Christophe Maudoux

WIP - Improve e2e tests (#1600)

parent b656f7d4
...@@ -56,7 +56,7 @@ describe('10 Lemonldap::NG', function() { ...@@ -56,7 +56,7 @@ describe('10 Lemonldap::NG', function() {
// Back to Portal // Back to Portal
links[3].click(); links[3].click();
browser.driver.findElement(by.xpath("//button[@type='button']")).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'); expect(browser.driver.findElement(by.css('[trspan="yourApps"]')).getText()).toEqual('Vos applications');
}); });
}); });
......
...@@ -3,9 +3,17 @@ ...@@ -3,9 +3,17 @@
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */ /* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('99 Lemonldap::NG auth mechanism', function() { describe('99 Lemonldap::NG auth mechanism', function() {
it('should allow logout', 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');
});
}); });
}); });
\ No newline at end of file
...@@ -7,6 +7,7 @@ exports.config = { ...@@ -7,6 +7,7 @@ exports.config = {
//specs: ['handler/*.js', 'portal/*.js', 'manager/*.js' ], //specs: ['handler/*.js', 'portal/*.js', 'manager/*.js' ],
capabilities: { capabilities: {
//'browserName': 'firefox'
'browserName': 'chrome' 'browserName': 'chrome'
}, },
......
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