Skip to content

Commit 7c4b69b

Browse files
add Critical Flows to Testing page
Props to @ankitguptaindia for the content. Co-Authored-By: Ankit K Gupta <[email protected]>
1 parent 857bfa2 commit 7c4b69b

File tree

6 files changed

+72
-0
lines changed

6 files changed

+72
-0
lines changed

_includes/markdown/Testing.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,70 @@
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+
![](../img/github-wiki-critical-flow.png)
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+
![](../img/github-wiki-test-cases.png)
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+
![](../img/github-wiki.png)
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+
168
<h2 id="code-coverage" class="anchor-heading">Code coverage {% include Util/link_anchor anchor="code-coverage" %} {% include Util/top %}</h2>
269

370
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.

img/github-wiki-critical-flow.png

69.1 KB
Loading

img/github-wiki-test-cases.png

141 KB
Loading

img/github-wiki.png

112 KB
Loading

index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ updated: 25 November 2019
9090
<div class="col">
9191
<h3><a href="{{ site.baseurl }}/testing/#top">Testing</a></h3>
9292
<ul>
93+
<li><a href="{{ site.baseurl }}/testing/#critical-flows">Critical Flows and Test Cases</a></li>
9394
<li><a href="{{ site.baseurl }}/testing/#code-coverage">Code Coverage</a></li>
9495
<li><a href="{{ site.baseurl }}/testing/#e2e-testing">E2E testing</a></li>
9596
</ul>

testing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ group: navigation
66
weight: 6
77
layout: default
88
subnav:
9+
- title: Critical Flows and Test Cases
10+
tag: critical-flows
911
- title: Code Coverage
1012
tag: code-coverage
1113
updated: 22 October 2019
14+
- title: E2E Testing
15+
tag: e2e-testing
1216
---
1317

1418
<div class="docs-section">

0 commit comments

Comments
 (0)