Skip to content

Wrong typing for "grabCookie": should return "object" instead of "string" #3908

Closed
@ngraf

Description

@ngraf

What are you trying to achieve?

Use I.grabCookie as intended by documentation:
https://codecept.io/helpers/Playwright/#grabcookie
await I.grabCookie('myCookie').value

What do you get instead?

TypeScript Error Property 'value' does not exist on type 'string'.

Details

  • CodeceptJS version: 3.5.5
  • NodeJS Version: 20.6.1
  • Operating System: MacOS
  • Playwright 1.38.1

I think this should be fairly easy to fix by changing return type in https://github.com/codeceptjs/CodeceptJS/blame/e0ac568f04a2b8aa4b1f0b0da2ef1f2a58a5fa7c/typings/tests/helpers/Playwright.types.ts#L98.
My current workaround is putting // @ts-ignore above it to surpress the false error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions