Greetings! I have a feature file outlined below in my cucumber webdriver test project:
# language: en
Feature: Simple Test, Int and Prod Origin vs non origin checks
Simple cloud environment Checks
@javascript @EnvCheck
Scenario: Check Env TEST Origin
Given I open the url "some_url"
When nothing
Then I expect that element ".b-stage" is displayed
@javascript @EnvCheck
Scenario: Check Env TEST non Origin
Given I open the url "some_url"
When nothing
Then I expect that element ".b-stage" is displayed
@javascript @EnvCheck
Scenario: Check Env INT Origin
Given I open the url "some_url"
When nothing
Then I expect that element ".b-stage" is displayed
@javascript @EnvCheck
Scenario: Check Env INT non Origin
Given I open the url "some_url"
When nothing
Then I expect that element ".b-stage" is displayed
@javascript @EnvCheck
Scenario: Check Env PROD Origin
Given I open the url "some_url"
When nothing
Then I expect that element ".b-stage" is displayed
@javascript @EnvCheck
Scenario: Check Env PROD non Origin
Given I open the url "some_url"
When nothing
Then I expect that element ".b-stage" is displayed
Furthermore, I have the specified Step for the test case:
import { Then } from "@cucumber/cucumber";
Then(/^I expect that element "(.*)" is displayed$/, (element) =>; {
console.log(element);
})
I am encountering a peculiar issue where my "Then" step is being skipped when I include an argument such as ".b-stage" as an element. Oddly enough, the "Given" and "When" steps execute successfully without any issues, but the "Then" step is inexplicably skipped.
I have meticulously followed the steps outlined in a video tutorial found here Chapter 4.3 - Step Definitions[^], yet I continue to encounter the same problem of skipped "Then" test cases when passing an element as an argument to the step. The debug logs displayed are as follows:
[Debug logs displayed here]
I have attempted to remove the element argument from the "Then" step, and it passes successfully. However, upon reintroducing the element argument, specifically as ".b-stage" in the feature file, the step stops working and skips the "Then" test case. Strangely, the "Given" test case executes flawlessly without any errors.