BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
11 / 18 · Module 14 — External Automated Testing of Mule Integrations · filtered: cheatsheet← prev⊞ allnext →

14.4Playwright can be used purely as an API client

You don't need a browser.

A TypeScript test could conceptually be:

import { test, expect } from '@playwright/test';

test('creates Salesforce Account', async ({ request }) => {
  const customerId = `AUTO-${Date.now()}`;

  const response = await request.post('/customers', {
    data: {
      customerId,
      companyName: 'Automation Test Company',
      phone: '4075551234'
    }
  });

  expect(response.status()).toBe(201);

  const body = await response.json();

  expect(body.customerId).toBe(customerId);
  expect(body.success).toBe(true);
});

Then separately query Salesforce.