Skip to content

Commit 2e8829f

Browse files
added types to global members (#47)
* added types to global members
1 parent e2f6ae8 commit 2e8829f

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to the "@qavajs/steps-playwright" will be documented in this
44

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

7+
## [0.0.23]
8+
- :rocket: added types to global members
9+
710
## [0.0.22]
811
- :beetle: fixed exports of mock and poDefine
912

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,16 @@ module.exports = {
8181
}
8282
}
8383
```
84+
85+
## Typescript
86+
To properly use globals exposed by @qavajs/steps-playwright add corresponding types to tsconfig.json
87+
```json
88+
{
89+
"compilerOptions": {
90+
"types": [
91+
"@qavajs/steps-playwright/globals"
92+
]
93+
}
94+
}
95+
```
96+

global.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Browser, BrowserContext, Page } from 'playwright';
2+
3+
declare global {
4+
var browser: Browser;
5+
var driver: Browser;
6+
var context: BrowserContext;
7+
var page: Page;
8+
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qavajs/steps-playwright",
3-
"version": "0.0.22",
3+
"version": "0.0.23",
44
"description": "steps to interact with playwright",
55
"main": "./index.js",
66
"scripts": {

0 commit comments

Comments
 (0)