Change default test data JSON in Test HTML page or add additional?

I would like to modify the existing test data in server/test_data/ that appear in http://localhost:10001/web/test#. There are three things I would find useful:

  • Can I add new files that represent different tests I want to run manually
  • I can delete files I don’t need in my project (not critical but nice to have)
    ** e.g. my project only implements onAppInstall, onExternalEvent. I have no need for all others. I’d like them to be removed from the list so dropdown easier to find what I need.
  • The “Reset” button on http://localhost:10001/web/test# restores to the version I modified

So for example, here is the test_data directory I would like:

| |____test_data
| | |____onAppInstall.json
| | |____onContactUpdate.json
| | |____onContactEmailChange.json
| | |____onExternalEvent.json
| | |____onCompanyUpdate.json
| | |____onCompanyNameChange.json

And if I modifiy any of the files, when I click “Reset”, I’d like it to restore to my version (not the freshworks default)

What I have found:

  • If you delete a file, they still appear in the dropdown. Why? Where are the coming from?
  • If you edit and save one of the files. Then press “Reset”, your edits are lost and file is updated to freshworks default.
  • If you add files, they do not appear in the dropdown list.

Hey @stevemc

If you delete a file, they still appear in the dropdown. Why? Where are they coming from?

Did you try stopping and starting the server? The deleted event should disappear from the dropdown. A simple refresh of the page should also work without restarting the server. Hope this should solve your third problem too - If you add files, they do not appear in the dropdown list.

A reset click is supposed to reset the data to defaults. Also the a rollout is being planned in which only required events are dropped down based on the server.js file. Will update you about the same in this thread

4 Likes

I re-ran “fdk run” after editing or deleting files. They all still appear. All I have in the /server/test_data folder is the files listed above. Then I run “fdk run”. I see the JSON from the files I edited - so that’s working fine. But I also see all the other events (I guess the update you are referring to will address that).

The things I am not seeing that would be very useful in testing are:

  • do not show files that are not in that folder
  • allow showing multiple of a given event type (i.e. onExternalEventUpdate.json, onExternalEventCreate.json)

I think the “Reset” button should be clear that it will “Reset to Factory Defaults” and it would be nice to have a Reset button to restore from what is in the disk file.

Hi @stevemc,
Good Day!

this feature is yet to implement in FDK that only populates events, that are defined in the server.js / manifest file.

Unfortunately, it is not possible with FDK for now, We will keep you posted if we have plans on this.

This topic was automatically closed after 97 days. New replies are no longer allowed.