forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 2.0][CI][BWC] add BWC tests to github actions (opensearch-p…
…roject#1624) (opensearch-project#1659) [CI][BWC] add BWC tests to github actions (opensearch-project#1624) Add backwards compatibility tests to github workflow for PRs. Also, fix for checking status of OpenSearch Dashboards since api/status/ is not protected. Also, enable ability to create test data since migration from 1.0.0 to 3.0.0 is not supported for OpenSearch currently. Issue: opensearch-project#1465 opensearch-project#1651 Backport PR: opensearch-project#1624 Includes changes from: opensearch-project#1502 Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
- Loading branch information
Showing
17 changed files
with
394 additions
and
19 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
86 changes: 86 additions & 0 deletions
86
cypress/integration/with-security/helpers/generate_data.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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { | ||
MiscUtils, | ||
LoginPage, | ||
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
const loginPage = new LoginPage(cy); | ||
|
||
describe('Generating BWC test data with security', () => { | ||
beforeEach(() => { | ||
miscUtils.visitPage('app/management/opensearch-dashboards/settings'); | ||
loginPage.enterUserName('admin'); | ||
loginPage.enterPassword('admin'); | ||
loginPage.submit(); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.clearCookies(); | ||
}); | ||
|
||
it('tenant-switch-modal page should show and be clicked', () => { | ||
cy.get('[data-test-subj="tenant-switch-modal"]'); | ||
cy.get('[data-test-subj="confirm"]').click(); | ||
}); | ||
|
||
it('adds advanced settings', () => { | ||
miscUtils.visitPage('app/management/opensearch-dashboards/settings'); | ||
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click(); | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type( | ||
'{selectAll}4' | ||
); | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type( | ||
'{selectAll}4' | ||
); | ||
cy.get('[data-test-subj="advancedSetting-editField-defaultRoute"]') | ||
.clear() | ||
.type('/app/opensearch_dashboards_overview#/'); | ||
cy.get('[data-test-subj="advancedSetting-saveButton"]').click({ force: true }); | ||
cy.reload(); | ||
}); | ||
|
||
it('adds sample data', () => { | ||
miscUtils.addSampleData(); | ||
}); | ||
|
||
it('adds filters and queries', () => { | ||
miscUtils.visitPage('app/dashboards#'); | ||
cy.get('[data-test-subj="dashboardListingTitleLink-[Logs]-Web-Traffic"]').click(); | ||
cy.get('[data-test-subj="queryInput"]').clear().type('resp=200'); | ||
cy.get('[data-test-subj="addFilter"]').click(); | ||
cy.get('[data-test-subj="filterFieldSuggestionList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.type('machine.os{downArrow}{enter}'); | ||
cy.get('[data-test-subj="filterOperatorList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.type('{downArrow}{enter}'); | ||
cy.get('[data-test-subj="filterParams"]') | ||
.find('input.euiFieldText[placeholder="Enter a value"]') | ||
.type('osx'); | ||
cy.get('[data-test-subj="createCustomLabel"]').click(); | ||
cy.get('[class="globalFilterItem__editorForm"]').find('input').last().type('osx filter'); | ||
cy.get('[data-test-subj="saveFilter"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover-button"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover"]') | ||
.find('[data-test-subj="saved-query-management-save-button"]') | ||
.click(); | ||
cy.get('[data-test-subj="saveQueryFormTitle"]').type('test-query'); | ||
cy.get('[data-test-subj="savedQueryFormSaveButton"]').click(); | ||
}); | ||
|
||
it('adds Timeline visualization', () => { | ||
miscUtils.visitPage('app/visualize#'); | ||
cy.get('[data-test-subj="visualizationLandingPage"]') | ||
.find('[data-test-subj="newItemButton"]') | ||
.click(); | ||
cy.get('[data-test-subj="visType-timelion"]').click(); | ||
cy.get('[data-test-subj="visualizeSaveButton"]').click(); | ||
cy.get('[data-test-subj="savedObjectTitle"]').type('test-timeline'); | ||
cy.get('[data-test-subj="confirmSaveSavedObjectButton"]').click(); | ||
}); | ||
}); |
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
69 changes: 69 additions & 0 deletions
69
cypress/integration/without-security/helpers/generate_data.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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
|
||
describe('Generating BWC test data without security', () => { | ||
before(() => { | ||
miscUtils.visitPage('app'); | ||
}); | ||
it('adds advanced settings', () => { | ||
miscUtils.visitPage('app/management/opensearch-dashboards/settings'); | ||
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click(); | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type( | ||
'{selectAll}4' | ||
); | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type( | ||
'{selectAll}4' | ||
); | ||
cy.get('[data-test-subj="advancedSetting-editField-defaultRoute"]') | ||
.clear() | ||
.type('/app/opensearch_dashboards_overview#/'); | ||
cy.get('[data-test-subj="advancedSetting-saveButton"]').click({ force: true }); | ||
cy.reload(); | ||
}); | ||
|
||
it('adds sample data', () => { | ||
miscUtils.addSampleData(); | ||
}); | ||
|
||
it('adds filters and queries', () => { | ||
miscUtils.visitPage('app/dashboards#'); | ||
cy.get('[data-test-subj="dashboardListingTitleLink-[Logs]-Web-Traffic"]').click(); | ||
cy.get('[data-test-subj="queryInput"]').clear().type('resp=200'); | ||
cy.get('[data-test-subj="addFilter"]').click(); | ||
cy.get('[data-test-subj="filterFieldSuggestionList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.type('machine.os{downArrow}{enter}'); | ||
cy.get('[data-test-subj="filterOperatorList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.type('{downArrow}{enter}'); | ||
cy.get('[data-test-subj="filterParams"]') | ||
.find('input.euiFieldText[placeholder="Enter a value"]') | ||
.type('osx'); | ||
cy.get('[data-test-subj="createCustomLabel"]').click(); | ||
cy.get('[class="globalFilterItem__editorForm"]').find('input').last().type('osx filter'); | ||
cy.get('[data-test-subj="saveFilter"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover-button"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover"]') | ||
.find('[data-test-subj="saved-query-management-save-button"]') | ||
.click(); | ||
cy.get('[data-test-subj="saveQueryFormTitle"]').type('test-query'); | ||
cy.get('[data-test-subj="savedQueryFormSaveButton"]').click(); | ||
}); | ||
|
||
it('adds Timeline visualization', () => { | ||
miscUtils.visitPage('app/visualize#'); | ||
cy.get('[data-test-subj="visualizationLandingPage"]') | ||
.find('[data-test-subj="newItemButton"]') | ||
.click(); | ||
cy.get('[data-test-subj="visType-timelion"]').click(); | ||
cy.get('[data-test-subj="visualizeSaveButton"]').click(); | ||
cy.get('[data-test-subj="savedObjectTitle"]').type('test-timeline'); | ||
cy.get('[data-test-subj="confirmSaveSavedObjectButton"]').click(); | ||
}); | ||
}); |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.