Converting existing cypress tests to cucumber style bdd using cypress-cucumber-preprocessor. Second scenario is not picked up

对着背影说爱祢 提交于 2019-12-11 18:44:54

问题


We have an existing application, the tests are written in cypress. We now want to integrate a cucumber style feature which will internally run using cypress. We used cypress-cucumber-preprocessor for the same. I followed the steps given here on the github page. The problem I'm facing now, is while running tests, it shows both the scenarios, but runs only one. Shows a green tick mark next to it, but doesn't start the second one, and the clock keeps on ticking. On clicking the second scenario in the cypress launcher it says - no commands were issued in this test.

What have I tried:

  1. I tried to duplicate the same scenario twice in the same feature file. It still runs only first one and does not move to the next one.
  2. I moved both different scenarios in two different feature files. It runs both of them successfully.
  3. I tried to run the example repo (cypress-cucumber-example) locally with n number of scenarios. That works seamlessly.

Some observations:

  1. While the first test is run I ran chrome console, and saw some errors due to some network calls failing. But these calls were made (with same errors) even when I was using only cypress and hadn't integrated with cucumber, and all tests were passing. Is it because of some magic cucumber is bringing along with it? Read somewhere default cucumber waits for a test is 60 seconds, I waited for maximum 170 seconds, and then stopped the suite. At the end all I get is one scenario green and other not even started.

来源:https://stackoverflow.com/questions/59177485/converting-existing-cypress-tests-to-cucumber-style-bdd-using-cypress-cucumber-p

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!