Skip to content

Commit 0151be3

Browse files
gzioloMamadukajorgefilipecosta
authored
E2E Tests: Add coverage for AI plugin callout banner on Connectors page (#76432)
Follow-up to #76379. Adds E2E test assertions for the AI Experiments plugin callout banner: - New test verifying the banner displays with install button and learn more link when the AI plugin is not installed. - Empty state test now verifies the banner is hidden when no connectors are registered. - Capability restriction tests now verify the banner is hidden when the user lacks install/activate permissions. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
1 parent f8c6fa4 commit 0151be3

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

test/e2e/specs/admin/connectors.spec.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,29 @@ test.describe( 'Connectors', () => {
193193
} );
194194
} );
195195

196+
test( 'should display the AI plugin callout banner with install button', async ( {
197+
page,
198+
admin,
199+
} ) => {
200+
await admin.visitAdminPage( SETTINGS_PAGE_PATH, CONNECTORS_PAGE_QUERY );
201+
202+
const banner = page.locator( '.ai-plugin-callout' );
203+
await expect( banner ).toBeVisible();
204+
205+
// Verify the banner message mentions the AI plugin.
206+
await expect( banner.getByText( 'AI plugin' ) ).toBeVisible();
207+
208+
// Verify the Install button is present.
209+
await expect(
210+
banner.getByRole( 'button', { name: 'Install AI Experiments' } )
211+
).toBeVisible();
212+
213+
// Verify the Learn more link is present.
214+
await expect(
215+
banner.getByRole( 'link', { name: 'Learn more' } )
216+
).toBeVisible();
217+
} );
218+
196219
test.describe( 'Empty state', () => {
197220
const PLUGIN_SLUG = 'gutenberg-test-connectors-empty-state';
198221

@@ -235,6 +258,9 @@ test.describe( 'Connectors', () => {
235258
'plugin-install.php'
236259
);
237260

261+
// Verify the AI plugin callout banner is not shown.
262+
await expect( page.locator( '.ai-plugin-callout' ) ).toBeHidden();
263+
238264
// Verify none of the default connector cards are shown.
239265
for ( const { slug } of CONNECTORS ) {
240266
await expect(
@@ -284,6 +310,11 @@ test.describe( 'Connectors', () => {
284310
CONNECTORS_PAGE_QUERY
285311
);
286312

313+
// AI plugin callout banner should be hidden when user lacks permissions.
314+
await expect(
315+
page.locator( '.ai-plugin-callout' )
316+
).toBeHidden();
317+
287318
for ( const { slug } of CONNECTORS ) {
288319
const card = page.locator( `.connector-item--${ slug }` );
289320
await expect( card ).toBeVisible();

0 commit comments

Comments
 (0)