npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@crowdstrike/foundry-playwright

v0.5.6

Published

Playwright end-to-end (E2E) test infrastructure for CrowdStrike Foundry apps

Readme

CrowdStrike Falcon

@crowdstrike/foundry-playwright

Playwright end-to-end (E2E) test infrastructure for Falcon Foundry apps. Provides page objects, authentication, configuration, and utilities so each app only needs to write its app-specific tests.

Installation

npm install -D @crowdstrike/foundry-playwright
# or
pnpm add -D @crowdstrike/foundry-playwright

Quickstart

1. Set up your app's e2e/ directory

Create an e2e/ directory in your Foundry app:

my-foundry-app/
├── e2e/
│   ├── .env                    # Local credentials (git-ignored)
│   ├── playwright.config.ts
│   └── tests/
│       └── my-app.spec.ts      # Your app-specific tests
├── manifest.yml
└── ...

Create a .env file with your credentials:

FALCON_BASE_URL=https://falcon.us-2.crowdstrike.com
[email protected]
FALCON_PASSWORD=your-password
FALCON_AUTH_SECRET=your-totp-secret
APP_NAME=Your App Name

2. Create your playwright.config.ts

import { defineFoundryConfig } from '@crowdstrike/foundry-playwright';

export default defineFoundryConfig();

That's it. The library provides the standard 4-project pipeline automatically:

  1. setup: authenticate and save session state
  2. app-install: install the app via App Catalog
  3. chromium: run your tests
  4. app-uninstall: clean up

Authentication, app install, and app uninstall are handled by built-in setup/teardown tests in the library. You only need to write your app-specific tests in tests/.

The library automatically loads your .env file for local development (skipped when CI is set).

You can override any default:

export default defineFoundryConfig({
  timeout: 120_000,
  reporter: 'html',
});

3. Write your tests

// tests/my-app.spec.ts
import { test, expect } from '@playwright/test';
import {
  WorkflowsPage,
  DetectionExtensionPage,
} from '@crowdstrike/foundry-playwright';

test('execute workflow', async ({ page }) => {
  const workflows = new WorkflowsPage(page);
  await workflows.navigateToWorkflows();
  await workflows.executeAndVerifyWorkflow('My Workflow');
});

test('extension renders in detection details', async ({ page }) => {
  const detections = new DetectionExtensionPage(page);
  const frame = await detections.openExtension('my-extension');
  await expect(frame.getByText('My App')).toBeVisible();
});

Apps with configuration screens

If your app has configuration screens during install (API credentials, comboboxes, etc.), create a local tests/app-install.setup.ts and point defineFoundryConfig at it:

// tests/app-install.setup.ts
import { test as setup } from '@playwright/test';
import { AppCatalogPage, config } from '@crowdstrike/foundry-playwright';

setup('install app', async ({ page }) => {
  const catalog = new AppCatalogPage(page);
  await catalog.installApp(config.appName, {
    configureSettings: async (page) => {
      // Use field labels from the install form. Inspect with Playwright MCP
      // to discover the exact names for your app's API integration fields
      await page.getByRole('textbox', { name: 'Name', exact: true }).fill('My Integration');
      await page.getByRole('textbox', { name: 'Instance' }).fill('dev12345');
      await page.getByRole('textbox', { name: 'Username' }).fill('test_user');
      await page.getByRole('textbox', { name: 'Password' }).fill('test_password');
    },
  });
});

Multi-screen configuration

Important: The Falcon UI presents configuration screens in non-deterministic order across deployments. Don't hard-code screen order (Screen 1, Screen 2, etc.). Instead, detect each screen by a unique field:

setup('install app', async ({ page }) => {
  const catalog = new AppCatalogPage(page);
  await catalog.installApp(config.appName, {
    configureSettings: async (page) => {
      const nextButton = page.getByRole('button', { name: 'Next setting' });

      // Loop through expected screens, detect each by a unique field
      for (let screen = 0; screen < 3; screen++) {
        // Detect which screen we're on by checking for unique fields
        if (await page.getByRole('textbox', { name: 'clientId' }).isVisible({ timeout: 3000 }).catch(() => false)) {
          // API Integration screen
          await page.getByRole('textbox', { name: 'Name' }).fill('My API Integration');
          await page.getByRole('textbox', { name: 'Host' }).fill('https://api.example.com');
          await page.getByRole('textbox', { name: 'clientId' }).fill('test-client-id');
          await page.getByRole('textbox', { name: 'clientSecret' }).fill('test-client-secret');
        } else if (await page.getByRole('textbox', { name: 'Tenant ID' }).isVisible({ timeout: 3000 }).catch(() => false)) {
          // Global config screen
          await page.getByRole('textbox', { name: 'Tenant ID' }).fill('test-tenant-id');
          await page.getByRole('textbox', { name: 'Refresh token' }).fill('test-refresh-token');
        } else {
          // Workflow config screen (or other screen type)
          await page.getByRole('combobox', { name: 'Target Group' }).click();
          await page.getByRole('option').first().click();
        }

        // Click Next if available, otherwise we're on the last screen
        if (await nextButton.isVisible({ timeout: 2000 }).catch(() => false)) {
          await nextButton.click();
          await page.waitForLoadState('domcontentloaded').catch(() => {});
        }
      }
    },
  });
});
// playwright.config.ts
import { defineFoundryConfig } from '@crowdstrike/foundry-playwright';

export default defineFoundryConfig({
  appInstallDir: './tests',
});

Important: one app at a time

Do not run npm test in multiple Foundry apps simultaneously using the same Falcon account. Concurrent login attempts trigger rate-limiting and will temporarily lock the account, causing all test runs to fail.

Examples

These Falcon Foundry sample apps use @crowdstrike/foundry-playwright for their E2E tests:

| App | Config | Tests | |-----|--------|-------| | Functions with Python | playwright.config.ts | e2e/tests/ | | Triage with MITRE ATT&CK | playwright.config.ts | e2e/tests/ | | Falcon LogScale | playwright.config.ts | e2e/tests/ |

What's included

Page objects

| Class | Purpose | |-------|---------| | AppCatalogPage | Install, uninstall, and navigate to apps | | AppManagerPage | Find and navigate to apps in App Manager | | BasePage | Abstract base with smartClick, waitAndAct, retry support | | DetectionExtensionPage | Navigate to Endpoint Detections, expand extensions, return iframe FrameLocator | | FoundryHomePage | Navigate to Foundry home, verify title | | HostManagementPage | Navigate to host management, retrieve host IDs | | WorkflowsPage | Search, open, execute, and verify Fusion SOAR workflows |

Configuration

| Export | Purpose | |--------|---------| | defineFoundryConfig() | Wraps Playwright's defineConfig with the standard pipeline | | TestConfig / config | Centralized env var management and timeouts |

Utilities

| Export | Purpose | |--------|---------| | SmartWaiter | Intelligent waiting (waitForVisible, waitForPageLoad, waitForCondition) | | RetryHandler | Exponential backoff retry with Playwright error filtering | | Logger / logger | Structured logging with step counters and performance timing |

Auth

| Export | Purpose | |--------|---------| | authenticate() | CSRF token flow with TOTP 2FA | | getUserCredentials() | Read credentials from environment | | AuthFile | Path to stored auth state (playwright/.auth/user.json) |

Environment variables

| Variable | Required | Description | |----------|----------|-------------| | FALCON_BASE_URL | No | Falcon console URL (default: https://falcon.us-2.crowdstrike.com) | | FALCON_USERNAME | Yes | Login email | | FALCON_PASSWORD | Yes | Login password | | FALCON_AUTH_SECRET | Yes | TOTP secret for 2FA | | APP_NAME | Yes | App name as shown in App Catalog | | CI | No | Set automatically in CI; adjusts timeouts and retries | | DEBUG | No | Set to true for verbose logging |

defineFoundryConfig options

| Option | Type | Default | |--------|------|---------| | testDir | string | './tests' | | appInstallDir | string | Library built-in (override for apps with config screens) | | timeout | number | 60s (CI) / 45s (local) | | expectTimeout | number | 10s (CI) / 8s (local) | | actionTimeout | number | 15s (CI) / 10s (local) | | navigationTimeout | number | 30s (CI) / 20s (local) | | retries | number | 2 (CI) / 0 (local) | | reporter | string | 'list' | | use | object | Merged with defaults (testIdAttribute: 'data-test-selector', etc.) | | projects | array | Replaces the default 4-project pipeline if provided |

Development

Requires Node.js >= 24.

# Install dependencies
pnpm install

# Type-check
pnpm lint:types

# Lint (ESLint + type-check)
pnpm lint

# Fix lint issues
pnpm lint:fix

# Run tests
pnpm test

# Build
pnpm build

Releasing

  1. Update CHANGELOG.md: replace TBD with today's date.
  2. Bump the version in package.json.
  3. Create a PR, get approval, and merge.
  4. Tag main and push the tag:
git tag v0.5.1
git push origin v0.5.1
  1. Create a GitHub Release from the tag. The release.yml workflow publishes to npm automatically when a release is published.

Related

License

See LICENSE for details.