0.10.1 • Published 4 years ago

nightwatch-api-steps v0.10.1

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

Nightwatch API steps

npm version Build Status github

Library that contains multi purporse cucumber steps for nightwatch testing.

Use it for your nightwatch tests that are based on nightwatch api.

Installation

Install it with the following command:

npm install nightwatch-api-steps

Usage

To add it to your nightwatch api nightwatch api configuration, follow these steps:

  • Add these lines to your nightwatch.json file:
  "custom_commands_path": [
    ...
    "node_modules/nightwatch-api-steps/commands"
  ],
  • In your cucumber run command, append this parameter: --require node_modules/nightwatch-api-steps/step-definitions/

Steps

StepWhat it doesUsageAlternatives
I go to :pathGoes to an specific pathI go to "/user/login"I am at :path; I am on :path , I visit :path
I go to homepageGoes to homepage, defined in base_urlI go to homepageI am at :path; I am on :path , I visit :path
I should see :textCheck that the current page contains a textI should see "Page title"
I should see :textCheck that the current page does not contains contains a textI should not see "Cookies banner"
I wait :seconds secondsWait for seconds.I wait 5 seconds
The url should contain :textCheck the url contains some specific textThe url should contain "/contact"
I click :textClick a element with a specific text.I click "Who we are"I follow :text
I should see the link :textAssert there exists a link with a specific text.I should see the link "Shop"
I should not see the link :textAssert there not exists a link with a specific text.I should not see the link "Shop"
I should see :text in the table rowAssert there exists a table row with a specific text.I should see "Status" in the table row
I should not see :text in the table rowAssert there not exists a table row with a specific text.I should not see "Status" in the table row
I select :option from :selectorSelect a specific option from a input.I select "10€" from "Price"
I check :optionCheck a specific option from a checkbox.I check "I accept terms and conditions."
I uncheck :optionUncheck a specific option from a checkbox.I uncheck "I want to receive commercial emails from Company."
I select radio button :optionCheck a radio button.I select radio button "Female"
I fill in :label with :valueFill an input with any value.I fill in "Name" with "John"
I attach the file :filename to :inputAttach a file to a I attach the file "pool_profile_picture.png" to "Profile"
I take a screenshotTakes an screenshotI take a screenshot
I take a screenshot with name :filenameTake a screenshot, and save it with a specific nameI take a screenshot with name "products_page.png"
I view the site on a :device deviceResize the window to the dimensions of the specified deviceI view the site on a "Iphone X" device
I should see the button :textAssert a button with the specified content is visible.I should see the button "Pay now"
I should not see the button :textAssert a button with the specified content is not visible.I should not see the button "Cancel"
I press the buttonPress a button.I press the button "Pay now"
the checkbox :checkbox should be checkedAssert a specific checkbox is checkedthe checkbox "I accept terms and conditions" should be checkedthe checkbox :checkbox is checked
the checkbox :checkbox should not be checkedAssert a specific checkbox is not checkedthe checkbox "I want to receive commercial emails from Company." should not be checkedthe checkbox :checkbox is unchecked
the :label field should contain :stringAssert a input with a specific label contains a specific valuethe "Name" field should contain "John"
the :label field should not contain :stringAssert a input with a specific label does not ontains a specific valuethe "Name" field should not contain "Doe"
I wait for AJAX to finishWait a current XHR http request finishesI wait for AJAX to finish
I wait for AJAX to finish at least :seconds secondsWait a current XHR http request finishes during a specific number of secondsI wait for AJAX to finish at least 5 seconds
I wait for :path AJAX request to finishWait a XHR done to a specific URL finishesI wait for "https://example.com/ajax" AJAX request to finish
I wait for :path AJAX request to finish at least :seconds secondsWait a current XHR http request to a specific path finishes during a specific number of secondsI wait for "https://example.com/ajax" AJAX request to finish at least 5 seconds

Sponsored by Metadrop.

0.10.1

4 years ago

0.10.0

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.1.0

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago