-
Notifications
You must be signed in to change notification settings - Fork 892
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests include the following cases: verify default page work verify advanced savings work verify filter and query work Disable eslint check Add eslint-disable comment Revise license content in plugins and support Simplify filter and query test modify test name and fix PR comment Particailly Resolved: opensearch-project/opensearch-build#705 Signed-off-by: Anan Zhuang <ananzh@amazon.com>
- Loading branch information
Showing
6 changed files
with
373 additions
and
0 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
cypress/integration/bundled-osd/check_advanced_settings.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,66 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
/* es-lint-disable for missing definitions */ | ||
/* eslint-disable */ | ||
import { | ||
MiscUtils, | ||
LoginPage, | ||
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
const loginPage = new LoginPage(cy); | ||
|
||
describe('verify the advanced settings are saved', () => { | ||
beforeEach(() => { | ||
miscUtils.visitPage('app/management/opensearch-dashboards/settings'); | ||
loginPage.enterUserName('admin'); | ||
loginPage.enterPassword('admin'); | ||
loginPage.submit(); | ||
}); | ||
|
||
it('the dark mode is on', () => { | ||
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]') | ||
.invoke('attr', 'aria-checked') | ||
.should('eq', 'true'); | ||
}); | ||
|
||
it('the Timeline default columns field is set to 4', () => { | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').should( | ||
'have.value', | ||
4 | ||
); | ||
}); | ||
|
||
it('the Timeline Maximum buckets field is set to 4', () => { | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').should( | ||
'have.value', | ||
4 | ||
); | ||
}); | ||
}); |
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,50 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
/* es-lint-disable for missing definitions */ | ||
/* eslint-disable */ | ||
import { | ||
MiscUtils, | ||
LoginPage, | ||
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
const loginPage = new LoginPage(cy); | ||
|
||
describe('verify default landing page work for bwc', () => { | ||
beforeEach(() => { | ||
miscUtils.visitPage(''); | ||
loginPage.enterUserName('admin'); | ||
loginPage.enterPassword('admin'); | ||
loginPage.submit(); | ||
}); | ||
|
||
it('the overview page is set as the default landing page', () => { | ||
cy.url().should('include', '/app/opensearch_dashboards_overview#/'); | ||
}); | ||
}); |
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,92 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
/* es-lint-disable for missing definitions */ | ||
/* eslint-disable */ | ||
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
|
||
describe('check dashboards filter and query', () => { | ||
beforeEach(() => { | ||
miscUtils.visitPage('app/dashboards#'); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.clearCookies(); | ||
}); | ||
|
||
describe('osx filter and query should work in [Logs] Web Traffic dashboards', () => { | ||
beforeEach(() => { | ||
cy.get('[data-test-subj="dashboardListingTitleLink-[Logs]-Web-Traffic"]').click(); | ||
cy.get('[data-test-subj="breadcrumb last"]') | ||
.invoke('attr', 'title') | ||
.should('eq', '[Logs] Web Traffic'); | ||
}); | ||
|
||
it('osx filter and query should exist and be named correctly', () => { | ||
cy.get('[data-test-subj="saved-query-management-popover-button"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover"]') | ||
.find('[class="osdSavedQueryListItem__labelText"]') | ||
.should('have.text', 'test-query') | ||
.click(); | ||
cy.get('[data-test-subj="queryInput"]').should('have.text', 'resp=200'); | ||
cy.get( | ||
'[data-test-subj="filter filter-enabled filter-key-machine.os filter-value-osx filter-unpinned "]' | ||
) | ||
.should('have.text', 'osx filter') | ||
.click(); | ||
cy.get('[data-test-subj="editFilter"]').click(); | ||
cy.get('[data-test-subj="filterFieldSuggestionList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.should('have.text', 'machine.os'); | ||
cy.get('[data-test-subj="filterOperatorList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.should('have.text', 'is'); | ||
cy.get('[data-test-subj="filterParams"]').find('input').should('have.value', 'osx'); | ||
}); | ||
|
||
it('osx filter and query should function correctly', () => { | ||
cy.get('[data-test-subj="saved-query-management-popover-button"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover"]') | ||
.find('[class="osdSavedQueryListItem__labelText"]') | ||
.should('have.text', 'test-query') | ||
.click(); | ||
|
||
//[Logs] vistor chart should show osx 100% | ||
cy.get('[data-title="[Logs] Visitors by OS"]') | ||
.find('[class="label"]') | ||
.should('have.text', 'osx (100%)'); | ||
|
||
//[Logs] Response chart should show 200 label | ||
cy.get('[data-title="[Logs] Response Codes Over Time + Annotations"]') | ||
.find('[title="200"]') | ||
.should('have.text', '200'); | ||
}); | ||
}); | ||
}); |
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,52 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
/* es-lint-disable for missing definitions */ | ||
/* eslint-disable */ | ||
/// <reference types="cypress" /> | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
/** | ||
* @type {Cypress.PluginConfig} | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
}; |
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,55 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
/* es-lint-disable for missing definitions */ | ||
/* eslint-disable */ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) |
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,58 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
/* es-lint-disable for missing definitions */ | ||
/* eslint-disable */ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands'; | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') | ||
|
||
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/; | ||
Cypress.on('uncaught:exception', (err) => { | ||
/* returning false here prevents Cypress from failing the test */ | ||
if (resizeObserverLoopErrRe.test(err.message)) { | ||
return false; | ||
} | ||
}); |