Skip to content

Commit

Permalink
Fix user response
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Oct 30, 2024
1 parent 6b36b0e commit 5c406d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ describe('Cluster Dashboard', { testIsolation: 'off', tags: ['@explorer', '@admi
beforeEach(() => {
stdProjectName = `standard-user-project${ +new Date() }`;
stdNsName = `standard-user-ns${ +new Date() }`;
stdUsername = `standard-user-${ +new Date() }`;
stdUsername = `standard-user`;
const password = Cypress.env('password');

// log in as admin
Expand All @@ -327,9 +327,8 @@ describe('Cluster Dashboard', { testIsolation: 'off', tags: ['@explorer', '@admi
clusterId: 'local', projectName: stdProjectName, role: 'project-owner'
},
password
}).as('createUserRequest').then(() => {
cy.wait(2000); // TEST

}).as('createUserRequest').then((resp) => {
stdUsername = resp.body.name;
// log in as new standard user
cy.login(stdUsername, password, false);

Expand Down
4 changes: 4 additions & 0 deletions cypress/support/commands/rancher-api-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ Cypress.Commands.add('createUser', (params: CreateUserParams) => {

return cy.setProjectRoleBinding(clusterId, userPrincipalId, projectName, role);
}
})
.then(() => {
// return response of original user
return resp;
});
}
}
Expand Down

0 comments on commit 5c406d6

Please sign in to comment.