cypress-pseudo-localization
v1.0.0
Published
A plugin that allows to transform regular strings into their [pseudo-localized](https://en.wikipedia.org/wiki/Pseudolocalization) variant. It's a wrapper around a small fork of https://github.com/tryggvigy/pseudo-localization.
Downloads
1,347
Readme
A plugin that allows to transform regular strings into their pseudo-localized variant. It's a wrapper around a small fork of https://github.com/tryggvigy/pseudo-localization.
We highly recommend using this plugin in addition to a visual regression testing tool.
Installation
$ yarn add cypress-pseudo-localization
# or
$ npm i --save cypress-pseudo-localization
In your code
Inside the cypress/support/commands.js
file, add the following at the top:
import "cypress-pseudo-localization";
And then, in your cypress tests:
beforeEach(() => {
cy.visit("https://your-page-some-where.com/");
cy.pseudoLocalize();
});
// Make sure to cleanup to localization after the tests
// Needed, because there's a mutation observer used under the hood
afterEach(cy.stopPseudoLocalize);