mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-27 18:36:08 +00:00
Fix UI :- Cypress issue for User and Bot creation (#7785)
* Fix cypress issue for User and Bot creation * changes as per comments * cypress for user and bot * added cypress for bot
This commit is contained in:
parent
75953df386
commit
8bb7219826
@ -509,7 +509,14 @@ export const addUser = (username, email) => {
|
||||
.should('exist')
|
||||
.should('be.visible')
|
||||
.type('Adding user');
|
||||
interceptURL('GET', ' /api/v1/users/generateRandomPwd', 'generatePassword');
|
||||
cy.get('[data-testid="password-generator"]')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
verifyResponseStatusCode('@generatePassword', 200);
|
||||
interceptURL('POST', ' /api/v1/users', 'add-user');
|
||||
cy.get('[data-testid="save-user"]').scrollIntoView().click();
|
||||
verifyResponseStatusCode('@add-user', 201);
|
||||
};
|
||||
|
||||
export const softDeleteUser = (username) => {
|
||||
|
@ -65,8 +65,14 @@ describe('Bots Page should work properly', () => {
|
||||
cy.get('[data-testid="displayName"]').should('exist').type(botName);
|
||||
//Enter description
|
||||
cy.get(descriptionBox).type(description);
|
||||
interceptURL('POST', '/api/v1/bots', 'createBot');
|
||||
//Generate Password
|
||||
interceptURL('GET', ' /api/v1/users/generateRandomPwd', 'generatePassword');
|
||||
cy.get('[data-testid="password-generator"]')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
verifyResponseStatusCode('@generatePassword', 200);
|
||||
//Click on save button
|
||||
interceptURL('POST', '/api/v1/bots', 'createBot');
|
||||
cy.get('[data-testid="save-user"]')
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
|
@ -11,7 +11,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { addUser, deleteSoftDeletedUser, login, restoreUser, softDeleteUser, uuid } from '../../common/common';
|
||||
import { addUser, deleteSoftDeletedUser, interceptURL, login, restoreUser, softDeleteUser, uuid, verifyResponseStatusCode } from '../../common/common';
|
||||
import { LOGIN } from '../../constants/constants';
|
||||
|
||||
const userName = `Usercttest${uuid()}`;
|
||||
@ -29,6 +29,7 @@ describe('Users flow should work properly', () => {
|
||||
.should('exist')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
interceptURL('GET', '/api/v1/users?fields=profile,teams,roles&&isBot=false&limit=15', 'getUsers');
|
||||
cy.get('.ant-menu-title-content')
|
||||
.contains('Users')
|
||||
.should('exist')
|
||||
@ -41,6 +42,7 @@ describe('Users flow should work properly', () => {
|
||||
cy.get('.ant-btn').contains('Add User').click();
|
||||
|
||||
addUser(userName, userEmail);
|
||||
verifyResponseStatusCode('@getUsers', 200);
|
||||
|
||||
//Validate if user is added in the User tab
|
||||
|
||||
@ -74,6 +76,7 @@ describe('Admin flow should work properly', () => {
|
||||
.should('exist')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
interceptURL('GET', '/api/v1/users?fields=profile,teams,roles&&isAdmin=true&isBot=false&limit=15', 'getAdmins');
|
||||
cy.get('.ant-menu-title-content')
|
||||
.contains('Admins')
|
||||
.should('exist')
|
||||
@ -93,6 +96,7 @@ describe('Admin flow should work properly', () => {
|
||||
.click();
|
||||
|
||||
addUser(adminName, adminEmail);
|
||||
verifyResponseStatusCode('@getAdmins', 200);
|
||||
|
||||
//Validate if user is added in the User tab
|
||||
|
||||
|
@ -842,6 +842,7 @@ const CreateUser = ({
|
||||
<div className="flex-center w-16">
|
||||
<div
|
||||
className="w-8 h-7 flex-center cursor-pointer"
|
||||
data-testid="password-generator"
|
||||
onClick={generateRandomPassword}>
|
||||
{isPasswordGenerating ? (
|
||||
<Loader size="small" type="default" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user