Cypress Fixed failing glossary and recently searched term test (#8840)

* Cypress Fixed failing glossary and recently searched term test

* removed only keyword
This commit is contained in:
Shailesh Parmar 2022-11-17 19:25:31 +05:30 committed by GitHub
parent 626702f612
commit 468200252c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 32 deletions

View File

@ -422,14 +422,6 @@ export const testServiceSampleData = (database, schema, table) => {
cy.get('[data-testid="Schema"]').should('be.visible');
};
/**
* visit any of the entity tab from home page
* @param {string} id -> data-testid is required
*/
export const visitEntityTab = (id) => {
cy.get(`[data-testid="${id}"]`).click();
cy.get(`[data-testid="${id}-tab"]`).should('be.visible');
};
/**
* Search for entities through the search bar
* @param {string} term Entity name

View File

@ -91,11 +91,13 @@ export const SEARCH_ENTITY_DASHBOARD = {
export const SEARCH_ENTITY_PIPELINE = {
pipeline_1: {
term: 'dim_product_etl',
displayName: 'dim_product etl',
entity: MYDATA_SUMMARY_OPTIONS.pipelines,
serviceName: 'sample_airflow',
},
pipeline_2: {
term: 'dim_location_etl',
displayName: 'dim_location etl',
entity: MYDATA_SUMMARY_OPTIONS.pipelines,
serviceName: 'sample_airflow',
},

View File

@ -247,7 +247,7 @@ describe('Glossary page should work properly', () => {
.contains(newDescription)
.should('be.visible');
});
// Todo:- skipping this as its flaky need to check cause
// Todo:- skipping this as its flaky, need to check cause
it.skip('Updating data of glossary term should work properly', () => {
interceptURL('GET', '/api/v1/permissions/*/*', 'permissionApi');
interceptURL('GET', '/api/v1/search/query?*', 'glossaryAPI');
@ -462,7 +462,8 @@ describe('Glossary page should work properly', () => {
.should('be.visible')
.click();
cy.get('[role="button"]').eq(0).should('be.visible').click();
cy.get('[role="button"]').eq(0).should('be.visible').click();
// uncomment below code once `Updating data of glossary term should work properly` is fixed
// cy.get('[role="button"]').eq(0).should('be.visible').click();
interceptURL('PATCH', '/api/v1/tables/*', 'removeTags');
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
@ -472,8 +473,8 @@ describe('Glossary page should work properly', () => {
.should('not.contain', term)
.and('not.contain', 'Personal');
//Remove the added column tag from entity
cy.get('[data-testid="remove"]').eq(0).should('be.visible').click();
// uncomment below code once `Updating data of glossary term should work properly` is fixed
// cy.get('[data-testid="remove"]').eq(0).should('be.visible').click();
cy.wait(500);
interceptURL('PATCH', '/api/v1/tables/*', 'removeSchemaTags');
cy.get('[data-testid="remove"]').eq(0).should('be.visible').click();

View File

@ -13,8 +13,8 @@
/// <reference types="cypress" />
import { interceptURL, login, searchEntity, verifyResponseStatusCode, visitEntityDetailsPage, visitEntityTab } from '../../common/common';
import { FOLLOWING_TITLE, LOGIN, MYDATA_SUMMARY_OPTIONS, MY_DATA_TITLE, NO_SEARCHED_TERMS, RECENT_SEARCH_TITLE, RECENT_VIEW_TITLE, SEARCH_ENTITY_DASHBOARD, SEARCH_ENTITY_PIPELINE, SEARCH_ENTITY_TABLE, SEARCH_ENTITY_TOPIC } from '../../constants/constants';
import { interceptURL, login, searchEntity, verifyResponseStatusCode, visitEntityDetailsPage } from '../../common/common';
import { ENTITIES, FOLLOWING_TITLE, LOGIN, MYDATA_SUMMARY_OPTIONS, MY_DATA_TITLE, NO_SEARCHED_TERMS, RECENT_SEARCH_TITLE, RECENT_VIEW_TITLE, SEARCH_ENTITY_DASHBOARD, SEARCH_ENTITY_PIPELINE, SEARCH_ENTITY_TABLE, SEARCH_ENTITY_TOPIC } from '../../constants/constants';
const tables = Object.values(SEARCH_ENTITY_TABLE);
const topics = Object.values(SEARCH_ENTITY_TOPIC);
@ -146,24 +146,26 @@ describe('MyData page should work', () => {
});
});
it('Recent view section and redirection should work for table entity', () => {
visitEntityTab(MYDATA_SUMMARY_OPTIONS.tables);
checkRecentlyViewElement();
});
it('Recent view section and redirection should work for topic entity', () => {
visitEntityTab(MYDATA_SUMMARY_OPTIONS.topics);
checkRecentlyViewElement();
});
it('Recent view section and redirection should work for dashboard entity', () => {
visitEntityTab(MYDATA_SUMMARY_OPTIONS.dashboards);
checkRecentlyViewElement();
});
it('Recent view section and redirection should work for pipeline entity', () => {
visitEntityTab(MYDATA_SUMMARY_OPTIONS.pipelines);
checkRecentlyViewElement();
Object.values(ENTITIES).map((entity) => {
const text = entity.entityObj.displayName ?? entity.entityObj.term
it(`Recent view section and redirection should work for ${entity.name} entity`, () => {
visitEntityDetailsPage(
entity.entityObj.term,
entity.entityObj.serviceName,
entity.entityObj.entity
);
cy.clickOnLogo();
cy.get(`[data-testid="Recently Viewed-${text}"]`)
.contains(text)
.should('be.visible')
.click();
cy.get('[data-testid="inactive-link"]')
.invoke('text')
.then((newText) => {
expect(newText).equal(text);
});
cy.clickOnLogo();
});
});
it('Listing Recent search terms with redirection should work properly', () => {