Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Migrate Request APIs to async #1308

Closed
9 tasks done
Tracked by #428
inancgumus opened this issue May 6, 2024 · 4 comments
Closed
9 tasks done
Tracked by #428

Migrate Request APIs to async #1308

inancgumus opened this issue May 6, 2024 · 4 comments
Assignees
Labels
async supports async (promises) breaking PRs that need to be mentioned in the breaking changes section of the release notes

Comments

@inancgumus
Copy link
Member

inancgumus commented May 6, 2024


What

Migrate the following APIs according to the How section in #428:

Class Method Current k6 Return PW return
Request allHeaders Record<string,string> Promise<{[key:string]:string;}>
Request headerValue string|null Promise<null|string>
Request headersArray Array<{name:string;value:string}> Promise<Array<{name:string;value:string;}>>
Request postData string null|string
Request resourceType ResourceType string
Request response Response|null Promise<null|Response>
Request size {body:number;headers:number} not found in Playwright
Request timing ResourceTiming {startTime:number;domainLookupStart:number;domainLookupEnd:number;connectStart:number;secureConnectionStart:number;connectEnd:number;requestStart:number;responseStart:number;responseEnd:number;}

For details on the Why and How, check the overarching issue in #428.

@inancgumus inancgumus added async supports async (promises) breaking PRs that need to be mentioned in the breaking changes section of the release notes labels May 6, 2024
@ankur22 ankur22 self-assigned this May 24, 2024
@allansson
Copy link

The type definitions for this are already async.

@inancgumus
Copy link
Member Author

inancgumus commented Jun 18, 2024

@allansson Looks like they (Response and Request) are not async? Am I missing something?

https://github.com/grafana/k6-DefinitelyTyped/blob/134104e2c91b1c5d919d700afb79980165039840/types/k6/experimental/browser.d.ts#L3778

@allansson
Copy link

Let me double-check. 🤔

@allansson
Copy link

My bad. I misread the expected return types of the tests. Will update these and the response types.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
async supports async (promises) breaking PRs that need to be mentioned in the breaking changes section of the release notes
Projects
None yet
Development

No branches or pull requests

3 participants