Skip to content

Commit ec55561

Browse files
committed
Merge branch 'develop' into tgriesser/CLOUD-577-spec-list-display-latest-runs-batching
* develop: fix: add baseUrl to TestConfigOverrides (#22445) fix: distribute files to machines for external contributors. (#22326) feat: Display Cypress Dashboard metrics in the Specs Explorer (#21250)
2 parents 745c281 + 5d5574e commit ec55561

File tree

4 files changed

+42
-10
lines changed

4 files changed

+42
-10
lines changed

circle.yml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,45 @@ commands:
528528
browser: <<parameters.browser>>
529529
- run:
530530
command: |
531-
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
532-
DEBUG=<<parameters.debug>> \
533-
CYPRESS_KONFIG_ENV=production \
534-
CYPRESS_RECORD_KEY=${TEST_LAUNCHPAD_RECORD_KEY:-$MAIN_RECORD_KEY} \
535-
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
536-
PERCY_ENABLE=${PERCY_TOKEN:-0} \
537-
PERCY_PARALLEL_TOTAL=-1 \
538-
$cmd yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
531+
echo Current working directory is $PWD
532+
echo Total containers $CIRCLE_NODE_TOTAL
533+
534+
if [[ -v MAIN_RECORD_KEY ]]; then
535+
# internal PR
536+
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
537+
DEBUG=<<parameters.debug>> \
538+
CYPRESS_KONFIG_ENV=production \
539+
CYPRESS_RECORD_KEY=${TEST_LAUNCHPAD_RECORD_KEY:-$MAIN_RECORD_KEY} \
540+
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
541+
PERCY_ENABLE=${PERCY_TOKEN:-0} \
542+
PERCY_PARALLEL_TOTAL=-1 \
543+
$cmd yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
544+
else
545+
# external PR
546+
547+
# To make `circleci tests` work correctly, we need to step into the package folder.
548+
cd packages/<<parameters.package>>
549+
550+
GLOB="cypress/e2e/**/*cy.*"
551+
552+
if [[ <<parameters.type>> == 'ct' ]]; then
553+
# component tests are located side by side with the source codes.
554+
GLOB="src/**/*cy.*"
555+
fi
556+
557+
TESTFILES=$(circleci tests glob "$GLOB" | circleci tests split --total=$CIRCLE_NODE_TOTAL)
558+
echo "Test files for this machine are $TESTFILES"
559+
560+
# To run the `yarn` command, we need to walk out of the package folder.
561+
cd ../..
562+
563+
DEBUG=<<parameters.debug>> \
564+
CYPRESS_KONFIG_ENV=production \
565+
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
566+
PERCY_ENABLE=${PERCY_TOKEN:-0} \
567+
PERCY_PARALLEL_TOTAL=-1 \
568+
yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --spec $TESTFILES
569+
fi
539570
- run:
540571
command: |
541572
if [[ <<parameters.package>> == 'app' && <<parameters.percy>> == 'true' && -d "packages/app/cypress/screenshots/runner/screenshot/screenshot.cy.tsx/percy" ]]; then

cli/types/cypress.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3003,7 +3003,7 @@ declare namespace Cypress {
30033003
xhrUrl: string
30043004
}
30053005

3006-
interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations' | 'experimentalSessionAndOrigin'>> {
3006+
interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations' | 'experimentalSessionAndOrigin'>>, Partial<Pick<ResolvedConfigOptions, 'baseUrl'>> {
30073007
browser?: IsBrowserMatcher | IsBrowserMatcher[]
30083008
keystrokeDelay?: number
30093009
}

cli/types/tests/cypress-tests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace CypressConfigTests {
3333
Cypress.config().baseUrl // $ExpectType string | null
3434

3535
// setters
36+
Cypress.config('baseUrl', '.') // $ExpectType void
3637
Cypress.config({ e2e: { baseUrl: '.' }}) // $ExpectType void
3738
Cypress.config({ e2e: { baseUrl: null }}) // $ExpectType void
3839
Cypress.config({ e2e: { baseUrl: '.', }}) // $ExpectType void

packages/app/cypress/e2e/specs.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('App: Specs', () => {
9595

9696
const expectedScaffoldPathsForPlatform = expectedScaffoldPaths.map(getPathForPlatform)
9797

98-
it('scaffolds example files when card is clicked', () => {
98+
it('scaffolds example files when card is clicked', { viewportHeight: 1200 }, () => {
9999
cy.get('@ScaffoldCard').click()
100100

101101
cy.findByRole('dialog', {

0 commit comments

Comments
 (0)