codeceptjs/CodeceptJS

[feature-request] export cucumber-related types

開放

#2,926 建立於 2021年6月16日

 (3 則留言) (3 個反應) (1 位負責人)JavaScript (725 個分叉)batch import
enhancementgood first issuetypescript

倉庫指標

星標
 (3,956 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

What are you trying to achieve?

export DataTable and other cucumber-related types such that we can use it in step definitions

What do you get instead?

I need to manually define it on our own

interface OwnTableDefinition {
  /**
   * obtain an object that allows you to get a simple version of the table parsed by column or row
   */
  parse(): {
    /**
     * returns the table as a 2-D array
     */
    raw(): string[][],
    /**
     * returns the table as a 2-D array, without the first row
     */
    rows(): string[][],
    /**
     * returns an array of objects where each row is converted to an object (column header is the key)
     */
    hashes(): { [colName: string]: string }[],
  };
  rows: { [id: number]: { cells: { value: string }[] } };
}
Given('I have products in my cart', (table: OwnTableDefinition) => {  
   table.parse()
})

Details

  • CodeceptJS version: 3.0.7
  • NodeJS Version: 12.20.1
  • Operating System: MacOS

貢獻者指南