-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Fivetran-add-bigquery-destination-support
- Loading branch information
Showing
6 changed files
with
80 additions
and
73 deletions.
There are no files selected for viewing
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
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
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
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
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
128 changes: 62 additions & 66 deletions
128
smoke-test/tests/cypress/cypress/e2e/query/query_tab.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,75 +1,71 @@ | ||
const DATASET_URN = 'urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleCypressHdfsDataset,PROD)'; | ||
const runId = Date.now() | ||
|
||
describe("manage queries", () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
cy.goToDataset( | ||
DATASET_URN, | ||
"SampleCypressHdfsDataset" | ||
); | ||
cy.hideOnboardingTour(); | ||
cy.openEntityTab("Queries") | ||
}) | ||
|
||
it("go to queries tab on dataset page then, create, edit, make default, delete a view", () => { | ||
const runId = Date.now() | ||
|
||
// Headers | ||
cy.waitTextVisible("Highlighted Queries"); | ||
cy.ensureTextNotPresent("Recent Queries"); | ||
|
||
// Add new Query | ||
cy.get('[data-testid="add-query-button"]').click(); | ||
cy.get('[class="query-builder-editor-input"]').click(); | ||
cy.get('[class="query-builder-editor-input"]').type(` + Test Query-${runId}`); | ||
cy.get('[data-testid="query-builder-title-input"]').click(); | ||
cy.get('[data-testid="query-builder-title-input"]').type(`Test Table-${runId}`); | ||
cy.get('.ProseMirror').click(); | ||
cy.get('.ProseMirror').type(`Test Description-${runId}`); | ||
cy.get('[data-testid="query-builder-save-button"]').click(); | ||
cy.waitTextVisible("Created Query!"); | ||
|
||
// Verify the card | ||
cy.waitTextVisible(`+ Test Query-${runId}`); | ||
cy.waitTextVisible(`Test Table-${runId}`); | ||
cy.waitTextVisible(`Test Description-${runId}`); | ||
cy.waitTextVisible("Created on"); | ||
|
||
// View the Query | ||
cy.get('[data-testid="query-content-0"]').click(); | ||
cy.get('.ant-modal-content').waitTextVisible(`+ Test Query-${runId}`); | ||
cy.get('.ant-modal-content').waitTextVisible(`Test Table-${runId}`); | ||
cy.get('.ant-modal-content').waitTextVisible(`Test Description-${runId}`); | ||
cy.get('[data-testid="query-modal-close-button"]').click(); | ||
const addNewQuery = () => { | ||
cy.get('[data-testid="add-query-button"]').click(); | ||
cy.get('[data-mode-id="sql"]').click() | ||
.type(` + Test Query-${runId}`); | ||
cy.get('[data-testid="query-builder-title-input"]').click() | ||
.type(`Test Table-${runId}`); | ||
cy.get('.ProseMirror').click() | ||
.type(`Test Description-${runId}`); | ||
cy.get('[data-testid="query-builder-save-button"]').click(); | ||
cy.waitTextVisible("Created Query!"); | ||
} | ||
|
||
// Edit the Query | ||
cy.get('[data-testid="query-edit-button-0"]').click() | ||
cy.get('[class="query-builder-editor-input"]').click(); | ||
cy.get('[class="query-builder-editor-input"]').type(` + Edited Query-${runId}`); | ||
cy.get('[data-testid="query-builder-title-input"]').click(); | ||
cy.get('[data-testid="query-builder-title-input"]').clear(); | ||
cy.get('[data-testid="query-builder-title-input"]').type(`Edited Table-${runId}`); | ||
cy.get('.ProseMirror').click(); | ||
cy.get('.ProseMirror').clear(); | ||
cy.get('.ProseMirror').type(`Edited Description-${runId}`); | ||
cy.get('[data-testid="query-builder-save-button"]').click(); | ||
cy.waitTextVisible("Edited Query!"); | ||
const editQuery = () => { | ||
cy.get('[data-testid="query-edit-button-0"]').click() | ||
cy.get('[data-mode-id="sql"]').click() | ||
.type(` + Edited Query-${runId}`); | ||
cy.get('[data-testid="query-builder-title-input"]').click().clear() | ||
.type(`Edited Table-${runId}`); | ||
cy.get('.ProseMirror').click().clear() | ||
.type(`Edited Description-${runId}`); | ||
cy.get('[data-testid="query-builder-save-button"]').click(); | ||
cy.waitTextVisible("Edited Query!"); | ||
} | ||
|
||
// Verify edited Query card | ||
cy.get('[data-testid="query-content-0"]').scrollIntoView().should('be.visible'); | ||
cy.waitTextVisible(`+ Test Query-${runId} + Edited Query-${runId}`); | ||
cy.waitTextVisible(`Edited Table-${runId}`); | ||
cy.waitTextVisible(`Edited Description-${runId}`); | ||
|
||
// Delete the Query | ||
const deleteQuery = () => { | ||
cy.get('[data-testid="query-more-button-0"]').click(); | ||
cy.get('[data-testid="query-delete-button-0"]').click(); | ||
cy.contains('Yes').click(); | ||
cy.clickOptionWithText("Delete"); | ||
cy.clickOptionWithText('Yes') | ||
cy.waitTextVisible("Deleted Query!"); | ||
} | ||
|
||
const verifyViewCardDetails = (query,title,description) => { | ||
cy.get('[data-testid="query-content-0"]').scrollIntoView().should('be.visible').click() | ||
cy.get('.ant-modal-content').waitTextVisible(query); | ||
cy.get('.ant-modal-content').waitTextVisible(title); | ||
cy.get('.ant-modal-content').waitTextVisible(description); | ||
}; | ||
|
||
// Query should be gone | ||
cy.ensureTextNotPresent(`+ Test Query-${runId} + Edited Query-${runId}`); | ||
cy.ensureTextNotPresent(`Edited Table-${runId}`); | ||
cy.ensureTextNotPresent(`Edited Description-${runId}`); | ||
describe("manage queries", () => { | ||
beforeEach(() => { | ||
cy.loginWithCredentials(); | ||
cy.goToDataset(DATASET_URN,"SampleCypressHdfsDataset"); | ||
cy.openEntityTab("Queries") | ||
}) | ||
|
||
it("go to queries tab on dataset page then create query and verify & view the card", () => { | ||
cy.waitTextVisible("Highlighted Queries"); | ||
cy.ensureTextNotPresent("Recent Queries"); | ||
addNewQuery(); | ||
cy.waitTextVisible(`+ Test Query-${runId}`); | ||
cy.waitTextVisible(`Test Table-${runId}`); | ||
cy.waitTextVisible(`Test Description-${runId}`); | ||
cy.waitTextVisible("Created on"); | ||
verifyViewCardDetails(`+ Test Query-${runId}`,`Test Table-${runId}`,`Test Description-${runId}`) | ||
}); | ||
|
||
it("go to queries tab on dataset page then edit the query and verify edited Query card", () => { | ||
editQuery(); | ||
verifyViewCardDetails(`+ Test Query-${runId} + Edited Query-${runId}`,`Edited Table-${runId}`,`Edited Description-${runId}`) | ||
}); | ||
|
||
it("go to queries tab on dataset page then delete the query and verify that query should be gone", () => { | ||
deleteQuery(); | ||
cy.ensureTextNotPresent(`+ Test Query-${runId} + Edited Query-${runId}`); | ||
cy.ensureTextNotPresent(`Edited Table-${runId}`); | ||
cy.ensureTextNotPresent(`Edited Description-${runId}`); | ||
}); | ||
}); |