E2e Testing 标志

E2e Testing

组织
CrowdStrike
e2e-testing

End-to-end testing for Falcon Foundry apps using Playwright and @crowdstrike/foundry-playwright. TRIGGER when user asks to "add e2e tests", "add playwright tests", "write end-to-end tests", "test my app", or mentions "e2e", "playwright", or "end-to-end" in the context of testing a Foundry app. DO NOT TRIGGER during normal app creation, UI development, or function development. This skill is opt-in; not all apps need e2e tests.

概览

发布者CrowdStrike
代码仓库foundry-skills
技能名称e2e-testing
星标数
37
复刻数
7
附带文件
1
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载的 SKILL.md 文件,因此只有在请求确实匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个随附文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 CrowdStrike 发布于 GitHub。请在安装前查看源内容。

安装

在 TypingMind 中安装 E2e Testing AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/CrowdStrike/foundry-skills/tree/main/skills/e2e-testing
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CrowdStrike/foundry-skills.git /tmp/foundry-skills
mkdir -p .claude/skills
cp -r /tmp/foundry-skills/skills/e2e-testing .claude/skills/e2e-testing
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 E2e Testing,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 E2e Testing。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 E2e Testing 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会获取指令,因此未使用的技能不会产生额外费用。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Foundry E2E Testing

End-to-end testing for Falcon Foundry apps using Playwright and the @crowdstrike/foundry-playwright library.

The library provides authentication, app install/uninstall, page objects, and configuration so each app only writes its app-specific tests.

Part of a suite. If development-workflow has not already run, and this is a new app or its first capability, load the development-workflow skill first — it owns the CLI prerequisite check, scaffolding order, and manifest coordination.

Quick Start

1. Create the e2e/ directory

my-foundry-app/
├── e2e/
│   ├── .env                    # Local credentials (git-ignored)
│   ├── .env.sample             # Template for other developers
│   ├── .gitignore
│   ├── package.json
│   ├── playwright.config.ts
│   └── tests/
│       └── foundry.spec.ts
├── manifest.yml
└── ...

2. package.json

Node.js LTS is recommended.

json
{
  "name": "playwright-foundry",
  "version": "1.0.0",
  "scripts": {
    "test": "npx playwright test",
    "test:ui": "npx playwright test --ui",
    "test:debug": "npx playwright test --debug",
    "test:verbose": "DEBUG=true npx playwright test --reporter=list"
  },
  "type": "commonjs",
  "devDependencies": {
    "@crowdstrike/foundry-playwright": "0.5.6",
    "@types/node": "25.6.0"
  }
}

Always pin exact versions — never use "latest", "^", or "~". Check npm for the current version of each package.

The library brings @playwright/test, @dotenvx/dotenvx, and otpauth as transitive dependencies; don't install them separately.

3. .env

sh
FALCON_USERNAME=your.email@company.com
FALCON_PASSWORD=your-password
FALCON_AUTH_SECRET=your-totp-secret
FALCON_BASE_URL=https://falcon.us-2.crowdstrike.com
APP_NAME=your-app-name

Convention for sample apps: Set APP_NAME to match the manifest name field, which should match the repo name (e.g., foundry-sample-functions-python). This avoids spaces in names and simplifies CI. This is a convention, not a hard requirement.

4. playwright.config.ts

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

export default defineFoundryConfig();

This gives you 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 after tests

5. .gitignore

node_modules/
playwright/.auth/
playwright-report/
test-results/
.env

6. Install and run

bash
cd e2e
npm install
npx playwright install chromium --with-deps
npm test

Writing Tests

Available page objects

The library provides these page objects:

ClassPurpose
WorkflowsPageSearch, open, execute, and verify Falcon Fusion SOAR workflows
DetectionExtensionPageNavigate to Endpoint Detections, expand extensions, return iframe FrameLocator
HostManagementPageNavigate to host management, retrieve host IDs
AppCatalogPageInstall, uninstall, and navigate to apps
AppBuilderPageDisable workflow provisioning before install
AppManagerPageFind and navigate to apps in App Manager
FoundryHomePageNavigate to Falcon Foundry home

Fixtures pattern

Create src/fixtures.ts to wire up page objects as Playwright fixtures. Only import what your tests actually use — don't define unused fixtures:

typescript
import { test as baseTest } from '@playwright/test';
import { DetectionExtensionPage, WorkflowsPage, HostManagementPage } from '@crowdstrike/foundry-playwright';

type FoundryFixtures = {
  detectionExtensionPage: DetectionExtensionPage;
  workflowsPage: WorkflowsPage;
  hostManagementPage: HostManagementPage;
};

export const test = baseTest.extend<FoundryFixtures>({
  detectionExtensionPage: async ({ page }, use) => { await use(new DetectionExtensionPage(page)); },
  workflowsPage: async ({ page }, use) => { await use(new WorkflowsPage(page)); },
  hostManagementPage: async ({ page }, use) => { await use(new HostManagementPage(page)); },
});

export { expect } from '@playwright/test';

Playwright fixtures are lazy, so unused ones cost nothing at runtime, but they're dead code. Add fixtures as tests need them.

Example test: workflows

typescript
import { test } from '../src/fixtures';

test.describe.configure({ mode: 'serial' });

test('should execute workflow', async ({ workflowsPage }) => {
  test.setTimeout(180000);
  await workflowsPage.navigateToWorkflows();
  await workflowsPage.executeAndVerifyWorkflow('My Workflow Name');
  await workflowsPage.verifyWorkflowExecutionCompleted();
});

test('should execute workflow with input', async ({ workflowsPage, hostManagementPage }) => {
  test.setTimeout(180000);
  const hostId = await hostManagementPage.getFirstHostId();
  if (!hostId) { test.skip(true, 'No hosts available'); return; }

  await workflowsPage.navigateToWorkflows();
  await workflowsPage.executeAndVerifyWorkflow('Host Details Workflow', {
    inputs: { 'Host ID': hostId },
  });
  await workflowsPage.verifyWorkflowExecutionCompleted();
});

executeAndVerifyWorkflow() handles search, execution trigger, and initial verification. verifyWorkflowExecutionCompleted() opens the execution detail view in a new tab and polls until the status leaves "In Progress" — it fails the test if the execution reports "Failed" and times out after 120s by default. For render-only checks (a workflow without credentials), use verifyWorkflowRenders().

Example test: UI extensions

typescript
import { test, expect } from '../src/fixtures';

test('should render extension', async ({ detectionExtensionPage }) => {
  const frame = await detectionExtensionPage.openExtension('hello');
  await expect(frame.getByText(/My App Title/i)).toBeVisible({ timeout: 10000 });
});

openExtension() navigates to Endpoint Detections, opens the first detection, scrolls to the named extension button, expands it, and returns the iframe FrameLocator.

Apps with Configuration Screens

If your app has API integration settings during install (e.g., ServiceNow credentials), the default install will fail because the Install button stays disabled until fields are filled.

1. Add integration credentials to .env and .env.sample

sh
# .env.sample — commit this as a template
SERVICENOW_INSTANCE_URL=https://dev123456.service-now.com
SERVICENOW_USERNAME=your-servicenow-username
SERVICENOW_PASSWORD=your-servicenow-password

# .env — local values, git-ignored
SERVICENOW_INSTANCE_URL=https://dev99999.service-now.com
SERVICENOW_USERNAME=admin
SERVICENOW_PASSWORD=s3cret

2. Create a custom tests/app-install.setup.ts

typescript
import { test as setup } from '@playwright/test';
import { AppCatalogPage, config } from '@crowdstrike/foundry-playwright';

setup('install app', async ({ page }) => {
  const catalog = new AppCatalogPage(page);

  const instanceUrl = process.env.SERVICENOW_INSTANCE_URL;
  const username = process.env.SERVICENOW_USERNAME;
  const password = process.env.SERVICENOW_PASSWORD;
  if (!instanceUrl || !username || !password) {
    throw new Error('Missing required ServiceNow env vars: SERVICENOW_INSTANCE_URL, SERVICENOW_USERNAME, SERVICENOW_PASSWORD');
  }

  await catalog.installApp(config.appName, {
    configureSettings: async (page) => {
      await page.getByRole('textbox', { name: 'Name', exact: true }).fill('ServiceNow Integration');
      await page.getByRole('textbox', { name: 'Instance' }).fill(instanceUrl);
      await page.getByRole('textbox', { name: 'Username' }).fill(username);
      await page.getByRole('textbox', { name: 'Password' }).fill(password);
    },
  });
});

The library loads .env automatically (via @dotenvx/dotenvx) so process.env values are available without extra setup. In CI, set these as GitHub Actions secrets instead.

3. Point the config at the custom install

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

How to discover field names: Use Playwright MCP to take a snapshot of the install page and inspect the form fields. See debugging-with-mcp.md.

Disabling Workflow Provisioning

Apps with workflows that require valid API credentials will fail during install if you provide fake credentials for the configuration screen. Some workflows are also long-running (e.g., Anomali ThreatStream ingestion) and shouldn't be provisioned during testing because they'll start automatically. Use AppBuilderPage.disableWorkflowProvisioning() before install to skip provisioning:

typescript
import { test as setup } from '@playwright/test';
import { AppBuilderPage, AppCatalogPage, config } from '@crowdstrike/foundry-playwright';

setup('install app', async ({ page }) => {
  setup.setTimeout(300000);
  const appBuilder = new AppBuilderPage(page);
  await appBuilder.disableWorkflowProvisioning(config.appName);

  const catalog = new AppCatalogPage(page);
  await catalog.installApp(config.appName);
});

This navigates to the App Builder, finds the app, toggles off "Provision on install" for each workflow template, and saves. When it changed anything, it also deploys and releases a new version of the app from the App Builder; it skips all of that if a previous release already has provisioning disabled. Call it before installApp() in your custom app-install.setup.ts.

Multi-Screen Configuration Wizards

Some apps have settings spread across multiple screens (e.g., Workday and SailPoint, with 3 each). The screens don't always appear in the same order, so loop over them, detect the current screen by a field only it has, fill it, and click "Next setting" when it's visible:

typescript
import { test as setup } from '@playwright/test';
import { AppBuilderPage, AppCatalogPage, config } from '@crowdstrike/foundry-playwright';

setup('install app', async ({ page }) => {
  setup.setTimeout(300000);
  const appBuilder = new AppBuilderPage(page);
  await appBuilder.disableWorkflowProvisioning(config.appName);

  const catalog = new AppCatalogPage(page);

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

      for (let screen = 0; screen < 3; screen++) {
        if (await page.getByRole('textbox', { name: 'Client ID' }).isVisible({ timeout: 3000 }).catch(() => false)) {
          await page.getByRole('textbox', { name: 'Name' }).fill('My Integration');
          await page.getByRole('textbox', { name: 'Host' }).fill('https://api.example.com');
          await page.getByRole('textbox', { name: 'Client ID' }).fill(process.env.CLIENT_ID!);
          await page.getByRole('textbox', { name: 'Client Secret' }).fill(process.env.CLIENT_SECRET!);
        } else if (await page.getByRole('textbox', { name: 'Tenant ID' }).isVisible({ timeout: 3000 }).catch(() => false)) {
          await page.getByRole('textbox', { name: 'Tenant ID' }).fill(process.env.TENANT_ID!);
        } else {
          await page.getByRole('textbox', { name: 'Name' }).fill('My Second Integration');
          await page.getByRole('textbox', { name: 'Host' }).fill('https://api.example.com');
        }

        // The last screen shows "Install app" instead of "Next setting"
        if (await nextButton.isVisible({ timeout: 2000 }).catch(() => false)) {
          await nextButton.click();
          await page.waitForLoadState('domcontentloaded').catch(() => {});
        }
      }
    },
  });
});

Set the loop count to your app's screen count. The .catch() calls keep a missing field or an already-loaded page from failing setup.

Custom Page Objects

For app-specific UI that the library doesn't cover, extend BasePage:

typescript
import { Page, expect } from '@playwright/test';
import { BasePage, AppCatalogPage, config } from '@crowdstrike/foundry-playwright';

export class MyAppPage extends BasePage {
  constructor(page: Page) {
    super(page, 'MyAppPage'); // display name for logging only
  }

  protected getPagePath(): string {
    throw new Error('Direct path navigation not supported. Use navigateToInstalledApp() instead.');
  }

  protected async verifyPageLoaded(): Promise<void> {
    await this.page.locator('h1').filter({ hasText: /My App/i }).waitFor();
  }

  async navigateToInstalledApp(): Promise<void> {
    return this.withTiming(async () => {
      const catalog = new AppCatalogPage(this.page);
      await catalog.navigateToInstalledApp(config.appName);
      await this.verifyPageLoaded();
    }, 'Navigate to installed app');
  }

  async verifyAppContent(): Promise<void> {
    return this.withTiming(async () => {
      const iframe = this.page.frameLocator('iframe[name="portal"]');
      const heading = iframe.getByRole('heading', { name: /My App/i });
      await expect(heading).toBeVisible({ timeout: 10000 });
    }, 'Verify app content');
  }
}

Foundry app page URLs contain deployment-specific IDs that change on every deploy, so never hardcode paths. Use AppCatalogPage.navigateToInstalledApp() to navigate via the App Catalog menu instead.

BasePage gives you smartClick(), withTiming(), navigateToPath(), elementExists(), a logger, and a waiter (SmartWaiter instance).

Add the custom page to your fixtures alongside library page objects.

Debugging with Playwright MCP

Playwright MCP is invaluable for writing and debugging e2e tests. See references/debugging-with-mcp.md for detailed patterns.

Key principle: When using Playwright MCP interactively, authentication is manual. Navigate to the Falcon login page, then tell the user: "Please log in to Falcon in the browser, then let me know when you're ready." Do not attempt automated TOTP login through MCP.

CI with GitHub Actions

The sample apps use a shared e2e.yml workflow pattern. Rather than duplicating it here (where it would go stale), reference the canonical implementation:

Reference: foundry-sample-functions-python/.github/workflows/e2e.yml

Key CI concepts

  1. Concurrency serialization: Only one e2e run per repo at a time (prevents deployment collisions)
  2. Unique app names: CI generates a unique name from repo + actor + timestamp to avoid conflicts
  3. Manifest ID stripping: yq -i 'del(.. | select(has("id")).id) | del(.. | select(has("app_id")).app_id)' manifest.yml
  4. Deploy → wait → release → test → cleanup: The workflow deploys, polls for success, releases, runs tests, then always deletes the app
  5. App cleanup: foundry apps delete -f runs in an always() step so apps are cleaned up even on failure

Required GitHub secrets

SecretPurpose
FOUNDRY_API_CLIENT_IDFoundry CLI authentication
FOUNDRY_API_CLIENT_SECRETFoundry CLI authentication
FOUNDRY_CIDCrowdStrike Customer ID
FOUNDRY_CLOUD_REGIONCloud region (us-1, us-2, eu-1, us-gov-1, us-gov-2)
FALCON_USERNAMEFalcon console login for Playwright
FALCON_PASSWORDFalcon console password
FALCON_AUTH_SECRETTOTP secret for 2FA

CI-specific behavior

The library detects CI=true and adjusts:

  • Higher timeouts (60s default vs 45s local)
  • Retries enabled (2 retries vs 0 local)
  • .env loading skipped (credentials come from environment)

defineFoundryConfig() Options

OptionTypeDefault
testDirstring'./tests'
appInstallDirstringLibrary built-in (override for apps with config screens)
timeoutnumber60s (CI) / 45s (local)
retriesnumber2 (CI) / 0 (local)
reporterstring'list'
useobjectMerged with defaults (testIdAttribute: 'data-test-selector')
projectsarrayReplaces the default 4-project pipeline if provided

Sidebar navigation flakiness

The Falcon sidebar menu re-renders during navigation, which can detach DOM elements mid-click and cause intermittent timeouts. This affects any test that navigates through the sidebar (detections, workflows, host management, etc.). The library's navigation methods include retry logic for this, but with retries: 0 locally, a single re-render failure will fail the test.

For apps that navigate through the sidebar, set retries: 2 to handle this reliably:

typescript
export default defineFoundryConfig({ retries: 2 });

Common Pitfalls

ProblemCauseFix
"Could not find app in catalog"APP_NAME doesn't match the manifest nameEnsure .env APP_NAME matches manifest.yml name field
Install button stays disabledApp has config screens (API integrations)Create custom app-install.setup.ts with configureSettings()
"collection existed previously but was deleted"Stale IDs in manifest from a previous deploymentStrip all IDs: yq -i 'del(.. | select(has("id")).id) | del(.. | select(has("app_id")).app_id)' manifest.yml
Tests fail on first run after deployRelease not propagated yetWait 15-30s after release before running tests; CI workflow includes a sleep
Tests pass locally but fail in CIDifferent timeout/retry settingsCheck CI=true is set; library auto-adjusts timeouts
Login fails with account lockoutRunning npm test in multiple apps simultaneouslyRun tests for one app at a time. Concurrent login attempts against the same Falcon account trigger rate-limiting and temporarily lock the account.

Reference Implementations

All CrowdStrike/foundry-sample-* apps have e2e tests using this library:

AppHighlights
foundry-sample-functions-pythonconfigureSettings(), workflows, extension, host details
foundry-sample-mitreCustom page objects (MitreChartPage), parallel tests
foundry-sample-anomali-threatstreamAPI integration config
foundry-sample-category-blockingUI page testing
foundry-sample-charlotte-toolkitCharlotte AI toolkit
foundry-sample-collections-toolkitCollection CRUD
foundry-sample-detection-translationDetection extension
foundry-sample-foundryjs-demoFoundry-JS demo
foundry-sample-idp-notificationsIDP notifications
foundry-sample-insider-risk-sailpointSailPoint integration
foundry-sample-insider-risk-workdayWorkday integration
foundry-sample-logscaleLogScale data ingestion
foundry-sample-ngsiem-importerNext-Gen SIEM importer
foundry-sample-openrouter-toolkitOpenRouter AI toolkit
foundry-sample-rapid-responseRapid response
foundry-sample-scalable-rtrScalable RTR
foundry-sample-servicenow-idpServiceNow IDP
foundry-sample-servicenow-itsmServiceNow ITSM
foundry-sample-threat-intelThreat intelligence
foundry-sample-zscaler-internet-accessZscaler integration

Integration with Other Skills

  • development-workflow: E2E testing is delegated from the orchestrator when users request it
  • ui-development: Tests verify UI pages and extensions render correctly in the Falcon console
  • workflows-development: Tests verify workflow execution and completion
  • debugging-workflows: Use for deploy/release issues that block testing

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

E2e Testing AI 技能有什么作用?

End-to-end testing for Falcon Foundry apps using Playwright and @crowdstrike/foundry-playwright. TRIGGER when user asks to "add e2e tests", "add playwright tests", "write end-to-end tests", "test my app", or mentions "e2e", "playwright", or "end-to-end" in the context of testing a Foundry app. DO NOT TRIGGER during normal app creation, UI development, or function development. This skill is opt-in; not all apps need e2e tests.

为什么在 TypingMind 中使用 E2e Testing?

因为您只需安装一次,就能搭配任何模型使用。E2e Testing 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型,甚至可以在聊天中途切换模型,而不会影响技能正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 E2e Testing?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/CrowdStrike/foundry-skills/tree/main/skills/e2e-testing。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 E2e Testing?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

E2e Testing 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以搭配 E2e Testing 使用,包括 GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等,都可在 TypingMind 中使用您自己的 API 密钥接入。

E2e Testing AI 技能免费吗?

是的。该技能源自 CrowdStrike 在 GitHub 上以 MIT 许可证发布的项目。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇