diff --git a/circle.yml b/circle.yml index ede5ccf5b0fc..a18563fb75c4 100644 --- a/circle.yml +++ b/circle.yml @@ -528,14 +528,45 @@ commands: browser: <> - run: command: | - cmd=$([[ <> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true - DEBUG=<> \ - CYPRESS_KONFIG_ENV=production \ - CYPRESS_RECORD_KEY=${TEST_LAUNCHPAD_RECORD_KEY:-$MAIN_RECORD_KEY} \ - PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \ - PERCY_ENABLE=${PERCY_TOKEN:-0} \ - PERCY_PARALLEL_TOTAL=-1 \ - $cmd yarn workspace @packages/<> cypress:run:<> --browser <> --record --parallel --group <>-<> + echo Current working directory is $PWD + echo Total containers $CIRCLE_NODE_TOTAL + + if [[ -v MAIN_RECORD_KEY ]]; then + # internal PR + cmd=$([[ <> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true + DEBUG=<> \ + CYPRESS_KONFIG_ENV=production \ + CYPRESS_RECORD_KEY=${TEST_LAUNCHPAD_RECORD_KEY:-$MAIN_RECORD_KEY} \ + PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \ + PERCY_ENABLE=${PERCY_TOKEN:-0} \ + PERCY_PARALLEL_TOTAL=-1 \ + $cmd yarn workspace @packages/<> cypress:run:<> --browser <> --record --parallel --group <>-<> + else + # external PR + + # To make `circleci tests` work correctly, we need to step into the package folder. + cd packages/<> + + GLOB="cypress/e2e/**/*cy.*" + + if [[ <> == 'ct' ]]; then + # component tests are located side by side with the source codes. + GLOB="src/**/*cy.*" + fi + + TESTFILES=$(circleci tests glob "$GLOB" | circleci tests split --total=$CIRCLE_NODE_TOTAL) + echo "Test files for this machine are $TESTFILES" + + # To run the `yarn` command, we need to walk out of the package folder. + cd ../.. + + DEBUG=<> \ + CYPRESS_KONFIG_ENV=production \ + PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \ + PERCY_ENABLE=${PERCY_TOKEN:-0} \ + PERCY_PARALLEL_TOTAL=-1 \ + yarn workspace @packages/<> cypress:run:<> --browser <> --spec $TESTFILES + fi - run: command: | if [[ <> == 'app' && <> == 'true' && -d "packages/app/cypress/screenshots/runner/screenshot/screenshot.cy.tsx/percy" ]]; then diff --git a/packages/app/cypress/e2e/specs.cy.ts b/packages/app/cypress/e2e/specs.cy.ts index 1716658ce2e4..d71a2e703e12 100644 --- a/packages/app/cypress/e2e/specs.cy.ts +++ b/packages/app/cypress/e2e/specs.cy.ts @@ -95,7 +95,7 @@ describe('App: Specs', () => { const expectedScaffoldPathsForPlatform = expectedScaffoldPaths.map(getPathForPlatform) - it('scaffolds example files when card is clicked', () => { + it('scaffolds example files when card is clicked', { viewportHeight: 1200 }, () => { cy.get('@ScaffoldCard').click() cy.findByRole('dialog', {