본문으로 건너뛰기
cccskills
무료GitHub에 공개

testdriver:hover

Hover over elements or coordinates

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- Generated from hover.mdx. DO NOT EDIT. -->

Overview

Move the mouse cursor onto elements or coordinates without a click. Use this to show tooltips, dropdowns, and hover effects.

Element Hover

Put the cursor on a found element.

Syntax

await element.hover()

Returns

Promise<void>

Examples

// Find and hover
const tooltip = await testdriver.find('info icon');
await tooltip.hover();

// Wait to see tooltip
await new Promise(r => setTimeout(r, 1000));

// Hover over menu to reveal submenu
const menu = await testdriver.find('Products menu');
await menu.hover();

const submenu = await testdriver.find('Laptops submenu item');
await submenu.click();

Coordinate Hover

Put the cursor at screen coordinates.

Syntax

await testdriver.hover(x, y)

Parameters

<ParamField path="x" type="number" required> X coordinate </ParamField> <ParamField path="y" type="number" required> Y coordinate </ParamField>

Returns

Promise<void>

Examples

// Hover at coordinates
await testdriver.hover(500, 300);

// Hover and wait
await testdriver.hover(500, 300);
await new Promise(r => setTimeout(r, 1000));

Best Practices

<Check> **Prefer element hover over coordinates**
// ✅ Preferred
const icon = await testdriver.find('info icon');
await icon.hover();

// ❌ Avoid
await testdriver.hover(500, 300);
</Check> <Check> **Wait after hovering for dynamic content**
const menuItem = await testdriver.find('Settings menu');
await menuItem.hover();

// Wait for submenu to appear
await new Promise(r => setTimeout(r, 500));

const subItem = await testdriver.find('Profile submenu');
await subItem.click();
</Check> <Check> **Verify element was found before hovering**
const element = await testdriver.find('tooltip trigger');
if (!element.found()) {
  throw new Error('Element not found');
}
await element.hover();
</Check>

Use Cases

<AccordionGroup> <Accordion title="Tooltips"> ```javascript // Hover to show tooltip const icon = await testdriver.find('help icon'); await icon.hover();
await new Promise(r => setTimeout(r, 1000));

// Read tooltip content
const tooltipText = await testdriver.extract('the tooltip text');
console.log('Tooltip:', tooltipText);
```
</Accordion> <Accordion title="Dropdown Menus"> ```javascript // Hover to reveal dropdown const menuItem = await testdriver.find('Products menu item'); await menuItem.hover();
// Wait for dropdown animation
await new Promise(r => setTimeout(r, 500));

// Click submenu option
const category = await testdriver.find('Electronics category');
await category.click();
```
</Accordion> <Accordion title="Image Previews"> ```javascript // Hover over thumbnail to see preview const thumbnail = await testdriver.find('product thumbnail'); await thumbnail.hover();
await new Promise(r => setTimeout(r, 800));

// Verify preview appears
await testdriver.assert('product preview is displayed');
```
</Accordion> <Accordion title="Hover Effects"> ```javascript // Test hover state styling const button = await testdriver.find('call to action button'); await button.hover();
await new Promise(r => setTimeout(r, 500));

// Verify hover effect
await testdriver.assert('button background changed to blue');
```
</Accordion> <Accordion title="Drag and Drop"> ```javascript // Use hover in drag and drop const item = await testdriver.find('draggable item'); await item.mouseDown();
// Hover over drop zone
const dropZone = await testdriver.find('drop area');
await dropZone.hover();

await new Promise(r => setTimeout(r, 300));
await dropZone.mouseUp();
```
</Accordion> </AccordionGroup>

Complete Example

import { beforeAll, afterAll, describe, it } from 'vitest';
import TestDriver from 'testdriverai';

describe('Hover Interactions', () => {
  let testdriver;

  beforeAll(async () => {
    client = new TestDriver(process.env.TD_API_KEY);
    await testdriver.auth();
    await testdriver.connect();
  });

  afterAll(async () => {
    await testdriver.disconnect();
  });

  it('should show tooltip on hover', async () => {
    await testdriver.focusApplication('Google Chrome');
    
    // Find and hover over icon
    const infoIcon = await testdriver.find('information icon');
    await infoIcon.hover();
    
    // Wait for tooltip to appear
    await new Promise(r => setTimeout(r, 1000));
    
    // Verify tooltip is visible
    await testdriver.assert('tooltip is displayed');
    
    // Extract tooltip text
    const tooltipText = await testdriver.extract('the tooltip message');
    console.log('Tooltip says:', tooltipText);
  });

  it('should navigate dropdown menu', async () => {
    // Hover over main menu
    const menu = await testdriver.find('Navigation menu');
    await menu.hover();
    
    // Wait for dropdown
    await new Promise(r => setTimeout(r, 500));
    
    // Hover over submenu item
    const submenu = await testdriver.find('Account submenu');
    await submenu.hover();
    
    await new Promise(r => setTimeout(r, 300));
    
    // Click nested menu item
    const settings = await testdriver.find('Settings option');
    await settings.click();
    
    await testdriver.assert('settings page is displayed');
  });

  it('should preview images on hover', async () => {
    // Hover over product image
    const productImg = await testdriver.find('product 1 thumbnail');
    await productImg.hover();
    
    // Wait for preview
    await new Promise(r => setTimeout(r, 800));
    
    // Verify preview appeared
    await testdriver.assert('large product preview is shown');
    
    // Move away
    const otherElement = await testdriver.find('page heading');
    await otherElement.hover();
    
    // Verify preview disappeared
    await new Promise(r => setTimeout(r, 500));
    await testdriver.assert('product preview is hidden');
  });
});

Related Methods

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Execute natural language tasks using AI

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Make AI-powered assertions about screen state

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Deploy TestDriver on your AWS infrastructure using CloudFormation

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Speed up tests with screenshot-based caching

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

testdriverai의 스킬 모두 보기

이 스킬의 문제 신고