Kreya
Kreya copied to clipboard
Use faker feature inside Script
Is your feature request related to a problem? Please describe. Generate random values in Kreya script section
Describe the solution you'd like We would like to have the possibility to generate random values from faker library (which is used for templating) in Kreya script section (cf screenshot bellow)
Describe alternatives you've considered Unfortunately we have not found an alternative solution
Additional context
This is definitely something we want to add and is already on our internal roadmap.
As a workaround, you could import fakerjs as a "web module":
import { expect } from 'chai';
import { faker } from 'https://esm.sh/@faker-js/faker';
var someId = faker.string.uuid();
kreya.variables.set('myId', someId);