Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Upgrade Cypress to 10.11.0 #23813

Merged
merged 6 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/bashlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ cypress-run() {

say "::group::Run Cypress for [$page]"
if [[ -z $CYPRESS_KEY ]]; then
$cypress --spec "cypress/integration/$page" --browser "$browser"
$cypress --spec "cypress/e2e/$page" --browser "$browser"
else
export CYPRESS_RECORD_KEY=$(echo $CYPRESS_KEY | base64 --decode)
# additional flags for Cypress dashboard recording
$cypress --spec "cypress/integration/$page" --browser "$browser" \
$cypress --spec "cypress/e2e/$page" --browser "$browser" \
--record --group "$group" --tag "${GITHUB_REPOSITORY},${GITHUB_EVENT_NAME}" \
--parallel --ci-build-id "${GITHUB_SHA:0:8}-${NONCE}"
fi
Expand Down Expand Up @@ -232,7 +232,7 @@ cypress-run-applitools() {
nohup flask run --no-debugger -p $port >"$flasklog" 2>&1 </dev/null &
local flaskProcessId=$!

$cypress --spec "cypress/integration/*/**/*.applitools.test.ts" --browser "$browser" --headless --config ignoreTestFiles="[]"
$cypress --spec "cypress/e2e/*/**/*.applitools.test.ts" --browser "$browser" --headless --config ignoreTestFiles="[]"

codecov -c -F "cypress" || true

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,10 @@ npm install
npm run cypress-run-chrome

# run tests from a specific file
npm run cypress-run-chrome -- --spec cypress/integration/explore/link.test.ts
npm run cypress-run-chrome -- --spec cypress/e2e/explore/link.test.ts

# run specific file with video capture
npm run cypress-run-chrome -- --spec cypress/integration/dashboard/index.test.js --config video=true
npm run cypress-run-chrome -- --spec cypress/e2e/dashboard/index.test.js --config video=true

# to open the cypress ui
npm run cypress-debug
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/contributing/testing-locally.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ npm install
npm run cypress-run-chrome

# run tests from a specific file
npm run cypress-run-chrome -- --spec cypress/integration/explore/link.test.ts
npm run cypress-run-chrome -- --spec cypress/e2e/explore/link.test.ts

# run specific file with video capture
npm run cypress-run-chrome -- --spec cypress/integration/dashboard/index.test.js --config video=true
npm run cypress-run-chrome -- --spec cypress/e2e/dashboard/index.test.js --config video=true

# to open the cypress ui
npm run cypress-debug
Expand Down
48 changes: 48 additions & 0 deletions superset-frontend/cypress-base/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License 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.
*/
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'cypress';

export default defineConfig({
chromeWebSecurity: false,
defaultCommandTimeout: 8000,
numTestsKeptInMemory: 0,
experimentalFetchPolyfill: true,
requestTimeout: 10000,
video: false,
videoUploadOnPasses: false,
viewportWidth: 1280,
viewportHeight: 1024,
projectId: 'ukwxzo',
retries: {
runMode: 2,
openMode: 0,
},
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
// eslint-disable-next-line global-require,import/extensions
return require('./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:8088',
excludeSpecPattern: ['**/*.applitools.test.ts'],
specPattern: ['cypress/e2e/**/*.{js,jsx,ts,tsx}'],
},
});
18 changes: 0 additions & 18 deletions superset-frontend/cypress-base/cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function clearMetadata() {
cy.wrap($jsonmetadata).find('.ace_content').click();
cy.wrap($jsonmetadata)
.find('.ace_text-input')
.type('{selectall} {backspace}');
.type('{selectall} {backspace}', { force: true });
});
}

Expand All @@ -162,7 +162,7 @@ function writeMetadata(metadata: string) {
cy
.wrap($jsonmetadata)
.find('.ace_text-input')
.type(metadata, { parseSpecialCharSequences: false }),
.type(metadata, { parseSpecialCharSequences: false, force: true }),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ export function fillNativeFilterForm(
.find(nativeFilters.filtersPanel.filterName)
.last()
.click({ scrollBehavior: false })
.clear()
.type(name, { scrollBehavior: false });
.clear({ force: true })
.type(name, { scrollBehavior: false, force: true });
if (dataset) {
cy.get(nativeFilters.modal.container)
.find(nativeFilters.filtersPanel.datasetName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import { CHART_LIST } from 'cypress/utils/urls';
import { interceptGet as interceptDashboardGet } from 'cypress/integration/dashboard/utils';
import { interceptGet as interceptDashboardGet } from 'cypress/e2e/dashboard/utils';
import { FORM_DATA_DEFAULTS, NUM_METRIC } from './visualizations/shared.helper';
import {
interceptFiltering,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function saveChartToDashboard(dashboardName: string) {
.click();
cy.get(
'.ant-select-selection-search-input[aria-label="Select a dashboard"]',
).type(dashboardName.slice(0, 3));
).type(dashboardName.slice(0, 3), { force: true });
cy.get(`.ant-select-item-option[title="${dashboardName}"]`).click();
cy.getBySel('btn-modal-save').click();

Expand Down
Loading