diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 000000000..4c47aadd4 --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,46 @@ +const { defineConfig } = require("cypress"); + +module.exports = defineConfig({ + e2e: { + defaultCommandTimeout: 60000, + requestTimeout: 60000, + responseTimeout: 60000, + baseUrl: "http://localhost:5601", + viewportWidth: 2000, + viewportHeight: 1320, + env: { + openSearchUrl: "http://localhost:9200", + SECURITY_ENABLED: false, + username: "admin", + password: "admin", + }, + clientCertificates: [ + { + url: "https://localhost:9200/.opendistro-ism*", + ca: ["cypress/resources/root-ca.pem"], + certs: [ + { + cert: "cypress/resources/kirk.pem", + key: "cypress/resources/kirk-key.pem", + passphrase: "", + }, + ], + }, + { + url: "https://localhost:9200/.opendistro-ism-config/_update_by_query/", + ca: ["cypress/resources/root-ca.pem"], + certs: [ + { + cert: "cypress/resources/kirk.pem", + key: "cypress/resources/kirk-key.pem", + passphrase: "", + }, + ], + }, + ], + setupNodeEvents(on, config) { + // implement node event listeners here + return config; + }, + }, +}); diff --git a/cypress.json b/cypress.json deleted file mode 100644 index 8fa8462ca..000000000 --- a/cypress.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "defaultCommandTimeout": 60000, - "requestTimeout": 60000, - "responseTimeout": 60000, - "baseUrl": "http://localhost:5601", - "viewportWidth": 2000, - "viewportHeight": 1320, - "env": - { - "openSearchUrl": "http://localhost:9200", - "SECURITY_ENABLED": false, - "username": "admin", - "password": "admin" - }, - "clientCertificates": - [ - { - "url": "https://localhost:9200/.opendistro-ism*", - "ca": - [ - "cypress/resources/root-ca.pem" - ], - "certs": - [ - { - "cert": "cypress/resources/kirk.pem", - "key": "cypress/resources/kirk-key.pem", - "passphrase": "" - } - ] - }, - { - "url": "https://localhost:9200/.opendistro-ism-config/_update_by_query/", - "ca": - [ - "cypress/resources/root-ca.pem" - ], - "certs": - [ - { - "cert": "cypress/resources/kirk.pem", - "key": "cypress/resources/kirk-key.pem", - "passphrase": "" - } - ] - } - ] -} \ No newline at end of file diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js b/cypress/e2e/plugins/index-management-dashboards-plugin/aliases.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/aliases.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/aliases.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/create_index.js b/cypress/e2e/plugins/index-management-dashboards-plugin/create_index.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/create_index.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/create_index.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/data_streams.js b/cypress/e2e/plugins/index-management-dashboards-plugin/data_streams.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/data_streams.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/data_streams.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/force_merge.js b/cypress/e2e/plugins/index-management-dashboards-plugin/force_merge.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/force_merge.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/force_merge.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js b/cypress/e2e/plugins/index-management-dashboards-plugin/indices_spec.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/indices_spec.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/managed_indices_spec.js b/cypress/e2e/plugins/index-management-dashboards-plugin/managed_indices_spec.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/managed_indices_spec.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/managed_indices_spec.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/notification_settings.js b/cypress/e2e/plugins/index-management-dashboards-plugin/notification_settings.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/notification_settings.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/notification_settings.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/policies_spec.js b/cypress/e2e/plugins/index-management-dashboards-plugin/policies_spec.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/policies_spec.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/policies_spec.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/refresh_index.js b/cypress/e2e/plugins/index-management-dashboards-plugin/refresh_index.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/refresh_index.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/refresh_index.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/reindex_spec.js b/cypress/e2e/plugins/index-management-dashboards-plugin/reindex_spec.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/reindex_spec.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/reindex_spec.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/rollover.js b/cypress/e2e/plugins/index-management-dashboards-plugin/rollover.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/rollover.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/rollover.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js b/cypress/e2e/plugins/index-management-dashboards-plugin/rollups_spec.js similarity index 97% rename from cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/rollups_spec.js index 0560c7686..ae881e37f 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js +++ b/cypress/e2e/plugins/index-management-dashboards-plugin/rollups_spec.js @@ -256,9 +256,7 @@ describe("Rollups", () => { cy.wait("@getRollup").wait(2000); // Click Disable button - cy.get(`[data-test-subj="disableButton"]`) - .should("not.be.disabled") - .click({ force: true }); + cy.get(`[data-test-subj="disableButton"]`).should("not.be.disabled").click({ force: true }); cy.wait("@stopRollup"); cy.wait("@getRollup"); @@ -270,9 +268,7 @@ describe("Rollups", () => { cy.wait(2000); // Click Enable button - cy.get(`[data-test-subj="enableButton"]`) - .should("not.be.disabled") - .click({ force: true }); + cy.get(`[data-test-subj="enableButton"]`).should("not.be.disabled").click({ force: true }); // Confirm we get toaster saying rollup job is enabled cy.contains(`${ROLLUP_ID} is enabled`); diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/snapshots_spec.js b/cypress/e2e/plugins/index-management-dashboards-plugin/snapshots_spec.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/snapshots_spec.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/snapshots_spec.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/split_index.js b/cypress/e2e/plugins/index-management-dashboards-plugin/split_index.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/split_index.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/split_index.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/template_components.js b/cypress/e2e/plugins/index-management-dashboards-plugin/template_components.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/template_components.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/template_components.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/templates.js b/cypress/e2e/plugins/index-management-dashboards-plugin/templates.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/templates.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/templates.js diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js b/cypress/e2e/plugins/index-management-dashboards-plugin/transforms_spec.js similarity index 100% rename from cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js rename to cypress/e2e/plugins/index-management-dashboards-plugin/transforms_spec.js diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js deleted file mode 100644 index eee870220..000000000 --- a/cypress/plugins/index.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -/// -// *********************************************************** -// 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) - -// TODO: yarn osd bootstrap fails when trying to add below package as a dependency.. -// const wp = require("@cypress/webpack-preprocessor"); -// -/** - * @type {Cypress.PluginConfig} - */ -module.exports = (on) => { - // const options = { - // webpackOptions: { - // resolve: { - // extensions: [".ts", ".tsx", ".js", ".jsx", ".json"], - // }, - // module: { - // rules: [ - // { - // test: /\.tsx?$/, - // loader: "ts-loader", - // options: { transpileOnly: true }, - // }, - // ], - // }, - // }, - // }; - // - // on("file:preprocessor", wp(options)); -}; diff --git a/cypress/support/index.js b/cypress/support/e2e.js similarity index 100% rename from cypress/support/index.js rename to cypress/support/e2e.js