diff --git a/chaoscenter/cypress/e2e/REST APIs/UserManagment.cy.js b/chaoscenter/cypress/e2e/REST APIs/UserManagment.cy.js index 4fd3f5cfa..c216d5834 100644 --- a/chaoscenter/cypress/e2e/REST APIs/UserManagment.cy.js +++ b/chaoscenter/cypress/e2e/REST APIs/UserManagment.cy.js @@ -65,7 +65,7 @@ describe('Test Cases for User-Management', () => { const edit_payload = { username: user.username, oldPassword: '', - newPassword: '1' + newPassword: '!Qwer1234' }; cy.request({ diff --git a/chaoscenter/cypress/e2e/REST APIs/chaosProbes.cy.js b/chaoscenter/cypress/e2e/REST APIs/chaosProbes.cy.js index 8b59ef1a9..a60c3b0f3 100644 --- a/chaoscenter/cypress/e2e/REST APIs/chaosProbes.cy.js +++ b/chaoscenter/cypress/e2e/REST APIs/chaosProbes.cy.js @@ -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:'); }); }); @@ -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:'); }); }); @@ -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:'); }); }); @@ -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:'); }); }); diff --git a/chaoscenter/cypress/e2e/REST APIs/chaoshub.cy.js b/chaoscenter/cypress/e2e/REST APIs/chaoshub.cy.js index 60bc50a2c..26989961e 100644 --- a/chaoscenter/cypress/e2e/REST APIs/chaoshub.cy.js +++ b/chaoscenter/cypress/e2e/REST APIs/chaoshub.cy.js @@ -25,6 +25,7 @@ describe('testing chaoshub', () => { request: { name: 'testing', repoBranch: 'master', + remoteHub: 'GitHub', description: '', tags: [], authType: 'NONE', @@ -82,6 +83,7 @@ describe('testing chaoshub', () => { request: { name: 'testing', repoBranch: 'master', + remoteHub: 'Github', description: '', tags: [], authType: 'NONE', @@ -118,6 +120,7 @@ describe('testing chaoshub', () => { id: hubID, name: 'sample', repoBranch: 'master', + remoteHub: 'GitHub', description: '', authType: 'NONE', isPrivate: false, diff --git a/chaoscenter/cypress/e2e/REST APIs/chaosinfra.cy.js b/chaoscenter/cypress/e2e/REST APIs/chaosinfra.cy.js index 36935d4b9..79c9b7803 100644 --- a/chaoscenter/cypress/e2e/REST APIs/chaosinfra.cy.js +++ b/chaoscenter/cypress/e2e/REST APIs/chaosinfra.cy.js @@ -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); @@ -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:'); }); }); @@ -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) => { diff --git a/chaoscenter/cypress/e2e/REST APIs/login.cy.js b/chaoscenter/cypress/e2e/REST APIs/login.cy.js index 13adb97a6..c9b62e730 100644 --- a/chaoscenter/cypress/e2e/REST APIs/login.cy.js +++ b/chaoscenter/cypress/e2e/REST APIs/login.cy.js @@ -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'); }); }) diff --git a/chaoscenter/cypress/e2e/UI/Usermanagment.cy.js b/chaoscenter/cypress/e2e/UI/Usermanagment.cy.js index 3c83da568..1ad75901a 100644 --- a/chaoscenter/cypress/e2e/UI/Usermanagment.cy.js +++ b/chaoscenter/cypress/e2e/UI/Usermanagment.cy.js @@ -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'); diff --git a/chaoscenter/cypress/e2e/UI/chaoshub.cy.js b/chaoscenter/cypress/e2e/UI/chaoshub.cy.js index 863f38a5e..c6a8f7d71 100644 --- a/chaoscenter/cypress/e2e/UI/chaoshub.cy.js +++ b/chaoscenter/cypress/e2e/UI/chaoshub.cy.js @@ -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'); @@ -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'); diff --git a/chaoscenter/cypress/e2e/UI/chaosinfra.cy.js b/chaoscenter/cypress/e2e/UI/chaosinfra.cy.js index 4a3c435f7..ac3265e69 100644 --- a/chaoscenter/cypress/e2e/UI/chaosinfra.cy.js +++ b/chaoscenter/cypress/e2e/UI/chaosinfra.cy.js @@ -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:'); }); }); diff --git a/chaoscenter/cypress/fixtures/Users.json b/chaoscenter/cypress/fixtures/Users.json index 8f4300dbd..95de11aff 100644 --- a/chaoscenter/cypress/fixtures/Users.json +++ b/chaoscenter/cypress/fixtures/Users.json @@ -2,6 +2,7 @@ "user1": { "username": "user1", "password": "user1", + "resetpassword": "!Qwer1234", "role": "user", "email": "user1@litmus.com", "name": "Test Account 1" @@ -9,6 +10,7 @@ "user2": { "username": "user2", "password": "user2", + "resetpassword": "!Qwer1234", "role": "user", "email": "user2@litmus.com", "name": "Test Account 2" diff --git a/chaoscenter/cypress/fixtures/chaoshub.js b/chaoscenter/cypress/fixtures/chaoshub.js index efa57ae13..9fe97ea52 100644 --- a/chaoscenter/cypress/fixtures/chaoshub.js +++ b/chaoscenter/cypress/fixtures/chaoshub.js @@ -4,6 +4,7 @@ export const add_hub = ` name repoURL repoBranch + remoteHub hubType isPrivate __typename @@ -17,6 +18,7 @@ export const update_hub =` name repoURL repoBranch + remoteHub __typename } } @@ -33,6 +35,7 @@ export const list_hub = ` id repoURL repoBranch + remoteHub authType isAvailable totalFaults diff --git a/chaoscenter/package.json b/chaoscenter/package.json index 711afdb01..341d16fc9 100644 --- a/chaoscenter/package.json +++ b/chaoscenter/package.json @@ -4,7 +4,7 @@ "description": "Package for Testing", "main": "index.js", "scripts": { - "start": "cypress run", + "start": "cypress run" }, "devDependencies": { "cypress": "^13.7.0",