This repository was archived by the owner on Oct 13, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ See [cypress/integration/spec.js](cypress/integration/spec.js)
2929
3030## Roadmap
3131
32- - [ ] wrap returned DOM nodes in jQuery [ #2 ] ( https://github.com/cypress-io/cypress-xpath/issues/2 )
32+ - [x ] wrap returned DOM nodes in jQuery [ #2 ] ( https://github.com/cypress-io/cypress-xpath/issues/2 )
3333- [ ] retry the assertion that follows [ #3 ] ( https://github.com/cypress-io/cypress-xpath/issues/3 )
3434- [ ] add TypeScript definitions [ #4 ] ( https://github.com/cypress-io/cypress-xpath/issues/4 )
3535- [ ] search from the previous subject element [ #5 ] ( https://github.com/cypress-io/cypress-xpath/issues/5 )
Original file line number Diff line number Diff line change @@ -10,6 +10,13 @@ describe('cypress-xpath', () => {
1010 cy . xpath ( '//h1' ) . should ( 'have.length' , 1 )
1111 } )
1212
13+ it ( 'returns jQuery wrapped elements' , ( ) => {
14+ cy . visit ( 'cypress/integration/index.html' )
15+ cy . xpath ( '//h1' ) . then ( ( el$ ) => {
16+ expect ( el$ ) . to . have . property ( 'jquery' )
17+ } )
18+ } )
19+
1320 it ( 'gets h1 text' , ( ) => {
1421 cy . visit ( 'cypress/integration/index.html' )
1522 cy . xpath ( '//h1/text()' ) . its ( '0.textContent' ) . should ( 'equal' , 'cypress-xpath' )
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ const xpath = (selector) => {
6565
6666 // TODO set found elements on the command log?
6767
68- return nodes
68+ return Cypress . $ ( nodes )
6969}
7070
7171Cypress . Commands . add ( 'xpath' , xpath )
You can’t perform that action at this time.
0 commit comments