|
| 1 | +<h2 id="critical-flows" class="anchor-heading">Critical Flows and Test Cases {% include Util/link_anchor anchor="critical-flows" %} {% include Util/top %}</h2> |
| 2 | + |
| 3 | +### What is a Critical Flow? |
| 4 | + |
| 5 | +Critical Flow is a checklist of High-Priority Test Cases and instructions to run those test cases. This is similar to the Test Suites we use in Software Testing. These cases have a set of specified formats and are useful for checking and testing a plugin. |
| 6 | + |
| 7 | +They're convenient for testing after changes (regression testing), before releasing the final build of the plugin, and for automation (end-to-end testing). |
| 8 | + |
| 9 | +### Format of Critical Flow |
| 10 | + |
| 11 | +After conducting research and considering various use cases, we have established the following format for documenting the critical flow. |
| 12 | + |
| 13 | +Example: [ClassifAI Wiki](https://github.com/10up/classifai/wiki) |
| 14 | + |
| 15 | +You will find two pages with the name: |
| 16 | + |
| 17 | +1. [Critical Flow](https://github.com/10up/classifai/wiki/Critical-Flow) |
| 18 | +2. [Testing Instructions for Critical Flow](https://github.com/10up/classifai/wiki/Testing-Instructions-for-Critical-Flow) |
| 19 | + |
| 20 | +#### Critical Flow |
| 21 | + |
| 22 | +The Critical Flow page acts as a checklist and is organized into five sections: |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +1. **User Type**: This identifies the user role required to run tests, such as admin, editor, subscriber, etc. |
| 27 | +2. **Area**: This denotes the section of test cases related to a specific aspect like admin area, or frontend. |
| 28 | +3. **Flow Name**: This serves as the description or title of the test case. |
| 29 | +4. **Testing Instructions**: This provides a link to the specific test case's testing instructions. |
| 30 | +5. **E2E Status**: This keeps track of whether an end-to-end (E2E) script has been written for the test case. |
| 31 | + |
| 32 | +#### Testing Instructions for Critical Flow |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +The Testing Instructions page serves as a guide for a person who is a beginner on the project and wants to run tests. This guide assists individuals in understanding "How to Test a Particular Test Case" by running “Testing Steps” and “Expected Results” after running the test. |
| 37 | + |
| 38 | +This page includes the "Title" of the test case (the same title used in Critical Flow), "Testing Steps," and "Expected Result." Additionally, You can add any extra information, such as "Screenshots" or any other detail that will help the user to execute the test case easily. |
| 39 | + |
| 40 | +### Use of Critical Flow |
| 41 | + |
| 42 | +The Critical Flow document serves various purposes within our workflow. Primarily, it aids in the following areas. |
| 43 | + |
| 44 | +#### E2E Test Script Creation |
| 45 | + |
| 46 | +Facilitating the development of end-to-end (E2E) test scripts, particularly for frameworks like Playwright or Cypress. The structured format of Critical Flow assists in translating testing requirements into automated scripts. |
| 47 | + |
| 48 | +#### Manual Regression Testing |
| 49 | + |
| 50 | +Enabling the execution of manual regression testing before releasing a new build. The checklist-style organization of Critical Flow ensures comprehensive coverage of test cases, helping identify potential issues and regressions. |
| 51 | + |
| 52 | +#### Pre-Release Testing |
| 53 | + |
| 54 | +Conducting quick tests before deploying a new build. The document ensures that essential test cases are verified to maintain the stability and reliability of the software. |
| 55 | + |
| 56 | +#### Software Upgrade Checks |
| 57 | + |
| 58 | +Performing tests before related software upgrades, such as those for WordPress or PHP versions. This proactive approach helps anticipate and address any compatibility issues that may arise during or after the upgrade. |
| 59 | + |
| 60 | +In summary, the Critical Flow document plays an important role in our testing processes, supporting both automated and manual testing efforts across various scenarios, from E2E script development to pre-release and upgrade testing. |
| 61 | + |
| 62 | +### Location and Tools for Critical Flow |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +We have chosen GitHub Wiki Pages as the designated location for storing our test case documentation. If the Wiki tab is not visible in the GitHub project repository, kindly request your GitHub admin to enable the Wiki feature. Note that wikis are not available on private repos, so publicly open source your code! ;) |
| 67 | + |
1 | 68 | <h2 id="code-coverage" class="anchor-heading">Code coverage {% include Util/link_anchor anchor="code-coverage" %} {% include Util/top %}</h2>
|
2 | 69 |
|
3 | 70 | Every feature should be accompanied by tests and all pull requests should come with associated tests, all living within the `tests` directory. While we have no intention of striving for 100% code coverage, we should aim for above 80% with above 90% being the ideal. We should also look to utilize a code coverage / automated code review tool like [Coveralls](https://coveralls.io/), [Code Climate](https://codeclimate.com/), or [Codecov](https://codecov.io/) and ensure that is a pull request requirement before merging.
|
|
0 commit comments