diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..fa1385d99 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* -text diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js index ab5efc1c0..da81709ed 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js @@ -49,13 +49,6 @@ describe('table visualization in embedded mode', () => { '115', ]; - const suppressResizeObserverIssue = () => { - // exception is thrown on loading EuiDataGrid in cypress only, ignore for now - cy.on('uncaught:exception', (err) => { - if (err.message.includes('ResizeObserver loop')) return false; - }); - }; - before(() => { CURRENT_TENANT.newTenant = 'global'; cy.fleshTenantSettings(); @@ -104,12 +97,16 @@ describe('table visualization in embedded mode', () => { it('Should allow to filter in embedded mode', () => { commonUI.addFilterRangeRetrySelection('age', 'is between', '10', '30'); + cy.wait(2000); cy.reload(); + cy.wait(2000); cy.tbGetTableDataFromVisualization().then((data) => { expect(data).to.deep.eq(['0', '1,059', '20', '1,114']); }); commonUI.removeFilter('age'); + cy.wait(2000); cy.reload(); + cy.wait(2000); cy.tbGetTableDataFromVisualization().then((data) => { expect(data).to.deep.eq(expectedData); }); @@ -117,62 +114,74 @@ describe('table visualization in embedded mode', () => { it('Should filter for value in embedded mode', () => { cy.tbClickTableCellAction(2, 0, 0, 'filter for', 0, true); + cy.wait(2000); cy.reload(); + cy.wait(2000); cy.tbGetTableDataFromVisualization().then((data) => { expect(data).to.deep.eq(['0', '1,059']); }); commonUI.removeFilter('age'); + cy.wait(2000); cy.reload(); + cy.wait(2000); cy.tbGetTableDataFromVisualization().then((data) => { expect(data).to.deep.eq(expectedData); }); + cy.wait(2000); cy.tbClickTableCellAction(2, 0, 0, 'expand', 0, true); + cy.wait(2000); cy.tbClickFilterFromExpand('filter for'); + cy.wait(2000); cy.reload(); + cy.wait(2000); cy.tbGetTableDataFromVisualization().then((data) => { expect(data).to.deep.eq(['0', '1,059']); }); commonUI.removeFilter('age'); + cy.wait(2000); cy.reload(); + cy.wait(2000); cy.tbGetTableDataFromVisualization().then((data) => { expect(data).to.deep.eq(expectedData); }); }); - it('Should filter out value in embedded mode', () => { - const expectedFilterOutData = [ - '20', - '2,236', - '40', - '2,200', - '60', - '2,211', - '80', - '2,179', - '100', - '115', - ]; - cy.tbClickTableCellAction(2, 0, 0, 'filter out', 0, true); - cy.reload(); - cy.tbGetTableDataFromVisualization().then((data) => { - expect(data).to.deep.eq(expectedFilterOutData); - }); - commonUI.removeFilter('age'); - cy.reload(); - cy.tbGetTableDataFromVisualization().then((data) => { - expect(data).to.deep.eq(expectedData); - }); - cy.tbClickTableCellAction(2, 0, 0, 'expand', 0, true); - suppressResizeObserverIssue(); - cy.tbClickFilterFromExpand('filter out'); - cy.reload(); - cy.tbGetTableDataFromVisualization().then((data) => { - expect(data).to.deep.eq(expectedFilterOutData); - }); - commonUI.removeFilter('age'); - cy.reload(); - cy.tbGetTableDataFromVisualization().then((data) => { - expect(data).to.deep.eq(expectedData); + if (!Cypress.env('SECURITY_ENABLED')) { + it('Should filter out value in embedded mode', () => { + const expectedFilterOutData = [ + '20', + '2,236', + '40', + '2,200', + '60', + '2,211', + '80', + '2,179', + '100', + '115', + ]; + cy.tbClickTableCellAction(2, 0, 0, 'filter out', 0, true); + cy.reload(); + cy.tbGetTableDataFromVisualization().then((data) => { + expect(data).to.deep.eq(expectedFilterOutData); + }); + commonUI.removeFilter('age'); + cy.reload(); + cy.tbGetTableDataFromVisualization().then((data) => { + expect(data).to.deep.eq(expectedData); + }); + cy.tbClickTableCellAction(2, 0, 0, 'expand', 0, true); + cy.wait(2000); + cy.tbClickFilterFromExpand('filter out'); + cy.reload(); + cy.tbGetTableDataFromVisualization().then((data) => { + expect(data).to.deep.eq(expectedFilterOutData); + }); + commonUI.removeFilter('age'); + cy.reload(); + cy.tbGetTableDataFromVisualization().then((data) => { + expect(data).to.deep.eq(expectedData); + }); }); - }); + } }); diff --git a/integtest.sh b/integtest.sh index 1dd81db15..4585ceac4 100755 --- a/integtest.sh +++ b/integtest.sh @@ -222,6 +222,12 @@ if [ "$DISABLE_VIDEO" = "true" ]; then mv -v cypress_new.json cypress.json fi +# Windows does not set timezone even when you specify `env TZ=America/Los_Angeles` +# Using powershell to force the timezone change to PST which is same as America/Los_Angeles +if [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "win32" ]; then + powershell -Command "Set-TimeZone -Id 'Pacific Standard Time' -PassThru" +fi + if [ "$SECURITY_ENABLED" = "true" ]; then echo "Running security enabled tests" yarn cypress:run-with-security --browser "$BROWSER_PATH" --spec "$TEST_FILES" diff --git a/package.json b/package.json index af32e0688..1d80ec6e1 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "opensearch-dashboards-functional-test", - "version": "3.0.0", + "version": "2.15.0", "description": "Maintains functional tests for OpenSearch Dashboards and Dashboards plugins", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "cypress:open": "cypress open", "cypress:run-without-security": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=false", - "cypress:run-with-security": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200,WAIT_FOR_LOADER_BUFFER_MS=500", - "cypress:run-with-security-and-aggregation-view": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200,AGGREGATION_VIEW=true,WAIT_FOR_LOADER_BUFFER_MS=500", + "cypress:run-with-security": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200,WAIT_FOR_LOADER_BUFFER_MS=3000", + "cypress:run-with-security-and-aggregation-view": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200,AGGREGATION_VIEW=true,WAIT_FOR_LOADER_BUFFER_MS=3000", "cypress:run-plugin-tests-without-security": "yarn cypress:run-without-security --spec 'cypress/integration/plugins/*/*.js'", "cypress:run-plugin-tests-with-security": "yarn cypress:run-with-security --spec 'cypress/integration/plugins/*/*.js'", "cypress:release-chrome": "yarn cypress:run-with-security --browser chrome --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/*.js,cypress/integration/plugins/*/*'", @@ -25,15 +25,15 @@ "pkg-version": "./scripts/getpkgversion.sh", "generate:test-data": "node ./scripts/generate_data/index.js", "postinstall": "husky install", - "osd:ciGroup1": "echo \"apps/vis_builder/*.js\"", - "osd:ciGroup2": "echo \"apps/vis_type_table/*.js\"", - "osd:ciGroup3": "echo \"apps/vis-augmenter/*.js\"", - "osd:ciGroup4": "echo \"dashboard_sample_data_with_datasource_spec.js,dashboard_sanity_test_spec.js,apps/telemetry/*.js\"", - "osd:ciGroup5": "echo \"datasource-management-plugin/*.js\"", - "osd:ciGroup6": "echo \"apps/data_explorer/aaa_before.spec.js,apps/data_explorer/data_source_selector.spec.js,apps/data_explorer/date_nanos_mixed.spec.js,apps/data_explorer/date_nanos.spec.js,apps/data_explorer/discover_histogram.spec.js,apps/data_explorer/discover.spec.js,apps/data_explorer/zzz_after.spec.js\"", - "osd:ciGroup7": "echo \"apps/data_explorer/aaa_before.spec.js,apps/data_explorer/doc_navigation.spec.js,apps/data_explorer/doc_table.spec.js,apps/data_explorer/errors.spec.js,apps/data_explorer/field_data.spec.js,apps/data_explorer/zzz_after.spec.js\"", - "osd:ciGroup8": "echo \"apps/data_explorer/aaa_before.spec.js,apps/data_explorer/field_visualize.spec.js,apps/data_explorer/filter_editor.spec.js,apps/data_explorer/index_pattern_with_encoded_id.spec.js,apps/data_explorer/index_pattern_without_field.spec.js,apps/data_explorer/zzz_after.spec.js\"", - "osd:ciGroup9": "echo \"apps/data_explorer/aaa_before.spec.js,apps/data_explorer/inspector.spec.js,apps/data_explorer/large_string.spec.js,apps/data_explorer/saved_queries.spec.js,apps/data_explorer/shared_links.spec.js,apps/data_explorer/sidebar.spec.js,apps/data_explorer/source_filter.spec.js,apps/data_explorer/zzz_after.spec.js\"", + "osd:ciGroup1": "echo apps/vis_builder/*.js", + "osd:ciGroup2": "echo apps/vis_type_table/*.js", + "osd:ciGroup3": "echo apps/vis-augmenter/*.js", + "osd:ciGroup4": "echo dashboard_sample_data_with_datasource_spec.js,dashboard_sanity_test_spec.js,apps/telemetry/*.js", + "osd:ciGroup5": "echo datasource-management-plugin/*.js", + "osd:ciGroup6": "echo apps/data_explorer/aaa_before.spec.js,apps/data_explorer/data_source_selector.spec.js,apps/data_explorer/date_nanos_mixed.spec.js,apps/data_explorer/date_nanos.spec.js,apps/data_explorer/discover_histogram.spec.js,apps/data_explorer/discover.spec.js,apps/data_explorer/zzz_after.spec.js", + "osd:ciGroup7": "echo apps/data_explorer/aaa_before.spec.js,apps/data_explorer/doc_navigation.spec.js,apps/data_explorer/doc_table.spec.js,apps/data_explorer/errors.spec.js,apps/data_explorer/field_data.spec.js,apps/data_explorer/zzz_after.spec.js", + "osd:ciGroup8": "echo apps/data_explorer/aaa_before.spec.js,apps/data_explorer/field_visualize.spec.js,apps/data_explorer/filter_editor.spec.js,apps/data_explorer/index_pattern_with_encoded_id.spec.js,apps/data_explorer/index_pattern_without_field.spec.js,apps/data_explorer/zzz_after.spec.js", + "osd:ciGroup9": "echo apps/data_explorer/aaa_before.spec.js,apps/data_explorer/inspector.spec.js,apps/data_explorer/large_string.spec.js,apps/data_explorer/saved_queries.spec.js,apps/data_explorer/shared_links.spec.js,apps/data_explorer/sidebar.spec.js,apps/data_explorer/source_filter.spec.js,apps/data_explorer/zzz_after.spec.js", "start-dummy-llm-server": "node ./cypress/support/assistant-dummy-llm.js" }, "repository": { @@ -53,8 +53,6 @@ "prettier": "^2.5.1" }, "devDependencies": { - "@faker-js/faker": "^7.6.0", - "commander": "^9.4.1", "cypress": "9.5.4", "cypress-multi-reporters": "^1.5.0", "cypress-real-events": "1.7.6", @@ -65,7 +63,6 @@ "eslint-plugin-import": "^2.26.0", "eslint-plugin-prettier": "^4.0.0", "husky": "^6.0.0", - "luxon": "^3.2.1", "mocha-junit-reporter": "^2.0.0" }, "overrides": {