wojtekmaj / nightmare-advanced-click

Extends Nightmare with .rightClick(), .middleClick(), .ctrlClick() and other actions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm downloads CI dependencies dev dependencies

nightmare-advanced-click

Extends Nightmare with .rightClick(), .middleClick(), .ctrlClick() and other actions.

tl;dr

  • Install by executing npm install nightmare-advanced-click or yarn add nightmare-advanced-click.
  • Import by adding require('nightmare-advanced-click').
  • Use by adding e.g. .middleClick(selector) to your Nightmare chain.

Getting started

Installation

Add nigthmare-wait-for-url by executing npm install nightmare-advanced-click or yarn add nightmare-advanced-click.

Usage

Here's an example of basic usage:

const Nightmare = require('nightmare');
require('nightmare-advanced-click');

const nightmare = Nightmare({ show: true })

nightmare
  .goto('https://duckduckgo.com/')
  .type('#search_form_input_homepage', 'Alexander the great')
  .ctrlClick('#search_button_homepage');

.middleClick(string)

Clicks a given element with a middle button.

.rightClick(string)

Clicks a given element with a right button.

.ctrlClick(string)

Clicks a given element with a left button while holding Ctrl key.

.altClick(string)

Clicks a given element with a left button while holding Alt key.

.shiftClick(string)

Clicks a given element with a left button while holding ⇧ Shift key.

.cmdClick(string)

Clicks a given element with a left button while holding ⌘ Command key.

License

The MIT License.

Author

Wojciech Maj
kontakt@wojtekmaj.pl
https://wojtekmaj.pl

About

Extends Nightmare with .rightClick(), .middleClick(), .ctrlClick() and other actions.

License:MIT License


Languages

Language:JavaScript 100.0%