A collection of two cypress commands :
- replacePlaceholders : provides the ability to replace placeholders within json object or string
- expectDeepEquals : provides the ability to expect two json objects (or string) to be tested as being "deeply" equal while optionally replacing placeholders within the "expected" item if a map with placeholders / values is provided
The replacePlaceholders can be (optionally) chained as child command of e.g. a fixture command Internally it is using the simple-placeholder-replacer
To install with npm:
npm i cypress-placeholder-replacer-command --save
Usage within Cypress:
import 'cypress-placeholder-replacer-command'
cy.replacePlaceholders("My name is {{myName}}", {myName: "Benoit Wauthier"})
cy.fixture("myfixutres/mynamefixture.json).replacePlaceholders({myName: "Benoit Wauthier"})
cy.expectDeepEquals(actual, expected)
cy.expectDeepEquals(actual, expected, {myName: "Benoit Wauthier"})
npm version major / minor / patch
git push origin ${tagName}
This is licensed under an MIT License. See details