From feb29004f3ed4aac64e2eacaa1785dfb69ba652e Mon Sep 17 00:00:00 2001 From: mirobo <78788210+mirobo@users.noreply.github.com> Date: Thu, 30 Jun 2022 16:17:29 +0200 Subject: [PATCH 1/9] fix: don't cut off a longer runUrl renderTables will cut off longer urls which "renders" the url unusable --- packages/server/lib/modes/run.js | 16 ++-------- system-tests/__snapshots__/record_spec.js | 38 +++++++++++------------ 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/packages/server/lib/modes/run.js b/packages/server/lib/modes/run.js index c27b8f251c0..adfd2e7afb5 100644 --- a/packages/server/lib/modes/run.js +++ b/packages/server/lib/modes/run.js @@ -399,20 +399,8 @@ const renderSummaryTable = (runUrl) => { if (runUrl) { console.log('') - - const table4 = terminal.table({ - colWidths: [100], - type: 'pageDivider', - style: { - 'padding-left': 2, - }, - }) - - table4.push(['', '']) - table4.push([`Recorded Run: ${formatPath(runUrl, getWidth(table4, 0), 'gray')}`]) - - console.log(terminal.renderTables(table4)) - + // renderTables will cut off longer urls which "renders" the url unusable + console.log(` Recorded Run: ${runUrl}`) console.log('') } } diff --git a/system-tests/__snapshots__/record_spec.js b/system-tests/__snapshots__/record_spec.js index 256e2c592e8..7205428d081 100644 --- a/system-tests/__snapshots__/record_spec.js +++ b/system-tests/__snapshots__/record_spec.js @@ -251,7 +251,7 @@ We dynamically generated a new test to display this failure. ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -348,7 +348,7 @@ StatusCodeError: 500 - "Internal Server Error" ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -462,7 +462,7 @@ exports['e2e record video recording does not upload when not enabled 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -544,7 +544,7 @@ exports['e2e record api interaction errors uploading assets warns but proceeds 1 ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -698,7 +698,7 @@ exports['e2e record parallelization passes in parallel with group 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -913,7 +913,7 @@ We dynamically generated a new test to display this failure. ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1159,7 +1159,7 @@ StatusCodeError: 500 - "Internal Server Error" ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1361,7 +1361,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1441,7 +1441,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1526,7 +1526,7 @@ Details: ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1862,7 +1862,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1944,7 +1944,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2024,7 +2024,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2104,7 +2104,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2184,7 +2184,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2454,7 +2454,7 @@ exports['e2e record api skips specs records tests and exits without executing 1' ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 Exiting with non-zero exit code because the run was canceled. @@ -2533,7 +2533,7 @@ exports['e2e record api skips specs records tests and exits without executing in ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 Exiting with non-zero exit code because the run was canceled. @@ -2630,7 +2630,7 @@ exports['e2e record empty specs succeeds when empty spec file 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2723,7 +2723,7 @@ exports['e2e record metadata sends Studio usage metadata 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` From 9005216bb7d17a9b6bc920b69f9999c2af59e11b Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Mon, 11 Jul 2022 11:48:36 +1000 Subject: [PATCH 2/9] chore: rework run mode logging to show entire dashboard url --- system-tests/__snapshots__/record_spec.js | 38 +++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/system-tests/__snapshots__/record_spec.js b/system-tests/__snapshots__/record_spec.js index 7205428d081..1fc4fa41a3e 100644 --- a/system-tests/__snapshots__/record_spec.js +++ b/system-tests/__snapshots__/record_spec.js @@ -251,8 +251,8 @@ We dynamically generated a new test to display this failure. ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -348,8 +348,8 @@ StatusCodeError: 500 - "Internal Server Error" ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -462,8 +462,8 @@ exports['e2e record video recording does not upload when not enabled 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -544,8 +544,8 @@ exports['e2e record api interaction errors uploading assets warns but proceeds 1 ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -698,8 +698,8 @@ exports['e2e record parallelization passes in parallel with group 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -913,8 +913,8 @@ We dynamically generated a new test to display this failure. ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1159,8 +1159,8 @@ StatusCodeError: 500 - "Internal Server Error" ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1361,8 +1361,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1441,8 +1441,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1526,8 +1526,8 @@ Details: ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1862,8 +1862,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1944,8 +1944,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2024,8 +2024,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2104,8 +2104,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2184,8 +2184,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2454,8 +2454,8 @@ exports['e2e record api skips specs records tests and exits without executing 1' ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 Exiting with non-zero exit code because the run was canceled. @@ -2533,8 +2533,8 @@ exports['e2e record api skips specs records tests and exits without executing in ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 Exiting with non-zero exit code because the run was canceled. @@ -2630,8 +2630,8 @@ exports['e2e record empty specs succeeds when empty spec file 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2723,8 +2723,8 @@ exports['e2e record metadata sends Studio usage metadata 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` From 0a852307d84bed79b7a4a9408e0d590727ca38cc Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Mon, 11 Jul 2022 12:15:18 +1000 Subject: [PATCH 3/9] commit logic --- packages/server/lib/modes/run.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/server/lib/modes/run.js b/packages/server/lib/modes/run.js index adfd2e7afb5..d1bcdb9b918 100644 --- a/packages/server/lib/modes/run.js +++ b/packages/server/lib/modes/run.js @@ -399,9 +399,20 @@ const renderSummaryTable = (runUrl) => { if (runUrl) { console.log('') - // renderTables will cut off longer urls which "renders" the url unusable - console.log(` Recorded Run: ${runUrl}`) + + const table4 = terminal.table({ + colWidths: [100], + type: 'pageDivider', + style: { + 'padding-left': 2, + }, + }) + + table4.push(['', '']) + console.log(terminal.renderTables(table4)) + console.log('') + console.log(` Recorded Run: ${formatPath(runUrl, undefined, 'gray')}`) } } } From 7fed3b8de2ae0fcb8e0482c445e6d3273762c632 Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Mon, 11 Jul 2022 22:02:53 +1000 Subject: [PATCH 4/9] remove line --- packages/server/lib/modes/run.js | 1 - system-tests/__snapshots__/record_spec.js | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/packages/server/lib/modes/run.js b/packages/server/lib/modes/run.js index d1bcdb9b918..a540bc56c66 100644 --- a/packages/server/lib/modes/run.js +++ b/packages/server/lib/modes/run.js @@ -411,7 +411,6 @@ const renderSummaryTable = (runUrl) => { table4.push(['', '']) console.log(terminal.renderTables(table4)) - console.log('') console.log(` Recorded Run: ${formatPath(runUrl, undefined, 'gray')}`) } } diff --git a/system-tests/__snapshots__/record_spec.js b/system-tests/__snapshots__/record_spec.js index 1fc4fa41a3e..99124a4a9f3 100644 --- a/system-tests/__snapshots__/record_spec.js +++ b/system-tests/__snapshots__/record_spec.js @@ -251,7 +251,6 @@ We dynamically generated a new test to display this failure. ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -348,7 +347,6 @@ StatusCodeError: 500 - "Internal Server Error" ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -462,7 +460,6 @@ exports['e2e record video recording does not upload when not enabled 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -544,7 +541,6 @@ exports['e2e record api interaction errors uploading assets warns but proceeds 1 ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -698,7 +694,6 @@ exports['e2e record parallelization passes in parallel with group 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -913,7 +908,6 @@ We dynamically generated a new test to display this failure. ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1159,7 +1153,6 @@ StatusCodeError: 500 - "Internal Server Error" ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1361,7 +1354,6 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1441,7 +1433,6 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1526,7 +1517,6 @@ Details: ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1862,7 +1852,6 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -1944,7 +1933,6 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2024,7 +2012,6 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2104,7 +2091,6 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2184,7 +2170,6 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2454,7 +2439,6 @@ exports['e2e record api skips specs records tests and exits without executing 1' ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 Exiting with non-zero exit code because the run was canceled. @@ -2533,7 +2517,6 @@ exports['e2e record api skips specs records tests and exits without executing in ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 Exiting with non-zero exit code because the run was canceled. @@ -2630,7 +2613,6 @@ exports['e2e record empty specs succeeds when empty spec file 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` @@ -2723,7 +2705,6 @@ exports['e2e record metadata sends Studio usage metadata 1'] = ` ─────────────────────────────────────────────────────────────────────────────────────────────────────── - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 ` From daf9d88ae71c54133392e9ae61ea1540130e7cde Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Mon, 11 Jul 2022 22:14:52 +1000 Subject: [PATCH 5/9] update snaps --- packages/server/lib/modes/run.js | 1 + system-tests/__snapshots__/record_spec.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/packages/server/lib/modes/run.js b/packages/server/lib/modes/run.js index a540bc56c66..eae73438a71 100644 --- a/packages/server/lib/modes/run.js +++ b/packages/server/lib/modes/run.js @@ -412,6 +412,7 @@ const renderSummaryTable = (runUrl) => { console.log(terminal.renderTables(table4)) console.log(` Recorded Run: ${formatPath(runUrl, undefined, 'gray')}`) + console.log('') } } } diff --git a/system-tests/__snapshots__/record_spec.js b/system-tests/__snapshots__/record_spec.js index 99124a4a9f3..7205428d081 100644 --- a/system-tests/__snapshots__/record_spec.js +++ b/system-tests/__snapshots__/record_spec.js @@ -253,6 +253,7 @@ We dynamically generated a new test to display this failure. Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction errors project 404 errors and exits 1'] = ` @@ -349,6 +350,7 @@ StatusCodeError: 500 - "Internal Server Error" Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record recordKey errors and exits without recordKey 1'] = ` @@ -462,6 +464,7 @@ exports['e2e record video recording does not upload when not enabled 1'] = ` Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction errors uploading assets warns but proceeds 1'] = ` @@ -543,6 +546,7 @@ exports['e2e record api interaction errors uploading assets warns but proceeds 1 Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record misconfiguration errors and exits when no specs found 1'] = ` @@ -696,6 +700,7 @@ exports['e2e record parallelization passes in parallel with group 1'] = ` Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record parallelization passes in parallel with group 2'] = ` @@ -910,6 +915,7 @@ We dynamically generated a new test to display this failure. Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction errors create run 422 errors and exits when group name is in use 1'] = ` @@ -1155,6 +1161,7 @@ StatusCodeError: 500 - "Internal Server Error" Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record recordKey warns but does not exit when is forked pr and parallel 1'] = ` @@ -1356,6 +1363,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction warnings create run warnings grace period - parallel feature warns when using parallel feature 1'] = ` @@ -1435,6 +1443,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction warnings create run warnings unknown warning warns with unknown warning code 1'] = ` @@ -1519,6 +1528,7 @@ Details: Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record passing passes 2'] = [ @@ -1854,6 +1864,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction warnings create run warnings grace period - over tests limit warns when over test results 1'] = ` @@ -1935,6 +1946,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction warnings create run warnings paid plan - over private tests limit warns when over private test results 1'] = ` @@ -2014,6 +2026,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction warnings create run warnings paid plan - over tests limit warns when over test results 1'] = ` @@ -2093,6 +2106,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction warnings create run warnings free plan - over tests limit v2 warns when over test results 1'] = ` @@ -2172,6 +2186,7 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record api interaction errors create run 500 errors and exits 1'] = ` @@ -2441,6 +2456,7 @@ exports['e2e record api skips specs records tests and exits without executing 1' Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Exiting with non-zero exit code because the run was canceled. ` @@ -2519,6 +2535,7 @@ exports['e2e record api skips specs records tests and exits without executing in Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + Exiting with non-zero exit code because the run was canceled. ` @@ -2615,6 +2632,7 @@ exports['e2e record empty specs succeeds when empty spec file 1'] = ` Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record misconfiguration errors and exits when no browser found 1'] = ` @@ -2707,6 +2725,7 @@ exports['e2e record metadata sends Studio usage metadata 1'] = ` Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 + ` exports['e2e record quiet mode respects quiet mode 1'] = ` From b4c5407e4aad6088ba6eefa7271f4aff80fbec9b Mon Sep 17 00:00:00 2001 From: mirobo <78788210+mirobo@users.noreply.github.com> Date: Mon, 11 Jul 2022 22:18:07 +0200 Subject: [PATCH 6/9] fix: mocha glob pattern in "glob-in-dir" param --- system-tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-tests/package.json b/system-tests/package.json index 92a6bde243e..a2337e47ff4 100644 --- a/system-tests/package.json +++ b/system-tests/package.json @@ -10,7 +10,7 @@ "clean-deps": "find . -depth -name node_modules -type d -exec rimraf {} \\;", "preprojects:yarn:install": "yarn clean-deps", "projects:yarn:install": "node ./scripts/projects-yarn-install.js", - "test": "node ./scripts/run.js --glob-in-dir='{test,test-binary}'", + "test": "node ./scripts/run.js --glob-in-dir={test,test-binary}", "test:ci": "node ./scripts/run.js", "update:snapshots": "SNAPSHOT_UPDATE=1 npm run test" }, From ad28e52e864c9c2ba02cfb14a64d0ff3efa3bf0a Mon Sep 17 00:00:00 2001 From: mirobo <78788210+mirobo@users.noreply.github.com> Date: Mon, 11 Jul 2022 22:44:10 +0200 Subject: [PATCH 7/9] fix: remove obsolete specs-path for mocha test run --- packages/server/test/scripts/run.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/server/test/scripts/run.js b/packages/server/test/scripts/run.js index 0500a100b1f..1ccdd5216c5 100644 --- a/packages/server/test/scripts/run.js +++ b/packages/server/test/scripts/run.js @@ -20,10 +20,7 @@ if (run[0] && run[0].includes('--inspect-brk')) { if (options['glob-in-dir']) { if (run[0]) { - run = [ - path.join(options['glob-in-dir'], '**', `*${run[0]}*`), - path.join(options['glob-in-dir'], `*${run[0]}*`), - ] + run = [path.join(options['glob-in-dir'], '**', `*${run[0]}*`)] } else { run = [path.join(options['glob-in-dir'], '**')] } @@ -55,7 +52,7 @@ if (!run || !run.length) { $ yarn test-unit $ yarn test-integration - $ yarn test-e2e + $ yarn test-performance `) } From 6a59d7a133ed9240ab9905ed9e61daec3e2f64f1 Mon Sep 17 00:00:00 2001 From: mirobo <78788210+mirobo@users.noreply.github.com> Date: Mon, 11 Jul 2022 23:01:45 +0200 Subject: [PATCH 8/9] fix: remove wrong examples in system-tests README --- system-tests/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/system-tests/README.md b/system-tests/README.md index e2af257276b..f17dcf2b424 100644 --- a/system-tests/README.md +++ b/system-tests/README.md @@ -10,22 +10,23 @@ These tests run in CI in Electron, Chrome, and Firefox under the `system-tests` ## Running System Tests ```bash -yarn test -yarn test test/async_timeouts_spec.js -## or -yarn test async_timeouts ## shorthand, uses globbing to find spec +yarn test # runs all tests +## or use globbing to find spec in folders as defined in "glob-in-dir" param in package.json +yarn test screenshot*element # runs screenshot_element_capture_spec.js +yarn test screenshot # runs screenshot_element_capture_spec.js, screenshot_fullpage_capture_spec.js, ..., etc. + ``` To keep the browser open after a spec run (for easier debugging and iterating on specs), you can pass the `--no-exit` flag to the test command. Live reloading due to spec changes should also work: ```sh -yarn test test/go_spec.js --browser chrome --no-exit +yarn test go_spec.js --browser chrome --no-exit ``` To debug the Cypress process under test, you can pass `--cypress-inspect-brk`: ```sh -yarn test test/go_spec.js --browser chrome --no-exit --cypress-inspect-brk +yarn test go_spec.js --browser chrome --no-exit --cypress-inspect-brk ``` ## Developing Tests From 100db7956640a13f562f61e85e1566c64ecf1fad Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Fri, 15 Jul 2022 12:40:01 +1000 Subject: [PATCH 9/9] add test for long spec --- packages/server/__snapshots__/cypress_spec.js | 41 +++++ .../server/test/integration/cypress_spec.js | 160 +++++++++++++----- 2 files changed, 159 insertions(+), 42 deletions(-) diff --git a/packages/server/__snapshots__/cypress_spec.js b/packages/server/__snapshots__/cypress_spec.js index 1fb15ac8d9f..4de7d12abe7 100644 --- a/packages/server/__snapshots__/cypress_spec.js +++ b/packages/server/__snapshots__/cypress_spec.js @@ -310,3 +310,44 @@ The following configuration options are invalid: https://on.cypress.io/configuration ` + +exports['Long Dashboard URL'] = ` + +==================================================================================================== + + (Run Starting) + + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Cypress: 10.3.0 │ + │ Browser: Electron 99 (headless) │ + │ Specs: 1 found (app.cy.js) │ + │ Searched: cypress/e2e/**/*.cy.{js,jsx,ts,tsx} │ + │ Params: Tag: false, Group: electron-smoke-tests, Parallel: false │ + │ Run URL: http://dashboard.cypress.io/this-is-a-long-long-long-long-long-long-long-long-long │ + │ -long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-l │ + │ ong-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-lon │ + │ g-long-long-long-long-long-long-long-long-url │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ + + +──────────────────────────────────────────────────────────────────────────────────────────────────── + + Running: app.cy.js (1 of 1) + +==================================================================================================== + + (Run Finished) + + + Spec Tests Passing Failing Pending Skipped + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ ✖ 6ms 1 2 3 4 5 │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ + ✖ 1 of 1 failed (100%) 6ms 1 2 3 4 5 + + +─────────────────────────────────────────────────────────────────────────────────────────────────────── + + Recorded Run: http://dashboard.cypress.io/this-is-a-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-url + +` diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index c879bcaddc0..7bdfd1fa4ed 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -99,6 +99,53 @@ const snapshotConsoleLogs = function (name) { return snapshot(name, stripAnsi(args)) } +function mockEE () { + const ee = new EE() + + ee.kill = () => { + // ughh, would be nice to test logic inside the launcher + // that cleans up after the browser exit + // like calling client.close() if available to let the + // browser free any resources + return ee.emit('exit') + } + + ee.destroy = () => { + return ee.emit('closed') + } + + ee.isDestroyed = () => { + return false + } + + ee.loadURL = () => {} + ee.focusOnWebView = () => {} + ee.webContents = { + debugger: { + on: sinon.stub(), + attach: sinon.stub(), + sendCommand: sinon.stub().resolves(), + }, + getOSProcessId: sinon.stub(), + setUserAgent: sinon.stub(), + session: { + clearCache: sinon.stub().resolves(), + setProxy: sinon.stub().resolves(), + setUserAgent: sinon.stub(), + on: sinon.stub(), + removeListener: sinon.stub(), + webRequest: { + onBeforeSendHeaders () {}, + }, + }, + } + + ee.maximize = sinon.stub + ee.setSize = sinon.stub + + return ee +} + let ctx describe('lib/cypress', () => { @@ -909,48 +956,7 @@ describe('lib/cypress', () => { beforeEach(() => { browsers.open.restore() - const ee = new EE() - - ee.kill = () => { - // ughh, would be nice to test logic inside the launcher - // that cleans up after the browser exit - // like calling client.close() if available to let the - // browser free any resources - return ee.emit('exit') - } - - ee.destroy = () => { - return ee.emit('closed') - } - - ee.isDestroyed = () => { - return false - } - - ee.loadURL = () => {} - ee.focusOnWebView = () => {} - ee.webContents = { - debugger: { - on: sinon.stub(), - attach: sinon.stub(), - sendCommand: sinon.stub().resolves(), - }, - getOSProcessId: sinon.stub(), - setUserAgent: sinon.stub(), - session: { - clearCache: sinon.stub().resolves(), - setProxy: sinon.stub().resolves(), - setUserAgent: sinon.stub(), - on: sinon.stub(), - removeListener: sinon.stub(), - webRequest: { - onBeforeSendHeaders () {}, - }, - }, - } - - ee.maximize = sinon.stub - ee.setSize = sinon.stub + const ee = mockEE() sinon.stub(launch, 'launch').returns(ee) sinon.stub(Windows, 'create').returns(ee) @@ -1140,9 +1146,52 @@ describe('lib/cypress', () => { context('--record', () => { beforeEach(function () { sinon.stub(api, 'createRun').resolves() + const createInstanceStub = sinon.stub(api, 'createInstance') + + createInstanceStub.onFirstCall().resolves({ + spec: 'cypress/e2e/app.cy.js', + runs: [{}], + runId: '1', + claimedInstances: 1, + totalInstances: 1, + groupId: 1, + platform: 'linux', + machineId: 1, + }) + + createInstanceStub.onSecondCall().resolves({ + spec: null, + runs: [{}], + runId: '1', + claimedInstances: 1, + totalInstances: 1, + groupId: 1, + platform: 'linux', + machineId: 1, + }) + sinon.stub(electron.app, 'on').withArgs('ready').yieldsAsync() sinon.stub(browsers, 'open') sinon.stub(runMode, 'waitForSocketConnection').resolves() + + sinon.stub(runMode, 'waitForBrowserToConnect').resolves({ + stats: { + tests: 1, + passes: 2, + failures: 3, + pending: 4, + skipped: 5, + wallClockDuration: 6, + }, + tests: [], + hooks: [], + video: 'path/to/video', + shouldUploadVideo: true, + screenshots: [], + config: {}, + spec: {}, + }) + sinon.stub(runMode, 'waitForTestsToFinishRunning').resolves({ stats: { tests: 1, @@ -1335,6 +1384,33 @@ describe('lib/cypress', () => { }) }) + beforeEach(() => { + browsers.open.restore() + + const ee = mockEE() + + sinon.stub(launch, 'launch').returns(ee) + sinon.stub(Windows, 'create').returns(ee) + }) + + it('does not truncate a really long dashboard url', function () { + api.createRun.resolves({ + warnings: [], + runUrl: `http://dashboard.cypress.io/this-is-a${'-long'.repeat(50)}-url`, + }) + + return cypress.start([ + `--run-project=${this.recordPath}`, + '--record', + '--key=token-123', + '--group=electron-smoke-tests', + '--ciBuildId=ciBuildId123', + ]) + .then(() => { + return snapshotConsoleLogs('Long Dashboard URL') + }) + }) + it('errors and exits when group name is not unique and explicitly passed ciBuildId', function () { const err = new Error()