You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin adds the component name as a `data-qa` in each React Component.
4
+
This babel plugin adds the component name as a `data-qa` in each React Component.
5
5
6
6
<table>
7
7
<tr>
@@ -38,18 +38,19 @@ class componentName extends Component {
38
38
</tr>
39
39
</table>
40
40
41
+
> This plugin asumes that you are using [React](https://reactjs.org) and [Babel](https://babeljs.io) as a building tool to generate your bundle.
42
+
41
43
### Why?
42
44
43
-
Basically the idea is to facilitate Automate Testing on Frontend Applications.
44
-
Automate Frontend highly requires get the DOMElements and interact with them, adding `data-qa` attributes make it more easy.
45
+
The idea is to facilitate Automate Testing on Frontend Applications. Automate Frontend highly requires to get the DOMElements and interact with them, adding `data-qa` attributes automatically to all the components will make it more easy, rather than do it by code, with this way you won't have this `data-qa` in production code.
45
46
46
-
They would only need to get the element like that:
47
+
On the testing site would need to get the element like that:
PRs for additional features are welcome! There's still a few feature that are missing, for example each change of the state of the component is added as a `data-qa-state` into the DOM. Support for more libraries.
114
+
115
+
I recommend checking this [handbook](https://github.com/jamiebuilds/babel-handbook) about how to write babel plugins in order to learn.
116
+
117
+
- Clone the repo: `git clone https://github.com/davesnx/babel-plugin-transform-react-qa-classes`
118
+
- Fork it & set origin as this repo: `git remote set-url origin https://github.com/YOUR_USERNAME/babel-plugin-transform-react-qa-classes.git`
119
+
- Create a branch: `git checkout -b BRANCH_NAME`
120
+
- Do the code
121
+
- Create a PR to this repo.
122
+
123
+
There's a githook setted up when you push it runs the tests.
0 commit comments