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
2 changes: 1 addition & 1 deletion chaoscenter/cypress/e2e/REST APIs/UserManagment.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Test Cases for User-Management', () => {
const edit_payload = {
username: user.username,
oldPassword: '',
newPassword: '1'
newPassword: '!Qwer1234'
};

cy.request({
Expand Down
8 changes: 4 additions & 4 deletions chaoscenter/cypress/e2e/REST APIs/chaosProbes.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('Testing http chaos Probes', () => {
}
}).then((response) => {
expect(response.status).to.equal(200);
expect(response.body.errors[0].message).to.equal('write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp1111" }]');
expect(response.body.errors[0].message).to.contain('write exception: write errors: [E11000 duplicate key error collection:');
});
});

Expand Down Expand Up @@ -276,7 +276,7 @@ describe('testing CMD chaos probes', () => {
},
}).then((response) => {
expect(response.status).to.equal(200);
expect(response.body.errors[0].message).to.equal('write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp2222" }]');
expect(response.body.errors[0].message).to.contain('write exception: write errors: [E11000 duplicate key error collection:');
});
});

Expand Down Expand Up @@ -473,7 +473,7 @@ describe('testing prometheus chaos probes', () => {
},
}).then((response) => {
expect(response.status).to.equal(200);
expect(response.body.errors[0].message).to.equal('write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp3333" }]');
expect(response.body.errors[0].message).to.contain('write exception: write errors: [E11000 duplicate key error collection:');
});
});

Expand Down Expand Up @@ -667,7 +667,7 @@ describe('testing kubernetes chaos probes', () => {
},
}).then((response) => {
expect(response.status).to.equal(200);
expect(response.body.errors[0].message).to.equal('write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp4444" }]');
expect(response.body.errors[0].message).to.contain('write exception: write errors: [E11000 duplicate key error collection:');

});
});
Expand Down
3 changes: 3 additions & 0 deletions chaoscenter/cypress/e2e/REST APIs/chaoshub.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('testing chaoshub', () => {
request: {
name: 'testing',
repoBranch: 'master',
remoteHub: 'GitHub',
description: '',
tags: [],
authType: 'NONE',
Expand Down Expand Up @@ -82,6 +83,7 @@ describe('testing chaoshub', () => {
request: {
name: 'testing',
repoBranch: 'master',
remoteHub: 'Github',
description: '',
tags: [],
authType: 'NONE',
Expand Down Expand Up @@ -118,6 +120,7 @@ describe('testing chaoshub', () => {
id: hubID,
name: 'sample',
repoBranch: 'master',
remoteHub: 'GitHub',
description: '',
authType: 'NONE',
isPrivate: false,
Expand Down
8 changes: 5 additions & 3 deletions chaoscenter/cypress/e2e/REST APIs/chaosinfra.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ describe('testing chaosinfra via REST APIs', () => {
url: '/api/query',
body: registerInfra_payload,
headers: {
Authorization: `Bearer ${accessToken}`
Authorization: `Bearer ${accessToken}`,
Referer: 'https://localhost:3000/'
}
}).then((response) => {
expect(response.status).to.equal(200);
Expand Down Expand Up @@ -135,7 +136,7 @@ describe('testing chaosinfra via REST APIs', () => {
}
}).then((response) => {
expect(response.status).to.equal(200);
expect(response.body.errors[0].message).to.equal('write exception: write errors: [E11000 duplicate key error collection: litmus.environment index: environment_id_1 dup key: { environment_id: "exp99" }]');
expect(response.body.errors[0].message).to.contain('write exception: write errors: [E11000 duplicate key error collection:');
});
});

Expand All @@ -159,7 +160,8 @@ describe('testing chaosinfra via REST APIs', () => {
method: 'POST',
url: '/api/query',
headers: {
Authorization: `Bearer ${accessToken}`
Authorization: `Bearer ${accessToken}`,
Referer: 'https://localhost:3000/'
},
body: updateInfra_payload,
}).then((response) => {
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/cypress/e2e/REST APIs/login.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Testing login page of chaoscenter via REST APIs', () => {
password: 'invalid_password',
},
}).then((response) => {
expect(response.status).to.equal(400);
expect(response.status).to.equal(401);
expect(response.body.error).to.equal('invalid_credentials');
});
})
Expand Down
4 changes: 2 additions & 2 deletions chaoscenter/cypress/e2e/UI/Usermanagment.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ describe('testing for User management', () => {
cy.wrap(buttons[buttons.length - 1]).click();
});
cy.contains('Reset Password').click();
cy.get('input[name="password"]').type('22222');
cy.get('input[name="reEnterPassword"]').type('22222');
cy.get('input[name="password"]').type(user.resetpassword);
cy.get('input[name="reEnterPassword"]').type(user.resetpassword);
cy.intercept('POST','/auth/reset/password').as('reset');
cy.contains('Confirm').click();
cy.wait('@reset');
Expand Down
4 changes: 4 additions & 0 deletions chaoscenter/cypress/e2e/UI/chaoshub.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ describe('testing chaoshub via UI', () => {
cy.contains('Continue').click();
cy.get('input[name="repoURL"]').type('https://github.com/litmuschaos/chaos-charts.git');
cy.get('input[name="repoBranch"]').type('master');
cy.get('div[data-testid = "dropdown-button"]').click();
cy.contains('GitHub').click();
cy.intercept('POST','/api/query').as('Query');
cy.get('button[aria-label = "Connect Hub"]').click();
cy.wait('@Query');
Expand All @@ -36,6 +38,8 @@ describe('testing chaoshub via UI', () => {
cy.contains('Continue').click();
cy.get('input[name="repoURL"]').type('1');
cy.get('input[name="repoBranch"]').type('1');
cy.get('div[data-testid = "dropdown-button"]').click();
cy.contains('GitHub').click();
cy.get('button[aria-label = "Connect Hub"]').click();
cy.on('window:alert', () => {
expect(message).to.equal('name already exists');
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/cypress/e2e/UI/chaosinfra.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('testing chaosinfra via UI', () => {
cy.get('input[name="name"]').type('exp99');
cy.contains('Save').click();
cy.on('alert message', () => {
expect(message).to.equal('write exception: write errors: [E11000 duplicate key error collection: litmus.environment index: environment_id_1 dup key: { environment_id: "exp99" }]');
expect(message).to.contain('write exception: write errors: [E11000 duplicate key error collection:');
});
});

Expand Down
2 changes: 2 additions & 0 deletions chaoscenter/cypress/fixtures/Users.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
"user1": {
"username": "user1",
"password": "user1",
"resetpassword": "!Qwer1234",
"role": "user",
"email": "[email protected]",
"name": "Test Account 1"
},
"user2": {
"username": "user2",
"password": "user2",
"resetpassword": "!Qwer1234",
"role": "user",
"email": "[email protected]",
"name": "Test Account 2"
Expand Down
3 changes: 3 additions & 0 deletions chaoscenter/cypress/fixtures/chaoshub.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const add_hub = `
name
repoURL
repoBranch
remoteHub
hubType
isPrivate
__typename
Expand All @@ -17,6 +18,7 @@ export const update_hub =`
name
repoURL
repoBranch
remoteHub
__typename
}
}
Expand All @@ -33,6 +35,7 @@ export const list_hub = `
id
repoURL
repoBranch
remoteHub
authType
isAvailable
totalFaults
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Package for Testing",
"main": "index.js",
"scripts": {
"start": "cypress run",
"start": "cypress run"
},
"devDependencies": {
"cypress": "^13.7.0",
Expand Down