2.0.5 • Published 8 months ago
cypress-csv2html-plugin v2.0.5
A simple plugin to wrap a CSV file into HTML, this plugin also generates a data-test
Installation
npm i -D cypress-csv2html-plugin
# or
yarn add -D cypress-csv2html-plugin
# or
pnpm add cypress-csv2html-plugin
# or
bun add -D cypress-csv2html-pluginHow To Use
Import into e2e.js
import { csv2html } from "cypress-csv2html-plugin";
csv2html();Then use the custom command cy.csv2html
cy.csv2html('cypress/fixtures/example.csv')You can use data-test for your tests
cy.get('[data-test="csv-table-container"]') // Check the table values
cy.get('[data-test="csv-table-header"]').contains('First Name') // Check the header values
cy.get('[data-test="csv-table-cell"]').contains('Linda') // Check the cell valueTypes
To get IntelliSense working with the default custom command cy.csv2html include in your specs
/// <reference types="cypress-csv2html-plugin" />Small print
Author: Nikita Polyakov
License: MIT
Support: if you find any problems with this module, email / tweet / open issue on Github