blob: cab3b15134f557dc8d64941ce83407b5f7670b2f [file] [log] [blame]
Matteo Scandolo583234d2017-04-20 14:33:04 -07001const config = require('../test_helpers/config');
2const user = require('../test_helpers/user');
3const pwd = user.pwd;
4const username = user.username;
5const loginPage = require('./login.po');
6
7describe('XOS Login page', function() {
8
9 beforeEach(() => {
10 browser.get(`${config.url}/login`);
11 });
12
13 it('should not login with a wrong password', function() {
14 loginPage.sendUsername(username);
15 loginPage.sendPassword('wrongpwd');
16 loginPage.submit();
17
18 const alert = element(by.css('.alert.alert-danger'));
19 expect(alert.isDisplayed()).toBeTruthy();
20 });
21
22 it('should login', () => {
23 loginPage.sendUsername(username);
24 loginPage.sendPassword(pwd);
25 loginPage.submit();
26
27 expect(browser.getCurrentUrl()).toEqual(`${config.url}/dashboard`);
28 });
29});