Skip to main content

Importing dummy data

Related links:

Context

Related links:

The "test data" feature allows you to provide test data for the context. You can quickly switch between different datasets, or edit them in-situ, and your slides will update on the spot. This ability is especially helpful if the server-side source of the customer profiles or opportunities etc. haven't been set up yet because, as long as you know what the data will look like, you can still get started developing content.

To add test data to the context, navigate to the "Context" tab in the "Slides" section of the CDK.

image

Click "Add Test Data", then fill out the name, and type in some test data in the code editor:

image

If you're working with an instance which is already set up and working, you can simply copy-and-paste data into the editor from real-world examples. If however the server-side development is not complete, you will need to set up some test customers in the "Data" section of the CDK, generate a context in the "Hooks" section, and copy-and-paste the context output into your new test data input.

Once you've added some test data, click the back arrow to return to the test data listing. From here you can switch between test data you've already set up. Click on the <> code icon to view and edit the existing test data.

image

See the context data testing guide for test data recommendations.

Feeds

Related links:

The "test data" feature allows you to provide test data for a feed. You can quickly switch between different datasets, or edit them in-situ, and your slides will update on the spot. This ability is especially helpful if the server-side source of a feed hasn't been set up yet because, as long as you know what the data will look like, you can still get started developing content.

To add test data to a feed, navigate to the "Feeds" tab in the "Slides" section of the CDK. You'll find a list of all the feeds from your project.yaml.

image

Click "Add Test Data" next to your chosen feed, then fill out the name, and type in some test data in the code editor:

image

If you're working with a feed which is already set up and working, you can simply copy-and-paste data into the editor from real-world examples. If however the server-side development is not complete, you won't know what to enter here yet. If your deck project has a specification, hopefully it declares how each feed should look. If not, you'll need to come to an agreement with the server developers.

Once you've added some test data, click the back arrow to return to the test data listing. From here you can switch between test data you've already set up. Click on the <> code icon to view and edit the existing test data.

image

See the feeds data testing guide for test data recommendations.

Sharing test data

If you are working in a team, you may wish to share the same lovingly collated test data amongst your colleagues. The fastest way to do this is to pop over to your CDK's application support directory and copy-paste the relevant data files between your machines.

info

Application support directories may be stored in a different location depending on your chosen OS. To find where this is for your machine, open up the dev tools and run nw.App.getDatapath() in the console - this will print out the path to where your CDK's locally stored data files.

Once you have located your CDK's data files, open up the Data directory to find a list of directories for every deck you have viewed in your CDK, each containing JSON files of the relevant test data.

.
└── Data
├── Starting Point
│ └── context.json
└── Quarterly Review
├── auth.json
├── context.json
├── customers.json
└── feeds.json
  • auth.json = Server login tokens
  • context.json = Dummy context data
  • customers.json = Dummy customer data
  • feeds.json = Dummy feeds data
warning

If you paste test data while viewing the relevant test data tab, your newly imported data will be overridden by the test data currently displayed in the CDK. To avoid this close your CDK, or simply navigate away from the relevant test data tab when importing test data using this method.