Testim Documentation

Welcome to the Testim documentation. You'll find comprehensive guides to help you get started quickly, example code snippets, and tips for being more productive. You will also find details about advanced features that allow you to customize Testim to fit your environment or special testing conditions. Don't worry, we'll support you if you get stuck. Let's jump right in!

Guides    Changelog

CSV file validation

Learn how to validate CSV files using the Download Validation step.

You can use the Download Validation step to perform advanced validations of CSV files such as number of rows and content.

Example code:

const csvStr = fileBuffer.toString("utf8");
return csv({
  noheader: true,
  output: "csv"
})
  .fromString(csvStr)
  .then(csvRow => {
    if (csvRow.length !== parseInt(expectedNumOfRows)) {
      return Promise.reject(
        new Error(`Number of rows doesn't match ${csvRow.length}`)
      );
    }
    if (csvRow[0][0] !== expectedText) {
      return Promise.reject(
        new Error(`Failed to find expected text ${csvRow[0][0]}`)
      );
    }
  });

Parameters - Packages and JavaScript used in this example:

1.name: csv, type: Package, value: [email protected]
2.name: expectedNumOfRows, type: JavaScript, value: '2'
3.name: expectedText, type: JavaScript, value: 'dfdf'

see screenshot:

Updated 7 months ago


CSV file validation


Learn how to validate CSV files using the Download Validation step.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.