riok/Kreya

Use faker feature inside Script

XavierMrg opened this issue · 2 comments

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
image

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);