Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0491146
Adds Abilities Explorer
karmatosed Oct 31, 2025
cd33025
Merge branch 'trunk' into TRY/abilitiesexplorer
JasonTheAdams Nov 13, 2025
7948747
Update fixes as suggested in review
karmatosed Nov 14, 2025
6322322
Update as review
karmatosed Nov 14, 2025
544903e
Remove additional checks
karmatosed Nov 26, 2025
e40898b
Merge remote-tracking branch 'origin/develop' into pr/karmatosed/63
justlevine Jan 10, 2026
280efbf
chore: cleanup docblocks
justlevine Jan 10, 2026
86d7754
chore: fix type errors (excl `missingType.iterableValue`)
justlevine Jan 10, 2026
4c52884
Merge branch 'develop' into TRY/abilitiesexplorer
justlevine Jan 12, 2026
6200af8
Merge branch 'develop' into TRY/abilitiesexplorer
justlevine Jan 13, 2026
fc7bcf0
Merge branch 'develop' into TRY/abilitiesexplorer
dkotter Jan 15, 2026
085e594
Move the JS and CSS file into the src directory, build those via webp…
dkotter Jan 15, 2026
eadf439
Ensure the localized data our script relies on actually exists. Fix l…
dkotter Jan 15, 2026
841a7e5
Update since statements to match the format we expect when we replace…
dkotter Jan 15, 2026
a0aeb38
Fix all PHPCS and PHPStan errors
dkotter Jan 15, 2026
37fb4f9
Rename from feature to experiment
dkotter Jan 15, 2026
0884763
Add developer documentation
dkotter Jan 15, 2026
6dc0d4a
Add unit tests
dkotter Jan 15, 2026
69e5faf
Add E2E tests
dkotter Jan 15, 2026
6edc024
Move the menu item from top-level to be nested under the Tools menu. …
dkotter Jan 20, 2026
fb4d456
Fix unit test
dkotter Jan 20, 2026
1c00879
Update the Plugin Check action to v1.1.5
dkotter Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add E2E tests
  • Loading branch information
dkotter committed Jan 15, 2026
commit 69e5faf14f73723da81ba0233be670e6ed4af289
177 changes: 177 additions & 0 deletions tests/e2e/specs/experiments/abilities-explorer.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
/**
* WordPress dependencies
*/
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

/**
* Internal dependencies
*/
const {
disableExperiment,
disableExperiments,
enableExperiment,
enableExperiments,
} = require( '../../utils/helpers' );

test.describe( 'Abilities Explorer Experiment', () => {
test( 'Can enable the Abilities Explorer Experiment', async ( {
admin,
page,
} ) => {
// Globally turn on Experiments.
await enableExperiments( admin, page );

// Enable the Abilities Explorer Experiment.
await enableExperiment( admin, page, 'abilities-explorer' );
} );

test( 'Can access the Abilities Explorer page when enabled', async ( {
admin,
page,
} ) => {
// Globally turn on Experiments.
await enableExperiments( admin, page );

// Enable the Abilities Explorer Experiment.
await enableExperiment( admin, page, 'abilities-explorer' );

// Ensure the Abilities Explorer page is visible in the admin sidebar.
await expect(
page.locator( '#adminmenu .toplevel_page_ai-abilities-explorer a' )
).toBeVisible();

// Visit the Abilities Explorer page.
await admin.visitAdminPage( 'admin.php?page=ai-abilities-explorer' );

// Ensure the abilities stats section is visible.
await expect(
page.locator( '.ability-explorer-wrap .ability-explorer-stats' )
).toBeVisible();

// Ensure the abilities table is visible.
await expect(
page.locator( '.ability-explorer-wrap .wp-list-table' )
).toBeVisible();
} );

test( 'Can access the Abilities Explorer detail page when enabled', async ( {
admin,
page,
} ) => {
// Globally turn on Experiments.
await enableExperiments( admin, page );

// Enable the Abilities Explorer Experiment.
await enableExperiment( admin, page, 'abilities-explorer' );

// Visit the Abilities Explorer page.
await admin.visitAdminPage( 'admin.php?page=ai-abilities-explorer' );

// Find the Get Environment Info ability and click the View button.
const abilityRow = page
.locator( '.wp-list-table tr' )
.filter( { hasText: 'Get Environment Info' } );

const viewButton = abilityRow
.locator( '.actions a' )
.filter( { hasText: 'View' } );
await viewButton.click();

// Ensure the ability detail section is visible.
await expect(
page.locator( '.ability-explorer-wrap .ability-explorer-detail' )
).toBeVisible();

// Click the Copy button.
const copyButton = page.locator( '.ability-copy-btn' ).first();
await copyButton.click();
} );

test( 'Can access the Abilities Explorer test runner page when enabled', async ( {
admin,
page,
} ) => {
// Globally turn on Experiments.
await enableExperiments( admin, page );

// Enable the Abilities Explorer Experiment.
await enableExperiment( admin, page, 'abilities-explorer' );

// Visit the Abilities Explorer page.
await admin.visitAdminPage( 'admin.php?page=ai-abilities-explorer' );

// Find the Get Environment Info ability and click the Test button.
const abilityRow = page
.locator( '.wp-list-table tr' )
.filter( { hasText: 'Get Environment Info' } );

const testButton = abilityRow
.locator( '.actions a' )
.filter( { hasText: 'Test' } );
await testButton.click();

// Ensure the ability test runner section is visible.
await expect(
page.locator(
'.ability-explorer-wrap .ability-explorer-test-runner'
)
).toBeVisible();

// Click the Validate Input button.
const validateButton = page.locator( '#ability-test-validate' );
await validateButton.click();

// Ensure the ability test validation is visible.
await expect(
page.locator( '#ability-test-validation' )
).toBeVisible();

// Click the Invoke Ability button.
const invokeButton = page.locator( '#ability-test-invoke' );
await invokeButton.click();

// Ensure the ability test result is visible.
await expect( page.locator( '#ability-test-result' ) ).toBeVisible();

// Click the Clear button.
const clearButton = page.locator( '#ability-test-clear' );
await clearButton.click();

// Ensure the ability test result is not visible.
await expect(
page.locator( '#ability-test-result' )
).not.toBeVisible();
} );

test( 'Ensure the Abilities Explorer Experiment UI is not visible when Experiments are globally disabled', async ( {
admin,
page,
} ) => {
// Enable the Abilities Explorer Experiment.
await enableExperiment( admin, page, 'abilities-explorer' );

// Globally turn off Experiments.
await disableExperiments( admin, page );

// Ensure the Abilities Explorer page is not visible in the admin sidebar.
await expect(
page.locator( '#adminmenu .toplevel_page_ai-abilities-explorer a' )
).not.toBeVisible();
} );

test( 'Ensure the Abilities Explorer Experiment UI is not visible when the experiment is disabled', async ( {
admin,
page,
} ) => {
// Globally turn on Experiments.
await enableExperiments( admin, page );

// Disable the Abilities Explorer Experiment.
await disableExperiment( admin, page, 'abilities-explorer' );

// Ensure the Abilities Explorer page is not visible in the admin sidebar.
await expect(
page.locator( '#adminmenu .toplevel_page_ai-abilities-explorer a' )
).not.toBeVisible();
} );
} );
Loading