Skip to content

Commit

Permalink
Merge pull request #8 from groovenauts/features/use_playwright_test_i…
Browse files Browse the repository at this point in the history
…nstead_of_playwright_core

Use @playwright/test instead of playwright-core
  • Loading branch information
TakeruUshio authored Nov 1, 2023
2 parents 2f926b7 + 39ee4b1 commit 74e4d50
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 21 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
#playwright-pom-materials

## Release

1. Modify code and commit them.
2. npm version major/minor/patch
3. npm publish
56 changes: 50 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "playwright-pom-materials",
"version": "0.1.7",
"version": "0.1.9",
"description": "Playwright POM materials",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -35,6 +35,6 @@
"typescript": "^4.9.4"
},
"dependencies": {
"playwright-core": "^1.35.1"
"@playwright/test": "^1.35.1"
}
}
2 changes: 1 addition & 1 deletion src/helpers/playwright/LocatorPredicate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator} from 'playwright-core';
import {Locator} from '@playwright/test';

export type LocatorPredicate = (l: Locator) => Promise<boolean>;

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/playwright/locator_attr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator} from 'playwright-core';
import {Locator} from '@playwright/test';

export const hasDisabledAttr = async (l: Locator): Promise<boolean> => {
return l.evaluate((el: SVGElement | HTMLElement): boolean => {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/playwright/locator_utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Frame, Page, Locator} from 'playwright-core';
import {Frame, Page, Locator} from '@playwright/test';
import {isFrame, isPage} from './type_guards';

// See https://github.com/microsoft/playwright/blob/v1.14.1/src/client/locator.ts
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/playwright/pwRetry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator, Page} from 'playwright-core';
import {Locator, Page} from '@playwright/test';
import {config} from '../config';

import {retry, retryAttempts} from '../retry';
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/playwright/sleepFunc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Frame, Locator, Page} from 'playwright-core';
import {Frame, Locator, Page} from '@playwright/test';
import {getFrame} from './locator_utils';

export const sleepFunc = (
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/playwright/type_guards.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Frame, Page, Locator} from 'playwright-core';
import {Frame, Page, Locator} from '@playwright/test';

export const isFrame = (x: unknown): x is Frame => {
if (typeof x !== 'object' || x === null) return false;
Expand Down
2 changes: 1 addition & 1 deletion src/materials/Clickable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator} from 'playwright-core';
import {Locator} from '@playwright/test';

import {RetryOptions, LocatorPredicate} from '../helpers/playwright';

Expand Down
2 changes: 1 addition & 1 deletion src/materials/Displayable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator} from 'playwright-core';
import {Locator} from '@playwright/test';

export class Displayable {
constructor(readonly locator: Locator) {}
Expand Down
2 changes: 1 addition & 1 deletion src/materials/InputText.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator} from 'playwright-core';
import {Locator} from '@playwright/test';
import {pwRetryUi, RetryOptions} from '../helpers/playwright';

import {Operable, OperableOptions} from './Operable';
Expand Down
2 changes: 1 addition & 1 deletion src/materials/Operable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator} from 'playwright-core';
import {Locator} from '@playwright/test';

import {
LocatorPredicate,
Expand Down
2 changes: 1 addition & 1 deletion src/materials/RadioButtons.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator, Page} from 'playwright-core';
import {Locator, Page} from '@playwright/test';
import {Selectable, SelectableOptions} from './Selectable';

export type SelectableArgs = string | [string, SelectableOptions?];
Expand Down
2 changes: 1 addition & 1 deletion src/materials/SelectTag.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator} from 'playwright-core';
import {Locator} from '@playwright/test';
import {Clickable, ClickableOptions} from './Clickable';
import {pwRetry} from '../helpers/playwright';

Expand Down
2 changes: 1 addition & 1 deletion src/materials/Selectable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Locator} from 'playwright-core';
import {Locator} from '@playwright/test';

import {
LocatorPredicate,
Expand Down

0 comments on commit 74e4d50

Please sign in to comment.