diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js index 00cea29d2e3..02702002969 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -49,7 +49,7 @@ export const handleIngestionRetry = ( ) => { const rowIndex = ingestionType === 'metadata' ? 1 : 2; // ingestions page - const retryTimes = 25; + const retryTimes = 30; let retryCount = count; const testIngestionsTab = () => { cy.get('[data-testid="Ingestions"]').should('be.visible'); @@ -144,7 +144,7 @@ export const testServiceCreationAndIngestion = ( // Test the connection cy.get('[data-testid="test-connection-btn"]').should('exist'); cy.get('[data-testid="test-connection-btn"]').click(); - cy.wait(1000); + cy.wait(5000); cy.contains('Connection test was successful').should('exist'); cy.get('[data-testid="submit-btn"]').should('exist').click(); @@ -473,7 +473,7 @@ export const softDeleteUser = (username) => { verifyResponseStatusCode('@searchUser', 200); //Click on delete button - cy.get('.ant-table-row .ant-table-cell button') + cy.get(`[data-testid="delete-user-btn-${username}"]`) .should('exist') .should('be.visible') .click(); @@ -524,7 +524,10 @@ export const restoreUser = (username) => { cy.get('.ant-switch-handle').should('exist').should('be.visible').click(); verifyResponseStatusCode('@deletedUser', 200); - cy.get('button [alt="Restore"]').should('exist').should('be.visible').click(); + cy.get(`[data-testid="restore-user-btn-${username}"]`) + .should('exist') + .should('be.visible') + .click(); cy.get('.ant-modal-body > p').should( 'contain', `Are you sure you want to restore ${username}?` @@ -564,7 +567,10 @@ export const deleteSoftDeletedUser = (username) => { cy.wait(1000); - cy.get('button [alt="Delete"]').should('exist').should('be.visible').click(); + cy.get(`[data-testid="delete-user-btn-${username}"]`) + .should('exist') + .should('be.visible') + .click(); cy.get('[data-testid="confirmation-text-input"]').type('DELETE'); cy.get('[data-testid="confirm-button"]') .should('exist') @@ -584,15 +590,6 @@ export const deleteSoftDeletedUser = (username) => { .should('be.visible') .click(); - cy.get('.ant-table-placeholder > .ant-table-cell').should( - 'not.contain', - username - ); - - cy.get('.ant-table-placeholder > .ant-table-cell') - .should('be.visible') - .click(); - cy.get('[data-testid="searchbar"]') .should('exist') .should('be.visible') @@ -813,9 +810,7 @@ export const login = (username, password) => { export const addTeam = (TEAM_DETAILS) => { interceptURL('GET', '/api/v1/teams*', 'addTeam'); //Fetching the add button and clicking on it - cy.get('[data-testid="add-team"]') - .should('be.visible') - .click(); + cy.get('[data-testid="add-team"]').should('be.visible').click(); verifyResponseStatusCode('@addTeam', 200); @@ -920,14 +915,14 @@ export const updateDescriptionForIngestedTables = ( .should('be.visible') .should('have.class', 'active'); interceptURL('GET', `/api/v1/permissions/*/*`, 'getEntityDetails'); - cy.get('[data-testid="table-link"]').first().click(); + cy.get('[data-testid="table-link"]').should('contain', tableName).click(); verifyResponseStatusCode('@getEntityDetails', 200); //update description cy.get('[data-testid="edit-description"]') .should('be.visible') .click({ force: true }); - cy.get(descriptionBox).should('be.visible').clear().type(description); + cy.get(descriptionBox).should('be.visible').click().clear().type(description); interceptURL('PATCH', '/api/v1/*/*', 'updateEntity'); cy.get('[data-testid="save"]').click(); verifyResponseStatusCode('@updateEntity', 200); @@ -941,7 +936,7 @@ export const updateDescriptionForIngestedTables = ( interceptURL( 'GET', - `/api/v1/services/*/name/${serviceName}*`, + `/api/v1/services/ingestionPipelines?fields=owner,pipelineStatuses&service=${serviceName}`, 'getSelectedService' ); @@ -961,6 +956,10 @@ export const updateDescriptionForIngestedTables = ( ); cy.get('[data-testid="run"]').should('be.visible').click(); verifyResponseStatusCode('@checkRun', 200); + + //Close the toast message + cy.get('.Toastify__close-button').should('be.visible').click(); + //Wait for success retryIngestionRun(); @@ -973,8 +972,8 @@ export const updateDescriptionForIngestedTables = ( .should('have.class', 'active'); cy.get('[data-testid="table-link"]').first().click(); verifyResponseStatusCode('@getEntityDetails', 200); - cy.get('[data-testid="description"] > [data-testid="viewer-container"] ') + cy.get('[data-testid="markdown-parser"]') .first() .invoke('text') - .should('eq', description); + .should('contain', description); }; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/bigquery.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/bigquery.spec.js index 35f7601d293..b05b7b1abac 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/bigquery.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/bigquery.spec.js @@ -16,7 +16,7 @@ import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'BigQuery'; const serviceName = `${serviceType}-ct-test-${uuid()}`; -const tableName = 'augcustomers'; +const tableName = 'personsx'; const description = `This is ${serviceName} description`; describe('BigQuery Ingestion', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/kafka.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/kafka.spec.js index fd704b83386..5491b07d6a6 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/kafka.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/kafka.spec.js @@ -16,7 +16,7 @@ import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Kafka'; const serviceName = `${serviceType}-ct-test-${uuid()}`; -const tableName = '__consumer_offsets'; +const topicName = '__transaction_state'; const description = `This is ${serviceName} description`; describe('Kafka Ingestion', () => { @@ -45,7 +45,7 @@ describe('Kafka Ingestion', () => { .check(); cy.get('[data-testid="filter-pattern-includes-topic"]') .should('be.visible') - .type('__consumer_offsets'); + .type(topicName); }; testServiceCreationAndIngestion( @@ -60,7 +60,7 @@ describe('Kafka Ingestion', () => { it('Update table description and verify', () => { updateDescriptionForIngestedTables( serviceName, - tableName, + topicName, description, SERVICE_TYPE.Messaging, 'topics' diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/metabase.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/metabase.spec.js index 872d9ab30e5..08e666e0bd2 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/metabase.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/metabase.spec.js @@ -16,7 +16,7 @@ import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Metabase'; const serviceName = `${serviceType}-ct-test-${uuid()}`; -const tableName = 'Customers Dashboard'; +const tableName = 'jaffle_shop'; const description = `This is ${serviceName} description`; describe('Metabase Ingestion', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/mysql.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/mysql.spec.js index 470479ac6f2..46eeadb7ab7 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/mysql.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/mysql.spec.js @@ -12,11 +12,11 @@ */ import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, mySqlConnectionInput, testServiceCreationAndIngestion, updateDescriptionForIngestedTables, uuid } from '../../common/common'; -import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; +import { LOGIN, SERVICE_TYPE, TEAM_ENTITY } from '../../constants/constants'; const serviceType = 'Mysql'; const serviceName = `${serviceType}-ct-test-${uuid()}`; -const tableName = 'DATABASE_CHANGE_LOG'; +const tableName = TEAM_ENTITY; const description = `This is ${tableName} description`; describe('MySQL Ingestion', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/snowflake.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/snowflake.spec.js index e0b04e08f28..187390589c8 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/snowflake.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/snowflake.spec.js @@ -38,7 +38,7 @@ describe('Snowflake Ingestion', () => { cy.get('[data-testid="schema-filter-pattern-checkbox"]').check(); cy.get('[data-testid="filter-pattern-includes-schema"]') .should('be.visible') - .type('public'); + .type('PUBLIC'); }; testServiceCreationAndIngestion( diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/superset.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/superset.spec.js index ecdf58ede69..c0b1d3bc435 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/superset.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/superset.spec.js @@ -16,7 +16,7 @@ import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Superset'; const serviceName = `${serviceType}-ct-test-${uuid()}`; -const tableName = 'NEW DASHBOARD'; +const tableName = "World Bank's Data"; const description = `This is ${serviceName} description`; describe('Superset Ingestion', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddTeamAsOwner.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddTeamAsOwner.spec.js index 59eff5dcc8e..1132950ba14 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddTeamAsOwner.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddTeamAsOwner.spec.js @@ -12,7 +12,7 @@ */ import { addTeam, interceptURL, login, searchEntity, uuid, verifyResponseStatusCode } from "../../common/common"; -import { LOGIN } from "../../constants/constants"; +import { LOGIN, SEARCH_ENTITY_TABLE } from "../../constants/constants"; const teamName = `team-group-test-${uuid()}`; @@ -21,7 +21,7 @@ const TEAM_DETAILS = { displayName: teamName, teamType: 'Group', description: `This is ${teamName} description`, - assetName: 'fact_sale', + assetName: SEARCH_ENTITY_TABLE.table_1.term, }; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/TotalCountForTeams&Users.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/TotalCountForTeams&Users.spec.js index ec719928081..b01ab7a6266 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/TotalCountForTeams&Users.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/TotalCountForTeams&Users.spec.js @@ -11,47 +11,60 @@ * limitations under the License. */ -import { interceptURL, login, searchEntity, verifyResponseStatusCode } from "../../common/common"; -import { LOGIN } from "../../constants/constants"; +import { interceptURL, login, searchEntity, verifyResponseStatusCode } from '../../common/common'; +import { LOGIN, SEARCH_ENTITY_TABLE } from '../../constants/constants'; -const assetName = "fact_sale" -const token = localStorage.getItem("oidcIdToken") -const userURL = "/api/v1/search/query?q=***&from=0&size=10&index=user_search_index" -const teamURL = "/api/v1/search/query?q=*%20AND%20teamType:Group&from=0&size=10&index=team_search_index" +const assetName = SEARCH_ENTITY_TABLE.table_1.term; +const userURL = + '/api/v1/search/query?q=***&from=0&size=10&index=user_search_index'; +const teamURL = + '/api/v1/search/query?q=*%20AND%20teamType:Group&from=0&size=10&index=team_search_index'; - -describe("Test if the total count of users and teams is correctly displayed in the assign owner widget", () => { - beforeEach(() => { +describe('Test if the total count of users and teams is correctly displayed in the assign owner widget', () => { + before(() => { + cy.clearLocalStorageSnapshot(); login(LOGIN.username, LOGIN.password); cy.goToHomePage(); + cy.saveLocalStorage('localstorage'); + }); + beforeEach(() => { + cy.log('Restoring local storage snapshot'); + cy.restoreLocalStorage('localstorage'); + cy.clickOnLogo(); }); - it("Check total count of users and teams", () => { - searchEntity(assetName); - + it('Check total count of users and teams', () => { + searchEntity(assetName); + const token = localStorage.getItem('oidcIdToken'); cy.get('[data-testid="table-link"]').first().should('be.visible').click(); interceptURL('GET', 'api/v1/tables/name/*', 'getEntityDetails'); verifyResponseStatusCode('@getEntityDetails', 200); - cy.request({method:"GET",url:userURL,headers:{Authorization:`Bearer ${token}`}}).as("UserCount") - cy.request({method:"GET",url:teamURL,headers:{Authorization:`Bearer ${token}`}}).as("TeamCount") - + cy.request({ + method: 'GET', + url: userURL, + headers: { Authorization: `Bearer ${token}` }, + }).as('UserCount'); + cy.request({ + method: 'GET', + url: teamURL, + headers: { Authorization: `Bearer ${token}` }, + }).as('TeamCount'); cy.get('[data-testid="edit-Owner-icon"]').should('be.visible').click(); // check for teams count cy.get('@TeamCount').then((response) => { - const teamCount = response.body.hits.total.value - cy.get('[data-testid="filter-count"]').eq(0).contains(`${teamCount}`) - }) + const teamCount = response.body.hits.total.value; + cy.get('[data-testid="filter-count"]').eq(0).contains(`${teamCount}`); + }); // check for user count cy.get('@UserCount').then((response) => { - const userCount = response.body.hits.total.value - cy.get('[data-testid="filter-count"]').eq(1).contains(`${userCount}`) - }) - }) - -}) \ No newline at end of file + const userCount = response.body.hits.total.value; + cy.get('[data-testid="filter-count"]').eq(1).contains(`${userCount}`); + }); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Bots.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Bots.spec.js index 7e1077e22cd..221c5222cd8 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Bots.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Bots.spec.js @@ -90,11 +90,13 @@ describe('Bots Page should work properly', () => { .clear() .type(updatedBotName); //Save the updated display name - interceptURL('GET', '/api/v1/users/auth-mechanism/*', 'getBot'); + + interceptURL('GET', '/api/v1/users/auth-mechanism/*', 'getBotDetails'); cy.get('[data-testid="save-displayName"]').should('be.visible').click(); - verifyResponseStatusCode('@getBot', 200); + verifyResponseStatusCode('@getBotDetails', 200); //Verify the display name is updated on bot details page cy.get('[data-testid="container"]').should('contain', updatedBotName); + cy.wait(1000); //Click on edit description button cy.get('[data-testid="edit-description"]').should('be.visible').click(); //Enter updated description and save diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Customproperties.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Customproperties.spec.js index c76f8cbc5af..cb41e4e8e28 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Customproperties.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Customproperties.spec.js @@ -18,11 +18,8 @@ describe('Custom Properties should work properly', () => { beforeEach(() => { login(LOGIN.username, LOGIN.password); cy.goToHomePage(); - interceptURL('GET', '/api/v1/users*', 'getTeams'); cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click(); - - verifyResponseStatusCode('@getTeams', 200); }); it('Add Integer custom property for all Entities', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js index 423e562a2f2..9696977e3d3 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js @@ -57,6 +57,7 @@ const createGlossaryTerm = (term) => { }; const deleteGlossary = ({ name }) => { + verifyResponseStatusCode('@getGlossaryTerms', 200); cy.get('#left-panelV1').contains(name).should('be.visible').click(); cy.wait(500); cy.get('[data-testid="inactive-link"]').contains(name).should('be.visible'); @@ -98,6 +99,8 @@ describe('Glossary page should work properly', () => { beforeEach(() => { login(LOGIN.username, LOGIN.password); cy.goToHomePage(); + + interceptURL('GET', '/api/v1/glossaryTerms*', 'getGlossaryTerms'); //Clicking on Glossary cy.get('[data-testid="appbar-item-glossary"]') .should('exist') @@ -459,6 +462,7 @@ describe('Glossary page should work properly', () => { }); it('Delete glossary should work properly', () => { + verifyResponseStatusCode('@getGlossaryTerms', 200); cy.get('[data-testid="header"]') .should('be.visible') .contains(NEW_GLOSSARY.name) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Tags.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Tags.spec.js index e942c5360a2..a08da21d9ca 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Tags.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Tags.spec.js @@ -15,12 +15,22 @@ import { addNewTagToEntity, descriptionBox, interceptURL, login, verifyResponseS import { LOGIN, NEW_TAG, NEW_TAG_CATEGORY, SEARCH_ENTITY_TABLE } from '../../constants/constants'; describe('Tags page should work', () => { - beforeEach(() => { + before(() => { + cy.clearLocalStorageSnapshot(); login(LOGIN.username, LOGIN.password); cy.goToHomePage(); + cy.saveLocalStorage('localstorage'); + }); + + beforeEach(() => { + cy.log('Restoring local storage snapshot'); + cy.restoreLocalStorage('localstorage'); + cy.clickOnLogo(); + interceptURL('GET', '/api/v1/tags*', 'getTags'); cy.get('[data-testid="appbar-item-tags"]') .should('be.visible') .click({ force: true }); + verifyResponseStatusCode('@getTags', 200); }); it('Required Details should be available', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js index f2b4c107690..8eba3df93d3 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js @@ -14,7 +14,6 @@ import { addUser, deleteSoftDeletedUser, login, restoreUser, softDeleteUser, uuid } from '../../common/common'; import { LOGIN } from '../../constants/constants'; - const userName = `Usercttest${uuid()}`; const userEmail = `${userName}@gmail.com`; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/UserList/UserListV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/UserList/UserListV1.tsx index 284e0fa9e83..385576f9b8b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/UserList/UserListV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/UserList/UserListV1.tsx @@ -143,6 +143,9 @@ const UserListV1: FC = ({ } @@ -163,6 +166,9 @@ const UserListV1: FC = ({ }