Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose fixture and test functions to allow to use them dynamically #1373

Closed
reaktivo opened this issue Apr 4, 2017 · 43 comments
Closed

Expose fixture and test functions to allow to use them dynamically #1373

reaktivo opened this issue Apr 4, 2017 · 43 comments
Labels
STATE: Stale An outdated issue that will be automatically closed by the Stale bot. SYSTEM: API SYSTEM: compiler TYPE: enhancement The accepted proposal for future implementation.

Comments

@reaktivo
Copy link

reaktivo commented Apr 4, 2017

Are you requesting a feature or reporting a bug?

Requesting a feature

What is the current behavior?

For TestCafe to run a test we have to create a file which explicitly calls the fixture() and the test() function at least once.

What is the expected behavior?

Ideally we should be able to grab a handle of this functions without requiring to create a test file, this would allow us to integrate TestCafe with other test tools. I'm currently struggling to integrate with CucumberJS. Being able to have a reference to the fixture() and test() global functions would allow me to use the CucumberJS hooks which would help in transitioning to TestCafe without losing a lot of feature files that have been written with the Gherkin syntax.

How would you reproduce the current behavior (if this is a bug)?

N/A

Is there any others wishing to integrate TestCafe with other test tools? I'm currently working on a hacky solutions which involves generating test files at test execution time, requiring my actual test files and passing the fixture and test functions as reference (still not working thought). And I would like to know if there's any blessed way of doing this cleanly in a supported way.

@inikulin
Copy link
Contributor

inikulin commented Apr 4, 2017

Can you give some example of how you expect it to work, please? E.g. if we expose these functions, how test task should be started? Currently you tell TestCafe to run specific file/dir and it lookups for file with test() calls and execute them. How workflow will look like with exposed functions?

@reaktivo
Copy link
Author

reaktivo commented Apr 4, 2017

Of course this is just an idea, but I'm thinking of something like the following:

createTestCafe('localhost').then(testcafe => {
  const runner = testcafe
    .createRunner()
    .browsers(['chrome']);

  const { fixture, test } = runner.getHandlers();

  myOtherTestFramework.getFeatures().forEach(feature => {
    fixture(feature.name);
    feature.steps.forEach(step => {
      test(step.name, step.fn);
    });
  })

  runner.run();
});

@inikulin
Copy link
Contributor

inikulin commented Apr 4, 2017

@reaktivo How about

runner.populateTests('suite/file name', (fixture, test) => {
    fixture(feature.name);
    
    feature.steps.forEach(step => {
      test(step.name, step.fn);
    });
});

?

@inikulin
Copy link
Contributor

inikulin commented Apr 4, 2017

But on the other hand I guess the better way to solve this will be plugable compilers. You will create testcafe-compiler-cucumber plugin which will be automatically loaded by TestCafe if installed. Plugin will decide which files to compile (by file extension and content patterns) and will implement logic that converts file content into sequence of test and fixture calls. Actually, we almost have this mechanism implemented (TestCafe currently supports 3 different types of test syntax, but it's a big secret ;)), therefore we just need to make its API public.

@rickschubert
Copy link

@inikulin What is the progress on this? I would love to use testcafe with BDD :)

@KonstBa
Copy link

KonstBa commented Jun 29, 2018

are there any news on this? :)

@belkozavr
Copy link

Waiting for some native BDD support as well.

@rquellh
Copy link

rquellh commented Sep 10, 2018

I am also interested in this integration. I've tried my best to integrate Cucumber and TestCafe, but my solution loses some of the features of TestCafe in the process. If there could be an easier way it would be appreciated.

@bhreinb
Copy link

bhreinb commented Sep 10, 2018

Yes I'm very interested in this too...I tried to integrate cucumberjs & testcafe but have found it to be seriously challenging at times :(

@DavidDaCosta
Copy link

I am also interested in this integration...

@link89
Copy link
Contributor

link89 commented Sep 21, 2018

Is there a way that we can control the lifecycle of test controller, so that we can use testcafe more like a library than a framework? Just like web driver does.

@edimistra
Copy link

I tried integrating with Gauge but it looks like there's a problem with the Gauge library. Having the ability to integrate with BDD would be finding the lost ark of agile testing :)

@dn1231
Copy link

dn1231 commented Sep 22, 2018

I agree with everybody else. It would be best if we can get this soon because the workaround looses features in testcafe.

@gauravkarvir
Copy link

any update on this ? team is very keen in using BDD with testcafe. It will be biggest milestone for people migrating from web-driver to testcafe and not going for cypress

@bhreinb
Copy link

bhreinb commented Oct 18, 2018

Hey I'd love to have official support too.

In the meantime I have created an unoffical integration with cucumberjs and TestCafe. Some folks here may find it useful. Link below

https://github.com/bhreinb/SYSTAC

@AnuradhaChannappa
Copy link

Please update once we have stable cucumber bdd integration with testcafe. Currently, i am also facing issues with fixture and test using cucumber bdd.

@kenf128
Copy link

kenf128 commented Oct 24, 2018

we've been using rquellh's testcafe-cucumber repo and love it. it's helped us write more reusable and understandable tests. we also reuse the feature tests for cross-browser testing.

https://github.com/rquellh/testcafe-cucumber/blob/master/README.md

would love to see official support for cucumber-js in testcafe (so that we can upgrade, share knowledge with the larger community etc.)

@AnuradhaChannappa
Copy link

Hi Kenf128 , I am also using the same bdd https://github.com/rquellh/testcafe-cucumber/blob/master/README.md but my problem is how can i use the requestHooks for logger and custom hooks in this framework. How to attach to tests. If anyone has similar issue and solution please share.

@ZescherW
Copy link

Hi @inikulin!

When cucumber will be officially supported? I'm dying for it..

@Qvatra
Copy link

Qvatra commented Jan 14, 2019

+1

@KJHofstede
Copy link

+1, any news on this?

1 similar comment
@kaustubhshete
Copy link

+1, any news on this?

@ampc
Copy link

ampc commented Feb 4, 2019

I've already checked some integrations made by the community but they don't support all the features offered by TestCafe. I would be glad if there was more support for BDD 👍

@grebaldi
Copy link

grebaldi commented Feb 4, 2019

Just to point at a another community solution out there, that I find pretty useful (though I couldn't tell whether it's complete in the sense @ampc mentioned above):
https://github.com/kiwigrid/gherkin-testcafe

The README of that package also refers to this issue, pointing out that it is going to be abandoned, once an official solution has been established.

Maybe someone will find it to be a viable temporary solution :)

@KJHofstede
Copy link

grebaldi That solution has no posibility to create reports showing every step, it only reports the name of the test that passed/failed. Or you would have to build something yourself of course.

kiwigrid/gherkin-testcafe#7

@AndreyBelym AndreyBelym added TYPE: enhancement The accepted proposal for future implementation. and removed TYPE: proposal labels Feb 6, 2019
@ndeztea
Copy link

ndeztea commented Jan 27, 2020

+100

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jan 27, 2020
@AlexSkorkin AlexSkorkin removed the STATE: Need response An issue that requires a response or attention from the team. label Jan 27, 2020
@nishudixit
Copy link

Any further update on this?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 24, 2020
@AlexSkorkin
Copy link
Collaborator

Once we get any results, we will post them here.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 24, 2020
@ecyrbe
Copy link

ecyrbe commented Mar 25, 2020

this is the main reason our company isn't using testcafe for now.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 25, 2020
@Farfurix Farfurix removed the STATE: Need response An issue that requires a response or attention from the team. label Mar 25, 2020
@robert-dzikowski
Copy link

I also would like to use Gherkin with TestCafe

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 8, 2020
@alexey-lin alexey-lin removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 9, 2020
@mariogalea
Copy link

Are there any updates for this feature?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label May 4, 2020
@AlexSkorkin
Copy link
Collaborator

Once we get any results, we will post them here.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label May 5, 2020
@vvedachalam
Copy link

Hi TestCafe team,
This is such a wonderful tool but lack of official integration with Gherkin put this tool behind others during tools evaluation. I am using this tool since 2018 and am looking forward to providing a more robust framework to my clients. Any timeframe marked in your roadmap for this release?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label May 23, 2020
@AlexKamaev
Copy link
Contributor

Hello @vvedachalam
At this moment this functionality is not in our Roadmap, so we cannot give you any precise information on your issue.
It was discussed in #4682
You can try to use the gherkin-testcafe module mentioned in #4682

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label May 25, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this issue in the future. If it still affects you or you have any additional information regarding it, please leave a comment and we will keep it open.

@github-actions github-actions bot added the STATE: Stale An outdated issue that will be automatically closed by the Stale bot. label May 26, 2021
@github-actions
Copy link

github-actions bot commented Jun 5, 2021

We're closing this issue after a prolonged period of inactivity. If it still affects you, please add a comment to this issue with up-to-date information. Thank you.

@github-actions github-actions bot closed this as completed Jun 5, 2021
@Arthy000
Copy link
Contributor

Arthy000 commented Jun 1, 2022

Hi all, I've been maintaining and improving the gherkin-testcafe package for a while now. It obviously doesn't cover every single one of testcafé's features yet so feel free to try it and ask for improvements.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 1, 2022
@VasilyStrelyaev VasilyStrelyaev removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATE: Stale An outdated issue that will be automatically closed by the Stale bot. SYSTEM: API SYSTEM: compiler TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests