How to read and write CSVs in Cypress

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 14

  • @nickwake1987
    @nickwake1987 Год назад

    Awesome video. Thanks!

  • @FactWhisper7418
    @FactWhisper7418 7 месяцев назад

    Can you make a video on How to read and write xlsx in cypress. Ex: I have 1 test case with 10 steps in sheet2 and overall status of test case in sheet1. Now cypress should read the column where it should read if the test step is passed or failed and based on that it should update the overall status . Hope you got my example.

    • @CommitQuality
      @CommitQuality  7 месяцев назад

      Sorry I don't completely understand this one

    • @FactWhisper7418
      @FactWhisper7418 7 месяцев назад

      @@CommitQuality "Can you create a tutorial on how to interact with .xlsx files in Cypress? Specifically, I'm interested in a scenario where Cypress needs to read and update an Excel file across multiple sheets. For example, imagine there's an Excel workbook with two sheets: Sheet1 contains the overall status of a test case, and Sheet2 lists individual test steps (10 steps) with their statuses (passed or failed). I need Cypress to read the steps and update the statuses of the steps from Sheet2, and based on these, update the overall status in Sheet1. Could you demonstrate how to set this up in Cypress, including reading from and writing to specific cells in an Excel file?"

    • @FactWhisper7418
      @FactWhisper7418 7 месяцев назад

      @CommitQuality did u get my question?

  • @frankoneirion5574
    @frankoneirion5574 Год назад

    I want to add a row value to a specific header in a csv table. How do I go about that

    • @CommitQuality
      @CommitQuality  Год назад

      It would be similar to what we did in the video. You can just update that specific element in your array and then push that to the csv

  • @Arjunkumarp
    @Arjunkumarp Год назад +1

    How to update a particular column?

    • @CommitQuality
      @CommitQuality  Год назад

      Because it's parsed to an array you can update it like you would with any array by accessing it's index.

    • @Arjunkumarp
      @Arjunkumarp Год назад

      @@CommitQuality i tried that but not working. Can you please make a video of the same

  • @AwaisKhalil-fc1tj
    @AwaisKhalil-fc1tj Год назад

    How can we change the file path? i want to pick a file from my fixtures folder but it throws an error

    • @CommitQuality
      @CommitQuality  Год назад

      At 3:43 in the video you see me targeting my CSV file, you would change that path to wherever your CSV file lives

    • @AwaisKhalil-fc1tj
      @AwaisKhalil-fc1tj Год назад

      @@CommitQuality I'm giving that fixtures folder path as shown below [writeToPath(`.fixtures/${Name}.csv`, rows)]
      but still getting error. Do i need to give complete path or just directory name? If possible can you pls share exact url