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 + '/');
2016-02-09 13:18:59 +01:00
expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://auth.example.com(:' + process.env.TESTWEBSERVERPORT + ')?/\\?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tOjE5ODc2Lw=='));
2016-02-03 13:42:12 +01:00
});
2016-04-25 09:39:58 +02:00
it('should accept authentication as dwho/dwho', function() {
2016-02-03 13:42:12 +01:00
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()).toMatch(new RegExp('^http://test1.example.com(:' + process.env.TESTWEBSERVERPORT + ')?'));
2016-02-03 13:42:12 +01:00
});
});
2016-04-29 09:27:26 +02:00
});