Playwright Bitbucket Integration

Profile picture for user devraj

In this article let's discuss the integration of CI/CD BitBucket with Playwright to perform end-to-end testing using Bitbucket and Playwright.

Step 1: Create BitBucket Repo if required or go to your project root 

Step 2: Create yml file with name bitbucket-pipelines.yml in project root directory

BitBucket Playwright Integration

Step 3: Paste below code

pipelines:
  default:
    - step:
        name: Playwright Tests
        image: mcr.microsoft.com/playwright
        script:
          - npm ci        
          # - Run the test cases 
          - npx playwright test --config=playwright.config.ts
        artifacts:
         - playwright-report/index.html

Here,

  • image: your docket image value
  • config path: change accordingly
  • artifacts: Your report path

Step 4: Run pipeline using any of method

  1. Push Code: Once your will push your code build will trigger
  2. Run Pipeline Option: Find it on BitBucket Interface
  3. Scheduling: Find it on BitBucket Interface

Step 5: Download and View Report by clicking on Pipelines ->  Artifacts

Playwright BitBucket View Report