Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: TS support improvements #35

Merged
merged 7 commits into from
Jan 2, 2024
Merged

Conversation

SebastianSedzik
Copy link
Owner

@SebastianSedzik SebastianSedzik commented Jan 1, 2024

Enhanced TypeScript support:

  • constrained the @suite decorator to class contexts only.
  • constrained the @test decorator to class method context only. Type check of test method arguments.
  • exported the TestArgs type to provide validity within test methods.
import { suite, test, TestArgs } from 'playwright-decorators';

@suite()
class ExampleSuite {
  @test()
  async exampleTest({ page }: TestArgs) { // <- TestArgs ensures correct types of arguments
    // ...
 }
}

@SebastianSedzik SebastianSedzik merged commit 8ba55c6 into master Jan 2, 2024
1 check passed
@SebastianSedzik SebastianSedzik deleted the improved-ts-support branch January 2, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant