-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/PRD-895-Navigation-test #9545
Merged
anshbansal
merged 6 commits into
datahub-project:master
from
Kunal-kankriya:Navigation-Filter-Test
Jan 3, 2024
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6ca9f2c
PRD-895 |Navigation Filter Steps Added|
Kunal-kankriya 936088f
PRD-895 |Refactor Filter Navigation|
Kunal-kankriya 8d6b709
Merge branch 'master' into PRD-895-Filter-Navigation-Search-Test
Kunal-kankriya 1ec4e8a
feat: Added new scenario and refactored the code
Kunal-kankriya 1978b57
Fix - Skipped Filter type
Kunal-kankriya a4aa152
Fix - Changed Datasets
Kunal-kankriya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
146 changes: 93 additions & 53 deletions
146
smoke-test/tests/cypress/cypress/e2e/search/query_and_filter_search.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,97 @@ | ||
describe("auto-complete dropdown, filter plus query search test", () => { | ||
|
||
const platformQuerySearch = (query,test_id,active_filter) => { | ||
cy.visit("/"); | ||
cy.get("input[data-testid=search-input]").type(query); | ||
cy.get(`[data-testid="quick-filter-urn:li:dataPlatform:${test_id}"]`).click(); | ||
cy.focused().type("{enter}").wait(3000); | ||
cy.url().should( | ||
"include", | ||
`?filter_platform___false___EQUAL___0=urn%3Ali%3AdataPlatform%3A${test_id}` | ||
); | ||
cy.get('[data-testid="search-input"]').should("have.value", query); | ||
cy.get(`[data-testid="active-filter-${active_filter}"]`).should("be.visible"); | ||
cy.contains("of 0 results").should("not.exist"); | ||
cy.contains(/of [0-9]+ results/); | ||
} | ||
|
||
const entityQuerySearch = (query,test_id,active_filter) => { | ||
cy.visit("/"); | ||
cy.get("input[data-testid=search-input]").type(query); | ||
cy.get(`[data-testid="quick-filter-${test_id}"]`).click(); | ||
cy.focused().type("{enter}").wait(3000); | ||
cy.url().should( | ||
"include", | ||
`?filter__entityType___false___EQUAL___0=${test_id}` | ||
); | ||
cy.get('[data-testid="search-input"]').should("have.value", query); | ||
cy.get(`[data-testid="active-filter-${active_filter}"]`).should("be.visible"); | ||
cy.contains("of 0 results").should("not.exist"); | ||
cy.contains(/of [0-9]+ results/); | ||
} | ||
const datasetNames = { | ||
dashboardsType: "Baz Dashboard", | ||
pipelinesType: "Users", | ||
MlmoduleType: "scienceModel", | ||
glossaryTermsType: "AccountBalance", | ||
tags: "Baz Chart 1", | ||
hivePlatform: "datahub_db", | ||
airflowPlatform: "User Creations", | ||
awsPlatform: "project/root/events/logging_events_bckp", | ||
hdfsPlatform: "SampleHdfsDataset" | ||
}; | ||
|
||
const searchToExecute = (value) => { | ||
cy.get("input[data-testid=search-input]").eq(0).type(`${value}{enter}`); | ||
cy.waitTextPresent("Type"); | ||
}; | ||
|
||
const selectFilteredEntity = (textToClick, entity, url) => { | ||
cy.get(`[data-testid=filter-dropdown-${textToClick}]`).click({ force: true }); | ||
cy.get(`[data-testid="filter-option-${entity}"]`).click({ force: true }); | ||
cy.get("[data-testid=update-filters]").click({ force: true }); | ||
cy.url().should("include", `${url}`); | ||
cy.get("[data-testid=update-filters]").should("not.be.visible"); | ||
cy.get('.ant-pagination-next').scrollIntoView().should('be.visible'); | ||
}; | ||
|
||
const verifyFilteredEntity = (text) => { | ||
cy.get('.ant-typography').contains(text).should('be.visible'); | ||
}; | ||
|
||
describe("auto-complete dropdown, filter plus query search test", () => { | ||
it("verify the 'filter by' section + query (result in search page with query applied + filter applied)", () => { | ||
// Platform query plus filter test | ||
cy.loginWithCredentials(); | ||
|
||
// Platform query plus filter test | ||
cy.loginWithCredentials(); | ||
cy.visit('/'); | ||
searchToExecute("*"); | ||
|
||
// Filter by entity - Type | ||
|
||
// Dashboard | ||
selectFilteredEntity("Type", "Dashboards", "filter__entityType"); | ||
cy.clickOptionWithText(datasetNames.dashboardsType); | ||
verifyFilteredEntity('Dashboard'); | ||
searchToExecute("*"); | ||
|
||
// Ml models | ||
selectFilteredEntity("Type", "ML Models", "filter__entityType"); | ||
cy.clickOptionWithText(datasetNames.MlmoduleType); | ||
verifyFilteredEntity('ML Model'); | ||
searchToExecute("*"); | ||
|
||
// Pipeline | ||
selectFilteredEntity("Type", "Pipelines", "filter__entityType"); | ||
cy.clickOptionWithText(datasetNames.pipelinesType); | ||
verifyFilteredEntity('Pipeline'); | ||
searchToExecute('*') | ||
|
||
// Filter by entity - Platform | ||
|
||
// Hive | ||
selectFilteredEntity("Platform", "Hive", "filter_platform"); | ||
cy.clickOptionWithText(datasetNames.hivePlatform); | ||
verifyFilteredEntity('Hive'); | ||
searchToExecute('*') | ||
|
||
// Airflow | ||
platformQuerySearch ("cypress","airflow","Airflow"); | ||
// BigQuery | ||
platformQuerySearch ("cypress","bigquery","BigQuery"); | ||
// dbt | ||
platformQuerySearch ("cypress","dbt","dbt"); | ||
// Hive | ||
platformQuerySearch ("cypress","hive","Hive"); | ||
|
||
// Entity type query plus filter test | ||
// Datasets | ||
entityQuerySearch ("cypress","DATASET","Datasets"); | ||
// Dashboards | ||
entityQuerySearch ("cypress","DASHBOARD","Dashboards"); | ||
// Pipelines | ||
entityQuerySearch ("cypress","DATA_FLOW","Pipelines"); | ||
// Domains | ||
entityQuerySearch ("Marketing","DOMAIN","Domains"); | ||
selectFilteredEntity("Platform", "Airflow", "filter_platform"); | ||
cy.clickOptionWithText(datasetNames.airflowPlatform); | ||
verifyFilteredEntity('Airflow'); | ||
searchToExecute('*') | ||
|
||
// AWS S3 | ||
selectFilteredEntity("Platform", "AWS S3", "filter_platform"); | ||
cy.clickOptionWithText(datasetNames.awsPlatform); | ||
verifyFilteredEntity('AWS S3'); | ||
searchToExecute('*') | ||
|
||
// HDFS | ||
selectFilteredEntity("Platform", "HDFS", "filter_platform"); | ||
cy.clickOptionWithText(datasetNames.hdfsPlatform); | ||
verifyFilteredEntity('HDFS'); | ||
searchToExecute('*') | ||
|
||
// Glossary Terms | ||
entityQuerySearch ("cypress","GLOSSARY_TERM","Glossary Terms"); | ||
}); | ||
}); | ||
selectFilteredEntity("Type", "Glossary Terms", "filter__entityType"); | ||
cy.clickOptionWithText(datasetNames.glossaryTermsType); | ||
verifyFilteredEntity('Glossary Term'); | ||
searchToExecute('*') | ||
|
||
// Tag | ||
selectFilteredEntity("Tag", "Legacy", "filter_tags"); | ||
cy.clickOptionWithText(datasetNames.tags); | ||
cy.mouseover('[data-testid="tag-Legacy"]'); | ||
verifyFilteredEntity('Legacy'); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should not be a single test but multiple tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay I will split it into multiple tests