create-functional-js-test

Create Drupal FunctionalJavascript tests with validated ddev Selenium and Playwright setups.

10|4|Updated Jan 5, 2018
One-click install
npx skills add https://github.com/markconroy/markie --skill create-functional-js-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-functional-js-test
Source: https://github.com/markconroy/markie/tree/main/web/modules/contrib/ai/.agents/skills/create-functional-js-test
Command: npx skills add https://github.com/markconroy/markie --skill create-functional-js-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating reliable Drupal FunctionalJavascript tests is time-consuming because you must verify the local runtime (ddev, Selenium, Playwright), inspect real admin UI markup, and then turn that into a correct test class with proper waits and assertions.

Core Features & Use Cases

  • Environment validation: Confirms ddev is running, Selenium Standalone Chrome is available, ffmpeg exists for video recording, and the Playwright CLI can be used for manual UI exploration.
  • Admin UI exploration with guardrails: Generates a one-time admin login link, then guides manual navigation so you can accurately capture selectors, form fields, and AJAX behavior before coding the test.
  • Actionable test scaffolding: Produces a FunctionalJavascript test template that extends BaseClassFunctionalJavascriptTests, includes screenshot and video recording, uses AJAX-safe waiting, and optionally sets up EchoAI/ai settings plus AI mock request spoofing YAML when needed.

Quick Start

Ask the skill to create a FunctionalJavascript test for the AI module by providing the module name, the exact page/feature to cover, whether AI calls require spoofing, and the assertions you want the test to verify.

Frequently Asked Questions about create-functional-js-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Drupal FunctionalJavascript test for the AI module?

To create a Drupal FunctionalJavascript test, you provide the module name, exact page feature, assertions, and whether AI calls require spoofing. The test scaffolding extends BaseClassFunctionalJavascriptTests and uses selector-driven interactions to map the UI into a deterministic flow.

What do I need to run Selenium and Playwright tests in ddev for Drupal?

Running Selenium and Playwright tests in ddev requires validating that ddev is running, Selenium Standalone Chrome is available, ffmpeg exists for video recording, and the Playwright CLI is accessible for manual UI exploration before generating the test.

How do I handle AJAX waits in Drupal FunctionalJavascript tests?

Handling AJAX waits in Drupal FunctionalJavascript tests requires avoiding hardcoded sleeps by using waitFor* methods or assertWaitOnAjaxRequest to ensure AJAX-safe waiting during form and page interactions.

Can I spoof AI provider requests in Drupal testing?

Yes, you can spoof AI provider requests in Drupal testing by generating mock request YAML that matches the exact serialized provider payload, setting up EchoAI or ai settings to simulate AI module interactions without real API calls.

Why do my Drupal FunctionalJavascript tests fail due to incorrect selectors?

Drupal FunctionalJavascript tests fail when selectors are inaccurate, so the environment validation generates a one-time admin login link to guide manual navigation and accurately capture selectors, form fields, and AJAX behavior before coding.

Does the functional javascript test scaffolding include screenshot and video capture?

Yes, the functional javascript test scaffolding includes screenshot and video capture by verifying ffmpeg exists for video recording and implementing actionable test templates that capture visual evidence during UI interactions.