lemonldap-ng/e2e-tests/handler/01-redirect.js

23 lines
1.0 KiB
JavaScript
Raw Normal View History

2016-02-03 13:42:12 +01:00
'use strict';
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('Lemonldap::NG', function() {
describe('Redirection mechanism', function() {
it('should redirect to portal', function() {
browser.ignoreSynchronization = true;
browser.driver.get('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/');
expect(browser.getCurrentUrl()).toEqual('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tOjE5ODc2Lw==');
});
it('should accept authentication as dwho/dwho', function() {
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();
});
it('should redirect to test1.example.com', function() {
expect(browser.getCurrentUrl()).toContain('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/');
});
});
});