Skip to content

Commit 564c41e

Browse files
author
Henderson Hummel
authored
Add test for AAH-160 (#301)
The change in commands.js was simply a missing parenthesis, and the change in package.json is just whitespace (seems like it was automated, I don't remember making that change.)
1 parent 78ec70d commit 564c41e

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

test/cypress/integration/profile.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
describe('My Profile Tests', () => {
2+
var host = Cypress.env('host');
3+
var adminUsername = Cypress.env('username');
4+
var adminPassword = Cypress.env('password');
5+
6+
beforeEach(() => {
7+
cy.visit(host);
8+
cy.login(adminUsername, adminPassword);
9+
// open the dropdown labeled with the username and then...
10+
cy.get('[aria-label="user-dropdown"] button').click();
11+
// a little hacky, but basically
12+
// just click the one link that says 'My profile'.
13+
cy.get('a').contains('My profile').click();
14+
});
15+
16+
it('only has input fields for name, email, username, password and pass confirmation', () => {
17+
let inputs = ['first_name', 'last_name', 'email', 'username', 'password', 'password-confirm'];
18+
cy.get('.body').within(() => {
19+
cy.get('input').each(($el, index, $list) => {
20+
expect(inputs).to.include($el.attr('id'));
21+
});
22+
});
23+
});
24+
});

test/cypress/support/commands.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Cypress.Commands.add('createUser', {}, (username, password = null, firstName = n
8383
cy.wait('@createUser');
8484
});
8585

86-
Cypress.Commands.add('createGroup', {}, (name => {
86+
Cypress.Commands.add('createGroup', {}, (name) => {
8787
cy.contains('#page-sidebar a', 'Groups').click();
8888

8989
cy.contains('Create').click();

test/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
8-
"cypress:chrome":"cypress run --browser chrome --headless",
9-
"cypress:chromium":"cypress run --browser chromium-browser --headless",
10-
"cypress:firefox":"cypress run --browser firefox --headless",
11-
"cypress":"cypress open"
8+
"cypress:chrome": "cypress run --browser chrome --headless",
9+
"cypress:chromium": "cypress run --browser chromium-browser --headless",
10+
"cypress:firefox": "cypress run --browser firefox --headless",
11+
"cypress": "cypress open"
1212
},
1313
"author": "",
1414
"license": "ISC",

0 commit comments

Comments
 (0)