How to Install Smock-it?

Smock-it is a CLI-based plugin that quickly generates realistic mock data for testing. It's ideal for QA professionals, developers, and Salesforce admins, helping them validate system functionality and workflows while safeguarding customer data privacy.

Let’s walk through the steps to install Smock-it on your system.

Prerequisites:

Before installing Smock-it, ensure the following are set up on your system for a smooth installation and execution:

Step-by-Step Installation

1. Install Smock-it Plugin

Installing Smock-it is very easy, just open your terminal and run:

sf plugins install smock-it

This command downloads and installs the latest version of Smock-it as a Salesforce CLI plugin.

2. Verify the Installation

After installation, it’s important to verify that the plugin was installed correctly. To do this, run:

sf plugins

If the installation was successful, you should see Smock-it listed among the installed plugins, along with its version number.

This confirms that the plugin is ready to use and properly integrated with your Salesforce CLI environment.

3. Keep Smock-it Updated (Optional)

To ensure you have the latest features, periodically update the plugin using:

sf plugins update

Directory Structure

After running the template creation command, Smock-it will generate the necessary directories in the current working directory. Make sure not to modify these folders, as they store all the data generated by Smock-it.

While using Smock-it, the following directory structure will be created in your project:

├── data_gen/ 
│   ├── templates/                # Stores your test data templates  
│   │   └── createAccount.json 
│   ├── output/                   # Stores the generated data output 
│   │   ├── CreateAccount_DI_Output.json  
│   │   ├── CreateAccount_CSV_Output.csv  
│   │   └── CreateAccount_JSON_Output.json

data_gen/ – The main directory where all Smock-it configuration files are stored.

templates/ – Contains all your JSON templates used for generating test data.

output/ – Stores the generated data in different formats such as JSON and CSV.

Authenticating with Your Salesforce Org

Before generating test data with Smock-it, you must first connect the plugin to your Salesforce org. This ensures Smock-it has the necessary permissions to insert and retrieve data securely within your environment.

1. Log in to Your Org

To authenticate, open your terminal and run the following command:

sf org login web

This command will launch your default web browser and redirect you to the official Salesforce login page. From there, you can enter your Salesforce credentials to complete the authentication process.

Once authenticated, your org will be linked to the Salesforce CLI, allowing Smock-it to operate seamlessly with your environment.

🔒 Security Note: Smock-it never stores your credentials. All authentication is handled securely through Salesforce.

2. Verify Authentication

To confirm that your Salesforce org has been authenticated successfully, run the following command in your terminal:

sf org list

This will display a list of all Salesforce orgs currently authenticated through the Salesforce CLI on your system. 

⚠️ Important: Authentication is mandatory before generating or inserting any data using Smock-it.

What’s Next?

Now that you've successfully installed Smock-it and authenticated your Salesforce org, you're ready to move on to the next step, creating templates. These templates define the structure, rules, and relationships for the mock data you want to generate. 

Smock-it uses these templates to generate realistic and consistent datasets, helping you confidently simulate real-world scenarios.

Check out our Smock-it Template Creation Guide for a comprehensive walkthrough on how to create and customize templates.

Resources:

GitHub Page: Visit here

Smock-it Use Cases: Read Use Cases

Generating Template: Template Init Questionnaire

Previous
Previous

How Does Agentforce Work?

Next
Next

Packaging: A Comprehensive Guide for Salesforce ISVs on AppExchange