vendredi 20 janvier 2017

combine Class Fixtures and Collection Fixtures in xunit

For running Protractor end to end tests in xunit I want to Combine Class Fixtures and Collection Fixtures in xunit.
I created a collection fixture DatabaseServerFixture[Collection] to run the database and Server, so the database and web services are available for all tests all the time and database/server setup is only done once for all tests for faster execution.
I've set up a second BrowserFixture to share one instance of a browser between all tests in one class, since I want to be able to run tests from different classes parallel, each class owning it's own browser class.

Problem is: I need to reference the BrowserFixture to use in my test classes, so I can't reference the DatabaseServerFixture. And since the DatabaseServerFixture is never referenced, it is not created => no database, so all tests are failing.

I don't need to be able to Access the DatabaseServerFixture from my tests, but I Need it to start before all tests. How do I get xunit to start it even though it seems I'm not using it anywhere?

I tried creating a dummy test which uses the DatabaseServerFixture, but it is not running for the other tests, so it didn't help.

Aucun commentaire:

Enregistrer un commentaire