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

[8.10] Bump cypress@13.3.0 (#162383) #167732

Merged
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
30 changes: 27 additions & 3 deletions .buildkite/pipelines/pull_request/security_solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,31 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 10
parallelism: 16
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_solution_explore.sh
label: 'Explore - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 4
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_solution_investigations.sh
label: 'Investigations - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 8
retry:
automatic:
- exit_status: '*'
Expand All @@ -18,8 +42,8 @@ steps:
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
timeout_in_minutes: 60
parallelism: 1
soft_fail: true
artifact_paths:
- "target/kibana-security-solution/**/*"
- "target/kibana-security-solution/**/*"
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"yarn": "^1.22.19"
},
"resolutions": {
"**/@types/node": "18.17.1",
"**/@types/node": "18.17.5",
"**/@typescript-eslint/utils": "5.62.0",
"**/chokidar": "^3.5.3",
"**/globule/minimatch": "^3.1.2",
Expand Down Expand Up @@ -1316,7 +1316,7 @@
"@types/multistream": "^4.1.0",
"@types/mustache": "^0.8.31",
"@types/nock": "^10.0.3",
"@types/node": "18.17.1",
"@types/node": "18.17.5",
"@types/node-fetch": "2.6.4",
"@types/node-forge": "^1.3.1",
"@types/nodemailer": "^6.4.0",
Expand Down Expand Up @@ -1415,13 +1415,13 @@
"cssnano": "^5.1.12",
"cssnano-preset-default": "^5.2.12",
"csstype": "^3.0.2",
"cypress": "^12.17.4",
"cypress-axe": "^1.4.0",
"cypress": "^13.3.0",
"cypress-axe": "^1.5.0",
"cypress-file-upload": "^5.0.8",
"cypress-multi-reporters": "^1.6.3",
"cypress-react-selector": "^3.0.0",
"cypress-real-events": "^1.8.1",
"cypress-recurse": "^1.35.1",
"cypress-real-events": "^1.10.3",
"cypress-recurse": "^1.35.2",
"date-fns": "^2.29.3",
"debug": "^2.6.9",
"delete-empty": "^2.0.0",
Expand Down
5 changes: 1 addition & 4 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,8 @@
},
{
"groupName": "cypress",
"matchPackageNames": [
"eslint-plugin-cypress"
],
"matchPackagePatterns": [
"^cypress"
"cypress"
],
"reviewers": [
"Team:apm",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/apm/ftr_e2e/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default defineCypressConfig({
viewportHeight: 1800,
viewportWidth: 1440,
video: true,
videoUploadOnPasses: false,
screenshotOnRunFailure: true,
retries: {
runMode: 1,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/ftr_e2e/cypress_test_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function cypressTestRunner({ getService }: FtrProviderContext) {
const res = await cypressExecution({
...cypressCliArgs,
project: cypressProjectPath,
browser: 'chrome',
browser: 'electron',
config: {
e2e: {
baseUrl: kibanaUrlWithoutAuth,
Expand Down
7 changes: 6 additions & 1 deletion x-pack/plugins/apm/ftr_e2e/ftr_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ async function ftrConfig({ readConfigFile }: FtrConfigProviderContext) {
const result = await cypressTestRunner(ftrProviderContext);

// set exit code explicitly if at least one Cypress test fails
if (result && (result.status === 'failed' || result.totalFailed > 0)) {
if (
result &&
((result as CypressCommandLine.CypressFailedRunResult)?.status ===
'failed' ||
(result as CypressCommandLine.CypressRunResult)?.totalFailed)
) {
process.exitCode = 1;
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default defineCypressConfig({
viewportHeight: 1800,
viewportWidth: 1440,
video: false,
videoUploadOnPasses: false,
screenshotOnRunFailure: false,
retries: {
runMode: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ async function testRunner(ftrProviderContext: FtrProviderContext) {
cypressExecution: cypress.run,
});

if (result && (result.status === 'failed' || result.totalFailed > 0)) {
if (
result &&
((result as CypressCommandLine.CypressFailedRunResult)?.status ===
'failed' ||
(result as CypressCommandLine.CypressRunResult)?.totalFailed)
) {
process.exit(1);
}
}
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/profiling/e2e/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default defineCypressConfig({
viewportHeight: 1800,
viewportWidth: 1440,
video: false,
videoUploadOnPasses: false,
screenshotOnRunFailure: false,
retries: {
runMode: 1,
Expand Down
8 changes: 6 additions & 2 deletions x-pack/plugins/profiling/e2e/ftr_config_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ async function ftrConfigRun({ readConfigFile }: FtrConfigProviderContext) {
async function testRunner(ftrProviderContext: FtrProviderContext) {
const result = await cypressTestRunner({ ftrProviderContext, cypressExecution: cypress.run });

if (result && (result.status === 'failed' || result.totalFailed > 0)) {
process.exit(1);
if (
result &&
((result as CypressCommandLine.CypressFailedRunResult)?.status === 'failed' ||
(result as CypressCommandLine.CypressRunResult)?.totalFailed)
) {
process.exitCode = 1;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ ${JSON.stringify(cyCustomEnv, null, 2)}
renderSummaryTable(results as CypressCommandLine.CypressRunResult[]);
const hasFailedTests = _.some(
results,
(result) => result?.status === 'finished' && result.totalFailed > 0
(result) =>
(result as CypressCommandLine.CypressFailedRunResult)?.status === 'failed' ||
(result as CypressCommandLine.CypressRunResult)?.totalFailed
);
if (hasFailedTests) {
throw createFailError('Not all tests passed');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ export function renderSummaryTable(results: CypressCommandLine.CypressRunResult[
const parsedResults = _.reduce(
results,
(acc: CypressCommandLine.CypressRunResult, result) => {
acc.status = result.status;
acc.startedTestsAt =
acc.startedTestsAt && new Date(result.startedTestsAt) > new Date(acc.startedTestsAt)
? acc.startedTestsAt
Expand Down Expand Up @@ -358,12 +357,8 @@ export function renderSummaryTable(results: CypressCommandLine.CypressRunResult[

_.each(runs, (run) => {
const { spec, stats } = run;
const ms = durationInMinutes(stats.duration);
const formattedSpec = formatPath(spec.relativeToCommonRoot, getWidth(table2, 1));

if (run.skippedSpec) {
return table2.push(['-', formattedSpec, color('SKIPPED', 'gray'), '-', '-', '-', '-', '-']);
}
const ms = durationInMinutes(stats?.duration ?? 0);
const formattedSpec = formatPath(spec.relative, getWidth(table2, 1));

return table2.push([
formatSymbolSummary(stats.failures),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,21 +262,19 @@ describe(`Detections : Page Filters`, { tags: [tag.ESS, tag.BROKEN_IN_SERVERLESS
});

it(`URL is updated when filters are updated`, () => {
cy.on('url:changed', (urlString) => {
const NEW_FILTERS = DEFAULT_DETECTION_PAGE_FILTERS.map((filter) => {
return {
...filter,
selectedOptions: filter.title === 'Severity' ? ['high'] : filter.selectedOptions,
};
});
const expectedVal = encode(formatPageFilterSearchParam(NEW_FILTERS));
expect(urlString).to.contain.text(expectedVal);
});

openPageFilterPopover(1);
cy.get(OPTION_SELECTABLE(1, 'high')).should('be.visible');
cy.get(OPTION_SELECTABLE(1, 'high')).click({});
closePageFilterPopover(1);

const NEW_FILTERS = DEFAULT_DETECTION_PAGE_FILTERS.map((filter) => {
return {
...filter,
selectedOptions: filter.title === 'Severity' ? ['high'] : filter.selectedOptions,
};
});
const expectedVal = encode(formatPageFilterSearchParam(NEW_FILTERS));
cy.url().should('include', expectedVal);
});

it(`Filters are restored from localstorage when user navigates back to the page.`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,35 +70,14 @@ describe('Open timeline', { tags: [tag.BROKEN_IN_SERVERLESS, tag.ESS] }, () => {
openTimelineById(this.timelineId);
});

it('should open a modal', () => {
it('should display timeline info', () => {
cy.get(OPEN_TIMELINE_MODAL).should('be.visible');
});

it('should display timeline info - title', () => {
cy.contains(getTimeline().title).should('exist');
});

it('should display timeline info - description', () => {
cy.get(TIMELINES_DESCRIPTION).last().should('have.text', getTimeline().description);
});

it('should display timeline info - pinned event count', () => {
cy.get(TIMELINES_PINNED_EVENT_COUNT).last().should('have.text', '1');
});

it('should display timeline info - notes count', () => {
cy.get(TIMELINES_NOTES_COUNT).last().should('have.text', '1');
});

it('should display timeline info - favorite timeline', () => {
cy.get(TIMELINES_FAVORITE).last().should('exist');
});

it('should display timeline content - title', () => {
cy.get(TIMELINE_TITLE).should('have.text', getTimeline().title);
});

it('should display timeline content - description', () => {
cy.get(TIMELINE_DESCRIPTION).should('have.text', getTimeline().description);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default defineCypressConfig({
viewportHeight: 1800,
viewportWidth: 1440,
video: false,
videoUploadOnPasses: false,
screenshotOnRunFailure: false,
retries: {
runMode: 1,
Expand Down
Loading
Loading