cypress-xpath
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "cypress-xpath", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Adds XPath command to Cypress test runner", | ||
@@ -5,0 +5,0 @@ "main": "src", |
@@ -27,12 +27,2 @@ /// <reference types="cypress" /> | ||
Cypress.log({ | ||
name: 'xpath', | ||
message: selector, | ||
consoleProps () { | ||
return { | ||
'XPath': selector, | ||
} | ||
}, | ||
}) | ||
let nodes = [] | ||
@@ -43,11 +33,50 @@ const document = cy.state('window').document | ||
if (isNumber(iterator)) { | ||
return numberResult(iterator) | ||
const result = numberResult(iterator) | ||
Cypress.log({ | ||
name: 'xpath', | ||
message: selector, | ||
$el: nodes, | ||
consoleProps () { | ||
return { | ||
'XPath': selector, | ||
type: 'number', | ||
result | ||
} | ||
}, | ||
}) | ||
return result | ||
} | ||
if (isString(iterator)) { | ||
return stringResult(iterator) | ||
const result = stringResult(iterator) | ||
Cypress.log({ | ||
name: 'xpath', | ||
message: selector, | ||
$el: nodes, | ||
consoleProps () { | ||
return { | ||
'XPath': selector, | ||
type: 'string', | ||
result | ||
} | ||
}, | ||
}) | ||
return result | ||
} | ||
if (isBoolean(iterator)) { | ||
return booleanResult(iterator) | ||
const result = booleanResult(iterator) | ||
Cypress.log({ | ||
name: 'xpath', | ||
message: selector, | ||
$el: nodes, | ||
consoleProps () { | ||
return { | ||
'XPath': selector, | ||
type: 'boolean', | ||
result | ||
} | ||
}, | ||
}) | ||
return result | ||
} | ||
@@ -69,2 +98,12 @@ | ||
// TODO set found elements on the command log? | ||
Cypress.log({ | ||
name: 'xpath', | ||
message: selector, | ||
$el: nodes, | ||
consoleProps () { | ||
return { | ||
'XPath': selector, | ||
} | ||
}, | ||
}) | ||
@@ -71,0 +110,0 @@ return Cypress.$(nodes) |
5637
97