k6-cucumber-steps API Reference - v2.0.10-alpha.0
    Preparing search index...

    Function k6IMakeAPostRequestToWithPayloadFile

    • Makes a POST request using a payload.json file.

      Combines loading payload and making request in one step. Supports {{VARIABLE_NAME}} for env vars and {{alias:NAME}} for aliases.

      Parameters

      • endpoint: string

        API endpoint (supports {{VARIABLE_NAME}} placeholders)

      • fileName: string

        Path to the JSON file

      Returns void

      When I k6 make a POST request to "/users" with payload from "payload.json"
      When I k6 make a POST request to "/api/users" with payload from "data/create-user.json"