-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
Time to introduce first UI tests code #2243
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
@robinbisht20 I think this feature has been added during GSOC 2023 |
So I want to join your team |
For that you can suggest some improvements in the current UI and workflows and raise an issue regarding it. |
@robinbisht20 This issue has been completed under GSoC 2023 by @reachaadrika. The issue is still open because the README PR has not been merged till now. So, kindly contribute to the existing issues related to tests. Closing this issue. |
Reason/Context
Please try answering few of those questions
Why we need this improvement?
We need to introduce UI tests to enhance the reliability and quality of our software. Manual testing is time-consuming and error-prone, making it difficult to catch every UI issue. Automation allows us to consistently validate the functionality and appearance of our application, reducing the risk of human error and ensuring that new changes don't introduce regressions.
How will this change help?
Introducing UI tests will provide several benefits. It will improve the efficiency of our development process by quickly identifying UI-related bugs. This, in turn, reduces the cost of fixing issues that might slip through the cracks during manual testing. Additionally, UI tests will help us maintain a better user experience and build confidence in our software's stability, which is essential for user satisfaction and trust.
What is the motivation?
The motivation behind implementing UI tests is to deliver a better user experience and to align with industry best practices. In a rapidly evolving software landscape, it's crucial to ensure that our application functions correctly across different platforms and browsers. By automating UI tests, we aim to catch issues early in the development process, allowing us to deliver high-quality software to our users while saving time and resources in the long run.
introduce your first UI tests, you can use a testing framework like Mocha or Jest in combination with Puppeteer for writing and running UI tests. Here's a basic structure for creating your first UI test using Mocha and Puppeteer:
1. Install Dependencies:
First, you need to install the necessary dependencies, Mocha, Puppeteer, and Chai for assertions (you can use other assertion libraries if you prefer):
2. Create Your First Test File:
Now, create a test file, e.g.,
test.js
, and define your UI test within it.3. Run Your Tests:
To run the tests, you can use Mocha. Create an npm script in your
package.json
:Then, run the tests using:
npm test
This example test checks if specific elements with given IDs exist on a web page. You can add more test cases as needed to cover different UI scenarios. The setup and teardown functions ensure the browser is launched before running the tests and closed afterward.
Remember to adapt the code to your specific application, URLs, and element IDs. You may also need to handle async operations, user interactions, and other UI testing scenarios as per your application's requirements.
The text was updated successfully, but these errors were encountered: