本文へ移動
cccskills
無料GitHub で公開

testdriver:right-click

Perform a right-click action to open context menus

インストール方法を見る

含まれるファイル(1)

  • SKILL.md3.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

<!-- Generated from right-click.mdx. DO NOT EDIT. -->

Overview

The rightClick() method does a right-click action on an element. It usually opens context menus. You can call it on an Element instance. Or you can use it with a selector.

Syntax

// Right-click on an element
await element.rightClick();

// Right-click using a selector
await ai.rightClick('selector');

Parameters

When called on an Element, no parameters are required.

When called directly on the AI client:

ParameterTypeDescription
selectorstringThe selector describing the element to right-click

Returns

It returns a Promise<void>. The promise resolves when the right-click action completes.

Examples

Right-Click to Open Context Menu

const fileItem = await ai.find('README.md file');
await fileItem.rightClick();

// Select menu option
await ai.click('Delete from context menu');

Direct Right-Click with Selector

await ai.rightClick('image in the gallery');
await ai.click('Save image as');

VS Code Context Menu

import { test } from 'vitest';
import { vscode } from '@testdriver/sdk';

test('renames a file via context menu', async () => {
  const { ai } = await vscode();
  
  // Right-click on a file
  await ai.rightClick('test.js in the file explorer');
  
  // Click rename option
  await ai.click('Rename');
  
  // Type new name
  await ai.type('test.spec.js');
  await ai.pressKeys('Enter');
  
  // Verify rename
  const renamedFile = await ai.find('test.spec.js in the file explorer');
  expect(renamedFile).toBeTruthy();
});

Browser Context Menu

import { test } from 'vitest';
import { chrome } from '@testdriver/sdk';

test('opens link in new tab', async () => {
  const { ai } = await chrome('https://example.com');
  
  // Right-click on a link
  await ai.rightClick('Documentation link');
  
  // Select "Open in new tab"
  await ai.click('Open link in new tab');
});

Custom Context Menu in Web App

test('uses custom context menu', async () => {
  const { ai } = await chrome('https://app.example.com');
  
  // Right-click on custom element
  await ai.rightClick('project item in the list');
  
  // Wait for custom menu to appear
  await ai.find('custom context menu');
  
  // Click menu option
  await ai.click('Duplicate project');
  
  // Verify duplication
  const duplicatedProject = await ai.find('project item (copy)');
  expect(duplicatedProject).toBeTruthy();
});

Related Methods

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions

日本語の概要は準備中です。原文の説明を表示しています。

testdriverai/testdriverai2432026年9月21日 更新

Execute natural language tasks using AI

日本語の概要は準備中です。原文の説明を表示しています。

testdriverai/testdriverai2432026年9月21日 更新

Make AI-powered assertions about screen state

日本語の概要は準備中です。原文の説明を表示しています。

testdriverai/testdriverai2432026年9月21日 更新

Deploy TestDriver on your AWS infrastructure using CloudFormation

日本語の概要は準備中です。原文の説明を表示しています。

testdriverai/testdriverai2432026年9月21日 更新

Speed up tests with screenshot-based caching

日本語の概要は準備中です。原文の説明を表示しています。

testdriverai/testdriverai2432026年9月21日 更新

How TestDriver learns your app and caches what it discovers for instant, deterministic replays

日本語の概要は準備中です。原文の説明を表示しています。

testdriverai/testdriverai2432026年9月21日 更新

testdriverai のスキルをすべて見る

このスキルの問題を報告する