You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I then added a cypress/support/index.d.ts file like this:
// in cypress/support/index.d.ts
// load type definitions that come with Cypress module
/// <reference types="cypress" />
My package.json file ensured that we have the latest stuff:
{
"name": "cypress-cucumber-typescript-example",
"version": "1.0.0",
"description": "Example of how to use Cypress with Cucumber and TypeScript",
"main": "index.js",
"scripts": {
"test": "npx cypress run --spec \"**/*.features\""
},
"author": "Lukasz Gandecki",
"license": "ISC",
"dependencies": {
"cypress": "^4.9.0",
"cypress-cucumber-preprocessor": "^2.5.2",
"tsify": "^4.0.1",
"typescript": "^3.4.5"
},
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}
}
I then added this line to the top of cypress/integration/common/globalBefore.ts
/// <reference path="../../support/index.d.ts" />
Ran npm i to install everything.
I want to focus only on the first Google test like this:
Feature: The Google
I want to open Google page
@focus
Scenario: Opening a Google network page
Given I open Google page
Then I see "Google" in the title
Scenario: Different kind of opening
Given I kinda open Google page
Then I am very happy
When I run npm run test I find that Scenario: Opening a Google network page runs Scenario: Different kind of opening is pending
so far so good....however, all the other tests in news and socialNetworks also run
This seems wrong to me. I would only expect one scenario to run.
The text was updated successfully, but these errors were encountered:
I logged this issue before but did not provide enough detail about how to replicate it.
Firstly my understanding of the @Focus tag is that only that scenario will run and all other scenarios in all other features will not.
Taking this repo as an example is not ideal as it does not have enough features/scenarios. So I deleted the features in this repo and copied in the features from the original repo: https://github.com/TheBrainFamily/cypress-cucumber-preprocessor
So I now have:
I then renamed all the .js files to .ts.
I then included a tsconfig.json file in the root like this:
I then added a cypress/support/index.d.ts file like this:
My package.json file ensured that we have the latest stuff:
I then added this line to the top of cypress/integration/common/globalBefore.ts
Ran
npm i
to install everything.I want to focus only on the first Google test like this:
When I run
npm run test
I find thatScenario: Opening a Google network page runs
Scenario: Different kind of opening is pending
so far so good....however, all the other tests in news and socialNetworks also run
This seems wrong to me. I would only expect one scenario to run.
The text was updated successfully, but these errors were encountered: