Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to the "@qavajs/steps-playwright" will be documented in this

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [0.0.23]
- :rocket: added types to global members

## [0.0.22]
- :beetle: fixed exports of mock and poDefine

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,16 @@ module.exports = {
}
}
```

## Typescript
To properly use globals exposed by @qavajs/steps-playwright add corresponding types to tsconfig.json
```json
{
"compilerOptions": {
"types": [
"@qavajs/steps-playwright/globals"
]
}
}
```

8 changes: 8 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Browser, BrowserContext, Page } from 'playwright';

declare global {
var browser: Browser;
var driver: Browser;
var context: BrowserContext;
var page: Page;
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qavajs/steps-playwright",
"version": "0.0.22",
"version": "0.0.23",
"description": "steps to interact with playwright",
"main": "./index.js",
"scripts": {
Expand Down