Replies: 4 comments 3 replies
-
|
Additional Postman cons: closed source potential vendor lock-in; now requires creating a Postman account. For this project, I like the continued distinction between the e2e tests and demonstration code. The low-ceremony approach and simplicity of RestClient is still very attractive. My votes: 1) RestClient, 2) Bruno, 3) Postman. The core e2e tests will be written by developers, so staying in a developer mindset with Playwright is attractive. I've used SpecFlow successfully in the past; it can be nice to have a separation of test description from test code. Allows people to contribute to the testing process without needing to become programmers, and allows others to easily review the test cases. There is a little extra work there, but it could be worthwhile. I'm interested to hear from others about this proposal. For Testcontainers, I assume this would be Testcontainers for .NET. This is a great framework - fully supportive. |
Beta Was this translation helpful? Give feedback.
-
|
@andonyns can you comment further on what you meant in your remark about .NET falling behind the JavaScript version of Playwright? |
Beta Was this translation helpful? Give feedback.
-
|
I think everyone knows how much I like the simplicity of RestClient for manual testing/demos. 🙂 |
Beta Was this translation helpful? Give feedback.
-
|
The SpecFlow project is not being maintained at the moment (there haven't been updates for over two years). See this issue for more info. Because of this issue, one of the previous maintainers created a fork Reqnroll. After testing this approach, I consider the best approach to be NUnit + Playwright + Reqnroll + TestContainers, where: NUnit is the test runner. See Ed-Fi-Alliance-OSS/Data-Management-Service#12 for a demo of the approach (still in progress) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Previous Experiences
Throughout different projects in Ed-Fi, there have been different approaches to find an end to end testing framework for the tools and applications, this has varied between languages and requirements for the tools, to name a few:
ODS / API
The ODS/API has a set of Postman tests to run different scenarios, this is built to run in CI, this includes a C# test harness setup with a set of postman scenarios to run the tests.
For local development, you need to run the Test Harness first before running the Postman tests.
This is really useful and solid, although very complex and driven by the PowerShell scripts
Admin API
Admin API uses Postman exclusively to run the tests, guided by a group of multiple collections to allow for team collaboration and avoid difficult conflicts when doing changes to the tests. This does not do any kind of setup but runs against a running Admin API instance (the setup is not part of the execution).
The management of multiple collection is a good way to avoid conflicts, but it can be hard to keep track of all collections. Additionally, if a request in one collection requires another request from another collection, you need to manually run the tests first.
Admin App and Data Import
These tools have the difference of having e2e UI tests. This is done by using Playwright with BDD scenarios provided by Gherkin (developed in JavaScript).
This was a good way to accomplish e2e UI testing, and playwright is a growing tool for automation.
Meadowlark
For Meadowlark, we did a research about options of tools to use, where we considered Postman and other tools, see Meadowlark Test Automation for more information.
After the research, We implemented the e2e testing with Jest, using SuperTest as the HTTP library with assertions (this could have been done with Axios and Jest assertions), using TestContainers to setup the test environment.
This allows us to run the tests in an isolated environment both in local and GitHub Actions for CI, this has other advantages such as functions for repeated tasks, and a simple structure to understand and add new tests.
API Demo Endpoints vs API E2E Tests
This is a separation worth doing. In API Tests, we tend to have a group of tests that aim to cover both the list of endpoints used for demo purposes and for exploratory testing and the actual e2e tests, but those should be handled separately, even with the same tool. Some of the reasons for this are:
This unification of two different set of tests is not a bad practice, but can be hard to maintain and complicated for onboarding of new team members and for community contributions.
Because of this, it can be better to have those two things separated, the Demo Endpoints can be done with Postman, Bruno or REST client (as in meadowlark), for the e2e Tests, the next section will show a list of options to select.
Tool Options for Tanager
Here's a list of tools evaluated and some notes regarding each one:
Postman
Pros:
Cons:
Bruno
The pros are similar to Postman's, except the lack of pre-request scripts on folder level.
Pros:
Cons:
Jest (Code Driven)
This is a good option because of the way it helped create the test suite in Meadowlark.
Pros:
Cons:
The Code Driven option is a good option to create a robust e2e test framework, but it is better to use a tool set according to the language.
Proposal
Create e2e tests using Playwright's API testing capabilities, using TestContainers.
Explore the possibility of using SpecFlow for scenario management.
As part of this Discussion, I will create a demo of how this would look like before continuing.
Beta Was this translation helpful? Give feedback.
All reactions