Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ node_modules/
cypress/screenshots/
cypress/downloads/
cypress/fixtures/tmp_individuals.csv
.DS_Store
./*.DS_Store
./.DS_Store
1 change: 1 addition & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module.exports = defineConfig({
defaultCommandTimeout: 15000,
taskTimeout: timeoutMinutes * 60 * 1000 + 10,
downloadsFolder: 'cypress/downloads',
keystrokeDelay: 100,
setupNodeEvents(on, config) {
on('task', {
checkSetup() {
Expand Down
30 changes: 30 additions & 0 deletions cypress/e2e/user.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { UserPage } from "../support/pages/UserPage";

describe('Test for user management', () => {
let data;
const userPage = new UserPage();

before(() => {
cy.fixture('user').then((fixture) => {
data = fixture;
});
});

beforeEach(() => {
cy.login();
});

afterEach(function () {
if (this.currentTest.state === 'failed') return;
userPage.filterByVillage();
});

it('user management workflow', () => {
userPage.addUser(data.user);
userPage.verifyUser(data.user);
userPage.updateUser('Last name', "Joseph");
userPage.deleteUser(data.user.username);
cy.searchInput('User name', data.user.username);
cy.contains('td',data.user.username).should('not.exist');
});
})
15 changes: 15 additions & 0 deletions cypress/fixtures/user.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"user": {
"username": "cypress",
"lastname": "test",
"givenname": "cypress",
"email": "test@gmail.com",
"phone": "654327896",
"healthFacility": "JMHOS001 Jambero District Hospital",
"roles":["Enrolment Officer","Medical Officer", "Claim Administrator", "Manager"],
"password": "trdfc23.Y"
},
"filters": {
"village": "R2D1M1V1 Utha"
}
}
Loading