-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more bwc tests for osd without bundles
This PR adds the following bwc tests: 1) verify sample data work properly for bwc 2) verify timeline visualization work properly for bwc This PR also simplifies check_filter_and_query bwc test. It first removes Unique Visitors check because even fix the time interval, the number of unique visitors number is random. Then it simplifies this bwc test. add more tests in check_timeline and modify test names change one query content to make bwc tests more robust update license header add missing test and solve timestamp issue fix eslint and comments Partially Resolved: opensearch-project/opensearch-build#705 Signed-off-by: Anan Zhuang <ananzh@amazon.com>
- Loading branch information
Showing
5 changed files
with
199 additions
and
121 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* eslint-disable */ | ||
import { MiscUtils, CommonUI } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
const commonUI = new CommonUI(cy); | ||
|
||
describe('check previously loaded data', () => { | ||
beforeEach(() => { | ||
miscUtils.visitPage('app/dashboards#'); | ||
}); | ||
|
||
it('previous loaded data should exist in dashboards', () => { | ||
let items = cy.get('[data-test-subj="itemsInMemTable"]'); | ||
|
||
items.get('[data-test-subj="dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard"]') | ||
.should('have.text', '[Flights] Global Flight Dashboard'); | ||
|
||
items.get('[data-test-subj="dashboardListingTitleLink-[Logs]-Web-Traffic"]') | ||
.should('have.text', '[Logs] Web Traffic'); | ||
|
||
items.get('[data-test-subj="dashboardListingTitleLink-[eCommerce]-Revenue-Dashboard"]') | ||
.should('have.text', '[eCommerce] Revenue Dashboard'); | ||
}); | ||
|
||
describe('Global Flight Dashboard should function properly', () => { | ||
beforeEach(() => { | ||
cy.get('[data-test-subj="itemsInMemTable"]') | ||
.get('[data-test-subj="dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard"]') | ||
.click(); | ||
commonUI.removeAllFilters(); | ||
commonUI.setDateRange('Dec 1, 2021 @ 00:00:00.000', 'Nov 1, 2021 @ 00:00:00.000'); | ||
}); | ||
|
||
it('Global Flight Dashboard is loaded when clicked', () => { | ||
cy.get('[data-test-subj="breadcrumb last"]').should('have.text', '[Flights] Global Flight Dashboard'); | ||
cy.get('[data-title="[Flights] Total Flights"]').should('exist'); | ||
cy.get('[data-title="[Flights] Average Ticket Price"]').should('exist'); | ||
}); | ||
|
||
it('If set filter for carrier, [Flights] Airline Carrier should show correct carrier', () => { | ||
commonUI.addFilterRetrySelection('Carrier', 'is', 'Logstash Airways'); | ||
cy.get('[data-title="[Flights] Airline Carrier"]') | ||
.find('[class="label-text"]') | ||
.should('have.text', 'Logstash Airways (100%)'); | ||
}); | ||
|
||
it('If set filter for FlightDelayType, [Flights] Delay Type should filter out selected type', () => { | ||
commonUI.addFilterRetrySelection('FlightDelayType', 'is not', 'No Delay'); | ||
let types = cy.get('[data-title="[Flights] Delay Type"]') | ||
types.find('[data-label="Weather Delay"]').should('exist'); | ||
types.find('[data-label="No Delay"]').should('not.exist'); ; | ||
}); | ||
}); | ||
|
||
describe('eCommerce Revenue Dashboard should function properly', () => { | ||
beforeEach(() => { | ||
cy.get('[data-test-subj="itemsInMemTable"]') | ||
.get('[data-test-subj="dashboardListingTitleLink-[eCommerce]-Revenue-Dashboard"]') | ||
.click(); | ||
commonUI.removeAllFilters(); | ||
commonUI.setDateRange('Nov 1, 2021 @ 00:00:00.000', 'Nov 1, 2016 @ 00:00:00.000'); | ||
}); | ||
|
||
it('eCommerce Revenue Dashboard is loaded when clicked', () => { | ||
cy.get('[data-test-subj="breadcrumb last"]').should('have.text', '[eCommerce] Revenue Dashboard'); | ||
cy.get('[data-title="[eCommerce] Average Sales Price"]').should('exist'); | ||
cy.get('[data-title="[eCommerce] Average Sold Quantity"]').should('exist'); | ||
}); | ||
|
||
it('If set filter for gender, [eCommerce] Sales by Gender should show one gender', () => { | ||
commonUI.addFilterRetrySelection('customer_gender', 'is', 'FEMALE'); | ||
cy.get('[data-title="[eCommerce] Sales by Gender"]') | ||
.find('[class="label-text"]') | ||
.should('have.text', 'FEMALE (100%)'); | ||
}) | ||
|
||
it('If filter out Women\'s Clothing, [eCommerce] Sales by Category should not show this category', () => { | ||
commonUI.addFilterRetrySelection('category', 'is not', "Women's Clothing"); | ||
let category = cy.get('[data-title="[eCommerce] Sales by Category"]') | ||
category.find('[data-label="Men\'s Clothing"]').should('exist'); | ||
category.find('[data-label="Women\'s Clothing"]').should('not.exist'); | ||
}); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* eslint-disable */ | ||
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
|
||
describe('check timeline visualization', () => { | ||
beforeEach(() => { | ||
miscUtils.visitPage('app/visualize#'); | ||
}); | ||
|
||
it('timeline visualizations should be saved and named correctly', () => { | ||
cy.get('[data-test-subj="visualizationLandingPage"]') | ||
.find('[class="euiFormControlLayout__childrenWrapper"]') | ||
.type('timeline'); | ||
cy.get('[data-test-subj="visListingTitleLink-test-timeline"]').should('have.text', 'test-timeline').click(); | ||
cy.get('[class="view-line"]').contains('.es(*)'); | ||
}); | ||
|
||
describe('timeline visualizations should work properly', () => { | ||
beforeEach(() => { | ||
cy.get('[data-test-subj="visualizationLandingPage"]') | ||
.find('[data-test-subj="newItemButton"]') | ||
.click(); | ||
cy.get('[data-test-subj="visType-timelion"]').click(); | ||
}); | ||
|
||
it('.es(*, kibana1=true) should report search error', () => { | ||
cy.get('[class="view-line"]').type('{selectall}{backspace}, kibana1=true)'); | ||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | ||
cy.get('[data-test-subj="globalToastList"]').find('[data-test-subj="errorToastMessage"]').contains('Timeline request error: undefined Error: Unknown argument to es: kibana1') | ||
}); | ||
|
||
it('.es(*, kibana=true) should not report search error', () => { | ||
cy.get('[class="view-line"]').type('{selectall}{backspace}, kibana=true)'); | ||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | ||
cy.get('[data-test-subj="globalToastList"]').find('[data-test-subj="errorToastMessage"]').should('not.exist') | ||
}); | ||
|
||
it('.es(*, opensearchDashboards=true) should not report search error', () => { | ||
cy.get('[class="view-line"]').type('{selectall}{backspace}, opensearchDashboards=true)'); | ||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | ||
cy.get('[data-test-subj="globalToastList"]').find('[data-test-subj="errorToastMessage"]').should('not.exist') | ||
}); | ||
|
||
it('.elasticsearch(*, kibana1=true) should report search error', () => { | ||
cy.get('[class="view-line"]').type('{selectall}{backspace}{backspace}{backspace}{backspace}{backspace}elasticsearch(*, kibana1=true)'); | ||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | ||
cy.get('[data-test-subj="globalToastList"]').find('[data-test-subj="errorToastMessage"]').contains('Timeline request error: undefined Error: Unknown argument to es: kibana1') | ||
}); | ||
|
||
it('.elasticsearch(*, kibana=true) should not report search error', () => { | ||
cy.get('[class="view-line"]').type('{selectall}{backspace}{backspace}{backspace}{backspace}{backspace}elasticsearch(*, kibana=true)'); | ||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | ||
cy.get('[data-test-subj="globalToastList"]').find('[data-test-subj="errorToastMessage"]').should('not.exist') | ||
}); | ||
|
||
it('.elasticsearch(*, opensearchDashboards=true) should not report search error', () => { | ||
cy.get('[class="view-line"]').type('{selectall}{backspace}{backspace}{backspace}{backspace}{backspace}elasticsearch(*, opensearchDashboards=true)'); | ||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | ||
cy.get('[data-test-subj="globalToastList"]').find('[data-test-subj="errorToastMessage"]').should('not.exist') | ||
}); | ||
|
||
it('.opensearch(*, kibana1=true) should report search error', () => { | ||
cy.get('[class="view-line"]').type('{selectall}{backspace}{backspace}{backspace}{backspace}{backspace}opensearch(*, kibana1=true)'); | ||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | ||
cy.get('[data-test-subj="globalToastList"]').find('[data-test-subj="errorToastMessage"]').contains('Timeline request error: undefined Error: Unknown argument to es: kibana1') | ||
}); | ||
|
||
it('.opensearch(*, kibana=true) should not report search error', () => { | ||
cy.get('[class="view-line"]').type('{selectall}{backspace}{backspace}{backspace}{backspace}{backspace}opensearch(*, kibana=true)'); | ||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | ||
cy.get('[data-test-subj="globalToastList"]').find('[data-test-subj="errorToastMessage"]').should('not.exist') | ||
}); | ||
|
||
it('.opensearch(*, opensearchDashboards=true) should not report search error', () => { | ||
cy.get('[class="view-line"]').type('{selectall}{backspace}{backspace}{backspace}{backspace}{backspace}opensearch(*, opensearchDashboards=true)'); | ||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | ||
cy.get('[data-test-subj="globalToastList"]').find('[data-test-subj="errorToastMessage"]').should('not.exist') | ||
}); | ||
}); | ||
}); |