Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use faker feature inside Script #187

Closed
XavierMrg opened this issue Dec 20, 2023 · 3 comments
Closed

Use faker feature inside Script #187

XavierMrg opened this issue Dec 20, 2023 · 3 comments
Labels
enhancement New feature or request status:waiting-for-release Implemented, waiting for next stable release

Comments

@XavierMrg
Copy link

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

@XavierMrg XavierMrg added the enhancement New feature or request label Dec 20, 2023
@CommonGuy
Copy link
Contributor

CommonGuy commented Dec 20, 2023

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

@CommonGuy CommonGuy added the status:planned We plan to work on this label Dec 20, 2023
@CommonGuy CommonGuy added status:doing We are working on this and removed status:planned We plan to work on this labels May 2, 2024
@CommonGuy CommonGuy added status:waiting-for-release Implemented, waiting for next stable release and removed status:doing We are working on this labels Dec 4, 2024
@CommonGuy
Copy link
Contributor

This has been implemented in the latest beta version and will be released in the next stable version. You can access faker via kreya.faker now

@CommonGuy
Copy link
Contributor

This has just been released with Kreya 1.16 and is accessible via kreya.faker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request status:waiting-for-release Implemented, waiting for next stable release
Projects
None yet
Development

No branches or pull requests

2 participants