Skip to content

Instantly share code, notes, and snippets.

@dcypherthis
Last active September 18, 2017 18:02
Show Gist options
  • Save dcypherthis/c9f9cb9f6842275cbff24dafa482c4d1 to your computer and use it in GitHub Desktop.
Save dcypherthis/c9f9cb9f6842275cbff24dafa482c4d1 to your computer and use it in GitHub Desktop.
cucumber 3.x friendly steps for wdio-cucumber-framework 1.x.x
@case-1234
Feature: Testing core WDIO Fuctions
# Enter feature description here
Scenario: Handling 500 errors
Given I am going to "https://the-internet.herokuapp.com/status_codes/500"
Then I should not see an error
"dependencies": {
"cucumber": "^3.0.0",
"wdio-cucumber-framework": "^1.0.2",
"webdriverio": "^4.8.0"
}
import { defineSupportCode } from 'cucumber';
defineSupportCode(({ Given }) => {
Given(/^I am going to "([^"]*)"$/, url => {
browser.url(url);
});
});
defineSupportCode(({ Then }) => {
Then(/^I should not see an error$/, () => {
throw new Error("it broke");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment