All case studies

Taming Salesforce Authentication: Playwright Automation for a Deeply Integrated Sales Productivity Platform

Cirrus Insight bridges Gmail, Outlook, and Salesforce CRM for over 50,000 customer-facing teams at Walmart, Tableau, TripAdvisor, and Samsung. Automating a platform this deeply entangled with authentication-resistant third-party systems required architecture, not just scripting.

Playwright TypeScript Salesforce Integration 2FA Automation Cursor AI
Taming Salesforce Authentication: Playwright Automation for a Deeply Integrated Sales Productivity Platform
About Cirrus Insight

The productivity layer that lives inside your inbox.

Cirrus Insight is an AI-powered sales productivity platform that operates inside Gmail, Outlook, and Microsoft Teams — bridging email inboxes directly with Salesforce CRM. It enables sales teams to log emails, track opens, schedule meetings, sync calendars, and access Salesforce data without leaving their inbox environment. The platform serves over 50,000 customer-facing teams worldwide, with clients including Walmart, Tableau, TripAdvisor, and Samsung. It is deeply integrated with three major platforms — each with distinct OAuth flows, security policies, and automation-resistance characteristics — making it one of the most technically complex automation targets in the QE portfolio. Onboarded in November 2025, the engagement was focused entirely on automation engineering: assessing the existing Playwright framework, solving foundational authentication problems, and building a reliable, fast, maintainable automation suite across all three integrated platforms.

Salesforce locks your test account after repeated login attempts. Gmail has bot-detection. Outlook has its own OAuth flow. Solving all three — architecturally — was the only path to reliable automation.
Project Profile

At a glance.

Client
Onboarded
November 2025
Automation
Playwright · TypeScript
AI Tool
Cursor AI
Industry
CRM / Sales Productivity SaaS
Project Type
Automation Engineering
Engagement Model
Part-time (20 hrs / week)
Automation Framework
Playwright (TypeScript)
AI Coding Tool
Cursor AI
Integrations
Salesforce, Gmail (OWA), Outlook
Test Suites
Production regression, smoke test suite
Engagement Journey

Diagnose, architect, deliver.

The engagement moved through three tightly sequenced phases — a diagnostic audit to understand where the existing framework was failing, an architectural rebuild that solved authentication at the session level, and a coverage expansion phase that delivered structured production regression and 350+ automated tests.

Phase
Problem Solved
Technical Approach
Outcome
Audit
Mapped all authentication failures, identified Salesforce lock-out root cause, catalogued flaky test patterns
Framework code review; execution tracing; auth flow analysis
Root cause identified: Salesforce re-authenticates per file, triggering fraud detection
Architecture
Salesforce lock-outs eliminated; 6-hour runtime addressed; Gmail/Outlook auth automated
Shared session storage; project-level cookie architecture; parallelised workers; 2FA + OAuth automation
Execution time: 6 hrs → under 2 hrs; lock-outs: eliminated; flaky rate: ~0%
Coverage
Production regression structure; smoke suite; 350+ tests fully maintained
Playwright test authoring with Cursor AI; ESLint compliance; manual production regression protocol
350+ automated tests delivered; weekly production regression cycle established
The Challenge

Three platforms. Three authentication walls. One test suite.

Automating quality engineering for Cirrus Insight meant testing a product deeply entangled with Salesforce, Gmail, and Outlook — platforms with strict, automation-resistant security policies. The existing Playwright framework was failing in multiple compounding ways before a single architectural decision had been made.

01

Salesforce Auto-Lock

Salesforce accounts lock automatically after repeated login attempts. The existing framework re-authenticated on every test file execution, triggering account lock-outs that halted entire test runs. Each lock-out required manual intervention before testing could resume.

02

Multi-Platform Authentication Complexity

The test suite had to maintain concurrent authenticated sessions across Salesforce, Gmail, and Outlook simultaneously — each with different OAuth flows, token lifetimes, and bot-detection mechanisms. Solving one authentication problem often created failures in another.

03

6-Hour Full-Suite Execution Time

The initial full Playwright suite ran sequentially and took over 6 hours to complete. At this runtime, the suite was effectively unusable as a development feedback mechanism — by the time it finished, multiple new changes had already been committed.

04

Widespread Test Flakiness

Login-related failures and inconsistent browser extension loading caused widespread test flakiness across the suite. Tests that passed one run would fail the next — not due to code changes, but due to authentication state inconsistency — making CI results untrustworthy.

What We Did

Architecture first. Coverage second.

The engagement addressed Cirrus Insight's automation challenges by solving authentication at the architectural level before expanding test coverage — transforming a fragile, slow framework into a fast, reliable foundation for 350+ tests across three integrated platforms.

01

Shared Session Storage Architecture

Designed and implemented a shared session storage solution that establishes authentication tokens once per test run and shares them across all Playwright test files. This eliminated the root cause of Salesforce account lock-outs — sequential per-file re-authentication — without requiring any changes to the Salesforce account configuration.

02

Project-Level Cookie Architecture & Framework Fixes

Resolved native Salesforce login bugs through project-level cookie management. Five framework-level fixes were identified, implemented, and merged to the development branch — improving baseline framework stability for all future test development.

03

Parallelised Test Execution

Restructured the Playwright test suite to execute across multiple parallel workers. Full suite execution time dropped from over 6 hours to under 2 hours — a 66% reduction — without any change to the scope or coverage of the tests being executed.

04

2FA & Multi-Platform OAuth Automation

Implemented Salesforce 2FA automation and fully automated the OAuth flows for both Gmail and Outlook (OWA). All three platform authentication flows now run without manual intervention — supporting both local and CI execution contexts reliably.

05

Cursor AI-Assisted Development

Cursor AI used throughout the engagement for test script generation, code review, ESLint compliance checking, and refactoring. The AI-assisted workflow accelerated development velocity while maintaining code quality standards across the growing test suite.

06

Production Regression & Smoke Suites

Structured manual production regression cycle established for every weekly release — providing consistent pre-release coverage regardless of automation state. A dedicated Playwright smoke test suite was built and maintained as the fast-path validation for every deployment.

Key Metrics

The numbers.

350+

Automated Test Cases

66%

Execution Time Reduced

<2 hrs

Full Suite Runtime

~0%

Flaky Test Rate

Results & Impact

What changed.

350+

Automated Test Cases Delivered

Covering Salesforce, Gmail, and Outlook integration flows — fully maintained and ESLint-compliant.

66%

Execution Time Reduced

Full suite runtime dropped from 6+ hours to under 2 hours through parallelisation — no change in coverage scope.

<2 hrs

Full Suite Runtime

Down from 6+ hours sequential execution — now viable as a CI feedback mechanism within a standard development cycle.

~0%

Flaky Test Rate

Authentication-related flakiness eliminated at the architectural level — suite reliability consistent across runs.

5

Framework Fixes Merged

Foundational fixes to the Playwright framework merged to development branch — improving baseline stability for all future test authoring.

3

Platforms Fully Automated

Salesforce (with 2FA), Gmail (OAuth), and Outlook OWA — all running without manual authentication intervention in CI and local contexts.

Tools & Technology

The stack.

Automation Framework
Playwright (TypeScript) — session-aware, parallelised, ESLint-compliant
AI Coding Tool
Cursor AI — script generation, review, and refactoring
Integrations Tested
Salesforce (with 2FA), Gmail, Outlook (OWA)
Authentication Strategy
Shared session storage + project-level cookie architecture
CI Context
Local and CI execution — parallel workers
Test Suites
350+ automated tests + dedicated smoke suite + weekly manual production regression
Test Types
Functional automation, integration testing, production regression, smoke testing
The Takeaway

The Cirrus Insight engagement demonstrates that automation for deeply integrated SaaS products requires architectural thinking, not just script writing. The Salesforce authentication problem couldn't be solved by writing better tests — it required redesigning how authentication state was managed across the entire framework. By solving that problem at the session level, parallelising execution, and fully automating three distinct OAuth flows, the team transformed an unstable, 6-hour suite into a fast, reliable automation foundation — and delivered 350+ tests to build on it.