Created
November 24, 2018 23:53
-
-
Save prescottprue/1f5e2d0cffcc15721d2b1a2d2c8feb56 to your computer and use it in GitHub Desktop.
Super simple utility for creating selector string from a selector value for use in Cypress tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a selector string from a selector value. | |
* @param {String} selectorValue - Value of the selector | |
* @example | |
* createSelector('some-btn') | |
* // => [data-test=some-btn] | |
*/ | |
export function createSelector(selectorValue) { | |
return `[data-test=${selectorValue}]` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment