Skip to content

Commit 0fa5eaf

Browse files
committed
fix(tests): Updated e2e config to include modules tests and fixed register and login tests
1 parent 13995b6 commit 0fa5eaf

4 files changed

Lines changed: 25 additions & 23 deletions

File tree

app/modules/cs_account/tests/e2e/register.test.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
// test if the register is working against a running back-end
2-
xdescribe('e2e: register', function() {
2+
describe( 'e2e: register', function() {
33

44
var ptor;
55
beforeEach(function() {
66
ptor = protractor.getInstance();
7-
ptor.get('/register');
7+
ptor.get( '/register' );
88
});
99

10-
it('should login with the default user account', function() {
11-
var email = element(by.model('credentials.username'));
12-
var password = element(by.model('credentials.password'));
13-
var passwordConfirmation = element(by.model('credentials.passwordConfirmation'));
10+
it( 'should login with the default user account', function() {
11+
var email = element( by.model( 'credentials.email' ) );
12+
var password = element( by.model( 'credentials.password' ) );
13+
var passwordConfirmation = element( by.model( 'credentials.passwordConfirmation' ) );
1414

15-
username.sendKeys('user1234');
16-
password.sendKeys('1234');
17-
passwordConfirmation.sendKeys('1234');
18-
ptor.findElement(protractor.By.css('button[type="submit"]')).click();
15+
email.sendKeys( 'user1234@email.com' );
16+
password.sendKeys( '1234' );
17+
passwordConfirmation.sendKeys( '1234' );
18+
19+
ptor.findElement( protractor.By.css( 'button[type="submit"]' ) ).click();
1920

20-
expect(ptor.findElement(protractor.By.tagName('h1')).getText())
21-
.toEqual('Users');
21+
expect( ptor.findElement( protractor.By.tagName( 'h1' ) ).getText() )
22+
.toEqual( 'Users' );
2223

2324
});
2425

app/modules/cs_session/tests/e2e/login.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
// test if the login is working against a running back-end
2-
xdescribe('e2e: login', function() {
2+
describe('e2e: login', function() {
33

44
var ptor;
55
beforeEach(function() {
66
ptor = protractor.getInstance();
7-
ptor.get('/login');
7+
ptor.get( '/login?redirect=users' );
88
});
99

1010
it('should login with the default user account', function() {
11-
var username = element(by.model('credentials.username'));
12-
var password = element(by.model('credentials.password'));
11+
var username = element( by.model( 'credentials.username' ) );
12+
var password = element( by.model( 'credentials.password' ) );
1313

14-
username.sendKeys('admin');
15-
password.sendKeys('1234');
16-
ptor.findElement(protractor.By.css('button[type="submit"]')).click();
14+
username.sendKeys( 'user1234@email.com' );
15+
password.sendKeys( '1234' );
16+
ptor.findElement( protractor.By.css( 'button[type="submit"]' ) ).click();
1717

18-
expect(ptor.findElement(protractor.By.tagName('h1')).getText())
19-
.toEqual('Users');
18+
expect( ptor.findElement( protractor.By.tagName('h1') ).getText() )
19+
.toEqual( 'Users' );
2020

2121
});
2222

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"email": "admin@cleverstack.io",
77
"web": "http://cleverstack.io"
88
},
9-
"version": "1.1.1",
9+
"version": "1.1.2",
1010
"collaborators": [
1111
"Richard Gustin <richard@clevertech.biz>",
1212
"Simon W. Jackson <simon@clevertech.biz>",

test-e2e.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ exports.config = {
4141
// Spec patterns are relative to the location of this config.
4242
specs: [
4343
'./test*/e2e/**/*.js',
44-
'./**/test*/e2e/**/*.js'
44+
'./**/test*/e2e/**/*.js',
45+
'./app/modules/**/test*/e2e/*.js'
4546
],
4647

4748
// ----- Capabilities to be passed to the webdriver instance ----

0 commit comments

Comments
 (0)