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.
Upgrade Cypress to v12 (opensearch-project#8995)
* Update Cypress to v12 (opensearch-project#8926) * Update cypress to v12 Signed-off-by: Daniel Rowe <rowdane@amazon.com> * Add required e2e.js Signed-off-by: Daniel Rowe <rowdane@amazon.com> * Changeset file for PR opensearch-project#8926 created/updated * Update license header Signed-off-by: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> * Update license in e2e.js Signed-off-by: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> --------- Signed-off-by: Daniel Rowe <rowdane@amazon.com> Signed-off-by: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> Co-authored-by: Daniel Rowe <rowdane@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> * fix: support imports without extensions in cypress webpack build (opensearch-project#8993) * fix: support imports without extensions in cypress webpack build Signed-off-by: Daniel Rowe <rowdane@amazon.com> * Changeset file for PR opensearch-project#8993 created/updated * use typescript config Signed-off-by: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> * fix lint Signed-off-by: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> * disable new test isolation feature This isolation was causing regressions Signed-off-by: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> --------- Signed-off-by: Daniel Rowe <rowdane@amazon.com> Signed-off-by: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --------- Signed-off-by: Daniel Rowe <rowdane@amazon.com> Signed-off-by: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
293 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
chore: | ||
- Update cypress to v12 ([#8926](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8926)) |
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,2 @@ | ||
fix: | ||
- Support imports without extensions in cypress webpack build ([#8993](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8993)) |
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,65 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { defineConfig } from 'cypress'; | ||
import webpackPreprocessor from '@cypress/webpack-preprocessor'; | ||
|
||
module.exports = defineConfig({ | ||
defaultCommandTimeout: 60000, | ||
requestTimeout: 60000, | ||
responseTimeout: 60000, | ||
viewportWidth: 2000, | ||
viewportHeight: 1320, | ||
env: { | ||
openSearchUrl: 'http://localhost:9200', | ||
SECURITY_ENABLED: false, | ||
AGGREGATION_VIEW: false, | ||
username: 'admin', | ||
password: 'myStrongPassword123!', | ||
ENDPOINT_WITH_PROXY: false, | ||
MANAGED_SERVICE_ENDPOINT: false, | ||
VISBUILDER_ENABLED: true, | ||
DATASOURCE_MANAGEMENT_ENABLED: false, | ||
ML_COMMONS_DASHBOARDS_ENABLED: true, | ||
WAIT_FOR_LOADER_BUFFER_MS: 0, | ||
}, | ||
e2e: { | ||
baseUrl: 'http://localhost:5601', | ||
specPattern: 'cypress/integration/**/*_spec.{js,jsx,ts,tsx}', | ||
testIsolation: false, | ||
setupNodeEvents, | ||
}, | ||
}); | ||
|
||
function setupNodeEvents( | ||
on: Cypress.PluginEvents, | ||
config: Cypress.PluginConfigOptions | ||
): Cypress.PluginConfigOptions { | ||
const { webpackOptions } = webpackPreprocessor.defaultOptions; | ||
|
||
/** | ||
* By default, cypress' internal webpack preprocessor doesn't allow imports without file extensions. | ||
* This makes our life a bit hard since if any file in our testing dependency graph has an import without | ||
* the .js extension our cypress build will fail. | ||
* | ||
* This extra rule relaxes this a bit by allowing imports without file extension | ||
* ex. import module from './module' | ||
*/ | ||
webpackOptions!.module!.rules.unshift({ | ||
test: /\.m?js/, | ||
resolve: { | ||
enforceExtension: false, | ||
}, | ||
}); | ||
|
||
on( | ||
'file:preprocessor', | ||
webpackPreprocessor({ | ||
webpackOptions, | ||
}) | ||
); | ||
|
||
return config; | ||
} |
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import '../utils/commands'; |
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
Oops, something went wrong.