Class: Playwright::Mouse

Inherits:
PlaywrightApi show all
Defined in:
lib/playwright_api/mouse.rb

Overview

The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.

Every ‘page` object has its own Mouse, accessible with [`property: Page.mouse`].

“‘js // Using ‘page.mouse’ to trace a 100x100 square. await page.mouse.move(0, 0); await page.mouse.down(); await page.mouse.move(0, 100); await page.mouse.move(100, 100); await page.mouse.move(100, 0); await page.mouse.move(0, 0); await page.mouse.up(); “`

Instance Method Summary collapse

Methods inherited from PlaywrightApi

from_channel_owner

Instance Method Details

#click(x, y, button: nil, clickCount: nil, delay: nil) ⇒ Object

Shortcut for [‘method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`].

Raises:

  • (NotImplementedError)


20
21
22
23
24
25
26
27
# File 'lib/playwright_api/mouse.rb', line 20

def click(
      x,
      y,
      button: nil,
      clickCount: nil,
      delay: nil)
  raise NotImplementedError.new('click is not implemented yet.')
end

#dblclick(x, y, button: nil, delay: nil) ⇒ Object

Shortcut for [‘method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`], [`method: Mouse.down`] and [`method: Mouse.up`].

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/playwright_api/mouse.rb', line 31

def dblclick(x, y, button: nil, delay: nil)
  raise NotImplementedError.new('dblclick is not implemented yet.')
end

#down(button: nil, clickCount: nil) ⇒ Object

Dispatches a ‘mousedown` event.

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/playwright_api/mouse.rb', line 36

def down(button: nil, clickCount: nil)
  raise NotImplementedError.new('down is not implemented yet.')
end

#move(x, y, steps: nil) ⇒ Object

Dispatches a ‘mousemove` event.

Raises:

  • (NotImplementedError)


41
42
43
# File 'lib/playwright_api/mouse.rb', line 41

def move(x, y, steps: nil)
  raise NotImplementedError.new('move is not implemented yet.')
end

#up(button: nil, clickCount: nil) ⇒ Object

Dispatches a ‘mouseup` event.

Raises:

  • (NotImplementedError)


46
47
48
# File 'lib/playwright_api/mouse.rb', line 46

def up(button: nil, clickCount: nil)
  raise NotImplementedError.new('up is not implemented yet.')
end