Comments (9)
Just adding some support to this. A setting that allows to give some priority to specific data tags would be great!
from cypress-recorder.
PR From @estruyf has added support for data-cy, data-test, and data-testid attributes. Will work on ability to customize!
from cypress-recorder.
@Fasani Correct! The PR from @estruyf has been merged and this version (1.0.5) is live on the Chrome Store.
from cypress-recorder.
Would love this feature as well, since it detects only the ids for us, but those are generated from the ui library we use, so I would need to rewrite most of the script to use the data tags instead π
from cypress-recorder.
To understand this better.
Assuming I want to test a login. I could add βdata-cyβ attributes to my login and password inputs as well as the submit button.
And the recorder would use those elements via their data attr so I end up with generated code which would be more like below:
cy.get('[data-cy=username]')
cy.get('[data-cy=password]')
cy.get('[data-cy=button]')
Which would mean that when I refactor my code later on... as long as I keep the data attributes, my tests would quite likely not need to be refactored? Correct?
from cypress-recorder.
Also the PR from @estruyf was merged or not yet?
from cypress-recorder.
@adam-stover ty
from cypress-recorder.
this is great!
from cypress-recorder.
Thanks for the requests. Thanks as well @estruyf for the implementation. Merged in #150 and released in https://github.com/KabaLabs/Cypress-Recorder/releases/tag/v1.0.5
from cypress-recorder.
Related Issues (20)
- Possible to get old versions of plugin? HOT 4
- cypress-testing-library output HOT 1
- Feature Request: Script Replay HOT 1
- Feature Request: add cy.url()... when location changed
- Firefox? HOT 2
- Handle select tags with select() method
- Clicks within iframes are not recorded. HOT 1
- "Chrome Webstore: Error 404 (Not found)!!1" ? HOT 3
- Is manifest working correctly on windows?
- Will Cypress-Recorder works even with ShadowDOM?
- How can I run the application in my local. HOT 2
- Prevents Interaction with Input Controls HOT 1
- Click canvas elements with explicit coordinates HOT 1
- record matching patterns support data-cy HOT 5
- Wrong element id saved by the Cypress Recorder
- Optionally grab a className instead of id
- Optionally copy one line of code
- [Feature Request] Add block comment with timestamp and Cypress Recording info
- Cypress command type() missing value
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-recorder.