Skip to content

Comments

Adding Playwrite-e2e Testcases#402

Merged
chetanbothra merged 1 commit intostagingfrom
playwrite-e2e
Sep 19, 2025
Merged

Adding Playwrite-e2e Testcases#402
chetanbothra merged 1 commit intostagingfrom
playwrite-e2e

Conversation

@chetanbothra
Copy link
Contributor

@chetanbothra chetanbothra commented Sep 19, 2025

adding playwrite along other test cases

Summary by CodeRabbit

  • Chores
    • Cleaned up continuous integration logs by removing unnecessary diagnostics, reducing noise in automated test runs.
    • Expanded environment configuration for end-to-end tests to include additional variables, improving reliability and consistency across environments.
    • Enhanced stability of automated browser tests across environments for clearer, faster feedback in pipelines.
    • No user-facing changes in this release.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 19, 2025

Walkthrough

Updates CircleCI e2e jobs by removing a diagnostic cypress config print and extending .env substitutions with seven additional variables in both e2e-tests and e2e-playwright steps.

Changes

Cohort / File(s) Summary of changes
CI pipeline e2e job updates
.circleci/config.yml
In e2e-tests and e2e-playwright steps: removed cat cypress.config.js; added .env substitutions for DEBUG, CI, HEADED, SUSHI_URL, STAGING_URL, TESTMAIL_USERNAME, TESTMAIL_EMAIL, augmenting existing placeholders.

Sequence Diagram(s)

sequenceDiagram
  participant CircleCI
  participant e2e-tests
  participant e2e-playwright
  participant Env as .env
  participant Runner as Test Runner

  Note over CircleCI: Workflow triggers e2e jobs

  CircleCI->>e2e-tests: Start job
  e2e-tests->>Env: Write substitutions (existing + DEBUG, CI, HEADED, SUSHI_URL, STAGING_URL, TESTMAIL_USERNAME, TESTMAIL_EMAIL)
  Note right of e2e-tests: Removed diagnostic cat of cypress.config.js
  e2e-tests->>Runner: Execute Cypress tests

  CircleCI->>e2e-playwright: Start job
  e2e-playwright->>Env: Write same substitutions
  Note right of e2e-playwright: Removed diagnostic cat of cypress.config.js
  e2e-playwright->>Runner: Execute Playwright tests
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Added E2E Test cases #333 — Also modifies .circleci/config.yml e2e job definitions; related through changes to the same e2e jobs and workflow structure.

Suggested reviewers

  • RanaBug
  • IAmKio
  • sankhavaramsaitulasiram

Poem

I hop through pipelines, whiskers keen,
Tweaking envs where logs had been.
Seven secrets set in line,
Cypress hushes—tests align.
Playwright joins the leafy queue,
Green carrots blink: all checks through! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The current title “Adding Playwrite-e2e Testcases” is misleading because the pull request primarily updates the CircleCI configuration by removing a diagnostic print statement and adding environment variable substitutions rather than introducing new test cases, and it also contains a spelling error in “Playwrite.” Please update the title to accurately reflect the main change—such as “Add environment variable substitutions to CircleCI for Playwright e2e tests”—and correct the spelling of “Playwright.”
Description Check ⚠️ Warning The provided description “adding playwrite along other test cases” does not follow the repository’s template, as it lacks a summary of the changes, details on how the changes were tested, and the required types of changes section, making it unclear to reviewers what was done and how to verify it. Please expand the description to match the repository template by adding a clear summary under “## Description,” detailing your testing approach under “## How Has This Been Tested?” and indicating the appropriate checkboxes under “## Types of changes.”
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch playwrite-e2e

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (6)
.circleci/config.yml (6)

142-148: Harden sed replacements (escape &, |, backslashes) to avoid mangled values; also DRY these 7 lines.

If any value contains &, |, or backslashes (URLs, emails, debug strings), sed will corrupt the replacement. Escape before substituting, or values like SUSHI_URL may break. Also, consider a tiny helper to reduce duplication.

Apply this diff:

-            sed -i "s|debug_value|$DEBUG|g" .env
-            sed -i "s|ci_value|$CI|g" .env
-            sed -i "s|headed_value|$HEADED|g" .env
-            sed -i "s|sushi_url_value|$SUSHI_URL|g" .env
-            sed -i "s|staging_url_value|$STAGING_URL|g" .env
-            sed -i "s|testmail_username_value|$TESTMAIL_USERNAME|g" .env
-            sed -i "s|testmail_email_value|$TESTMAIL_EMAIL|g" .env
+            esc() { v="$1"; v="${v//\\/\\\\}"; v="${v//&/\\&}"; v="${v//|/\\|}"; printf '%s' "$v"; }
+            sed -i "s|debug_value|$(esc "$DEBUG")|g" .env
+            sed -i "s|ci_value|$(esc "$CI")|g" .env
+            sed -i "s|headed_value|$(esc "$HEADED")|g" .env
+            sed -i "s|sushi_url_value|$(esc "$SUSHI_URL")|g" .env
+            sed -i "s|staging_url_value|$(esc "$STAGING_URL")|g" .env
+            sed -i "s|testmail_username_value|$(esc "$TESTMAIL_USERNAME")|g" .env
+            sed -i "s|testmail_email_value|$(esc "$TESTMAIL_EMAIL")|g" .env

150-151: Install Playwright system deps to avoid runtime browser issues.

Using the Cypress image, Playwright may miss OS libs. Add --with-deps for parity with the e2e-tests job.

-            npx playwright install
+            npx playwright install --with-deps

168-171: Avoid network flakiness: read mochawesome.json locally instead of wget from artifacts.

You already have the report at /tmp. Downloading it back via artifacts is brittle and slower.

-            wget https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/${CIRCLE_NODE_INDEX}/tmp/mochawesome-report/mochawesome.json
-
-            MOCHAWESOME_JSON_FILE=./mochawesome.json
+            MOCHAWESOME_JSON_FILE=/tmp/mochawesome-report/mochawesome.json

128-149: Fail fast and validate required envs before substitution.

Guard against unset vars silently producing empty values; fail early for missing inputs.

           command: |
+            set -Eeuo pipefail
+            # Ensure required env vars are provided
+            : "${DEBUG?}" "${CI?}" "${HEADED?}" "${SUSHI_URL?}" "${STAGING_URL?}" "${TESTMAIL_USERNAME?}" "${TESTMAIL_EMAIL?}"
             cd ~
             git clone -b pillarx-playwright --single-branch https://$GITHUB_TOKEN@github.com/pillarwallet/x-e2e.git
             cd x-e2e
             git pull 
             sed -i "s|base_url_value|$BASE_URL|g" .env

Also confirm the .env template actually uses the exact placeholders you’re substituting (e.g., testmail_* vs test_mail_* names). If helpful, add a quick validation:

grep -nE '_value' .env || true

Expected: no matches.


128-131: Token-in-URL clone: confirm masking; consider safer patterns.

Cloning with https://$GITHUB_TOKEN@... can leak in logs if masking fails. Verify CircleCI masking is enabled for GITHUB_TOKEN. Optionally switch to oauth2 username to avoid special-char pitfalls:

-            git clone -b pillarx-playwright --single-branch https://$GITHUB_TOKEN@github.com/pillarwallet/x-e2e.git
+            git clone -b pillarx-playwright --single-branch https://oauth2:${GITHUB_TOKEN}@github.com/pillarwallet/x-e2e.git

You can also drop the redundant git pull after a fresh clone.


114-116: Image choice for Playwright job.

Using the heavy Cypress image for Playwright increases cold start and apt footprint. Consider a Playwright base (e.g., mcr.microsoft/playwright) to remove the need for installing deps and speed up runs.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5218b94 and b3abc28.

📒 Files selected for processing (1)
  • .circleci/config.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: lint
  • GitHub Check: unit-tests

@chetanbothra chetanbothra merged commit 344aa3d into staging Sep 19, 2025
6 checks passed
@chetanbothra chetanbothra deleted the playwrite-e2e branch September 19, 2025 14:34
@coderabbitai coderabbitai bot mentioned this pull request Sep 23, 2025
3 tasks
@coderabbitai coderabbitai bot mentioned this pull request Nov 25, 2025
Merged
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants