2

I am having problems with defining the step and mapping it to the scenario. I have installed maven, set up the dependencies for java, and installed cucumber for java plugin altogether with external libraries in IntelliJ.

There are 3 errors occurred in this step: "Class Steps is never used" "Constructor Steps is never used" "Lambda expressions are not supported at language level"

What is the exact problem here?

import cucumber.api.PendingException;

public class Steps {
    public Steps() {
        Given("^I navigate to the login page$", () -> {
            // Write code here that turns the phrase above into concrete actions
            throw new PendingException();
        });
    }
}

This is the example of the Step which is created

biruk1230
  • 3,042
  • 4
  • 16
  • 29
troc
  • 43
  • 8

1 Answers1

0

First two messages are just warnings - because you created Steps class, but didn't use it (and, of course, didn't use constructor of Steps class).

For the last one you need to change language level at least to 8.0 - Lambdas, type annotations etc. to allow lambda expressions usage (see this and this answers).

biruk1230
  • 3,042
  • 4
  • 16
  • 29