Cypress 和 Cucumber 的集成似乎进展顺利,但是在执行测试时出现以下错误:
Step implementation missing for: I open login page
cypress.json
{
"video": false,
"baseUrl": "http://localhost:8080",
"testFiles": "**/*.feature",
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}
}
./cypress/integration/login.feature
Feature: Login Feature
I want to login
@focus
Scenario: Navigate to Login
Given I open login page
Then I see Login
./cypress/integration/Login/login.js
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
Given( 'I open login page', () => cy.visit( '/Login' ) );
Then( 'Login page should be shown', () => cy.url().should( 'include', '/Login' ) );