-1
var webdriver = require('selenium-webdriver');

var browser = new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()).build();

const {Then, When} = require('cucumber');
const assert = require('assert');

 When(/^I search Google for "([^"]*)"$/, (text) =>{

      browser.get('http://www.google.com');
}) ;

When(/^I enter "([^"]*)" in input$/, function(expression){

       browser.get('http://www.google.com');
}) ;
Marit
  • 2,399
  • 18
  • 27
user7309686
  • 69
  • 1
  • 2
  • 7
  • Please format your code so it's easier to understand. Also, please include the error and related information in the body of the question. – MattB Jun 14 '19 at 17:56

1 Answers1

0

You are requiring When and Then into a single const which won't work. To overcome this issue, you can import it using import {When, Then} from 'cucumber';

Sreenivasulu
  • 494
  • 2
  • 7