Repository navigation
v3.0.0
Major Changes
-
#46
17b55dcThanks @DyHex! - ### Documentation and upgradingPOMWright's documentation is now a site: https://dyhex.github.io/POMWright/.
- Getting started: install POMWright, write a first page
object, and hand page objects to tests as Playwright fixtures. - Upgrading from 2.x: every change in 3.0.0 that a 2.x
project meets, each with how it shows up (a compile error, a change that still compiles, or a failure with a message
that names the fix), the search that finds the affected code, and 2.x and 3.0.0 code side by side. Start here when
upgrading; the entries below describe each change in short. - API reference: every export and member, with its arguments, return value
and the errors it throws, and a page listing every error message. The same text is in the doc comments, so the
editor's hover shows it. - Internal: how POMWright works, for contributors.
The 2.x documentation stays in the repository at the
v2.1.0tag. - Getting started: install POMWright, write a first page
-
#46
735066bThanks @DyHex! - ### Breaking changesgetByIdnow matches ids the way the DOM has them, and evaluates RegExp ids as real patterns.-
String ids are matched verbatim and case-sensitively and resolve as
[id="…"]. Ids containing.,:,[,],
spaces, quotes, backslashes, or a leading digit now work. -
The
#andid=prefixes are no longer stripped.getById("#login")now looks forid="#login". Find stale call
sites with:grep -rnE 'getById\(\s*["'"'"'`](#|id=)' --include=*.ts --exclude-dir=node_modules .
-
RegExp ids are evaluated as regular expressions with their flags. In 2.x the regex source was matched as literal
substring text, so plain unanchored patterns such as/btn-submit/behave the same, while metacharacters (.,
[,(,+,*,?,^,$,|) and flags now take effect: escape characters meant literally (/a\.b/)
and anchor with^and$for whole-id matches. The rendered selector changes from[id*="…"]to
internal:attr=[id=/…/]. -
RegExp flags pass through to Playwright unchanged, as with Playwright's own locators. The sticky
yflag acts as a
start anchor, because Playwright resets the regex state per element from 1.64.0, the peer floor; prefer^. -
getById("")throws at registration, naming the registry path. -
The rendered selector for string ids changes from
locator('#x')tolocator('[id="x"]').
-
-
#46
837f1c8Thanks @DyHex! - ### Breaking changesThe package now declares its entry points and its Node floor, mirroring how
@playwright/testis packaged.- The package has an
exportsmap: import from"pomwright"only. Deep imports such aspomwright/dist/index.js
fail withERR_PACKAGE_PATH_NOT_EXPORTED;pomwright/package.jsonstays available. CommonJS projects (Playwright's
default) load the same file as before. ESM projects ("type": "module") now load an ESM entry that re-exports that
CommonJS build by name, so a process that reaches pomwright through bothimportandrequireholds one copy of
every class; TypeScript reads ESM declarations forimportand CommonJS declarations forrequire, under every
moduleResolution. Themodulefield and the separate ESM build are gone. Migration: replace deep imports with
imports from"pomwright". engines.nodeis>=20, Playwright 1.64's own requirement. npm warns when installing on older Node, where
Playwright already refuses to start.
Fixes
- The
licensefield is the SPDX idApache-2.0instead ofApache 2.0, andrepository.urlis in the form npm
expects, so npm no longer rewrites it on publish.
- The package has an
-
#46
2301beeThanks @DyHex! - ### Breaking changesPageObjectno longer calls its hooks from its own constructor, where the subclass has not stored anything yet, so
defineLocators()andpageActionsToPerformAfterNavigation()see the whole page object. Page objects, locator files
and fixtures are written as before.defineLocators()and the registry verification run once per page object, right after it is constructed (once
the code that callednewhas finished: in a fixture, before the test body), or at its first locator call if that
comes earlier. In 2.xdefineLocators()ran insidesuper(...), so a definition that used a constructor argument,
a field or a constructor-body assignment registeredundefinedwithout a word: a lost name option, a test id such
asundefined-submit, or the wrong branch of a condition. A locator module can now take page-object state as an
extra argument:defineLocators(this.locatorRegistry, this.locale).- A registry mistake (a duplicate path, an empty selector, a
hasreference to a path that is never registered, a
cycle) still fails the fixture before the test body, now with the page object's label in the message
(LoginPage: Locator registry verification failed …,LoginPage: defineLocators() failed: …), the construction
site in the stack and the original error ascause, butnew X(page)itself no longer throws for it. Every later
locator call on that page object throws the same error. Migration: a test that expectsnew X(page)to throw for a
registry mistake asserts on a first use instead:
expect(() => new X(page).getNestedLocator(path)).toThrow(…). - A broken page object built in
beforeEachorbeforeAllstill fails the tests the hook runs for, but each body
runs until its first use of that page object; in abeforeAllgroup that is notserial, every test of the group
fails, where 2.x failed the first and did not run the others. defineLocators()does not see a value assigned to the page object after anawaitthat followsnew.
Migration: pass such values to the constructor. A field initialiser that resolves a locator runs the definition
while the class is still being built; use a getter for derived locators.pageActionsToPerformAfterNavigation()is optional, with no actions by default, and it is called each time the
actions run (aftergoto()without a target and afterexpectThisPage()) instead of once at construction, so it
reads the page object's current state.[]andnullboth mean no actions, as they always did. Migration: delete
implementations that return[]ornull; with thenoImplicitOverridecompiler option, addoverrideto the
ones that stay.
Fixes
defineLocators()andpageActionsToPerformAfterNavigation()see the page object's constructor arguments, fields
and constructor-body assignments instead ofundefined.
-
#46
803455cThanks @DyHex! - ### Breaking changesThe locator registry mirrors Playwright more closely: frames are the
<iframe>element pluscontentFrame(), every
strategy's first argument is checked where it is written,updateis a patch of the registered definition and
replacea new one, and a page object verifies its registry afterdefineLocators().filter,nth,firstandlaston aframeLocator(selector)segment now apply. 2.x recorded them and dropped
them at resolution; when it mattered, the action failed with a strict mode violation naming the frame selector. A
frame segment resolves aslocator(selector), then its steps, thencontentFrame()for the descendants, and the
<iframe>element itself when it is the last segment or ahas/hasNotreference (whatowner()gave). A
step-less frame renders exactly as before; a stepped one renderslocator('iframe').nth(1).contentFrame()….
Migration:grep -rn 'frameLocator(' --include=*.ts --exclude-dir=node_modules .and review every chain that
follows with.nth(,.filter(,.first(or.last(. Prefer telling frames apart through their ancestor
segments;filter({ hasText })on an iframe element never matches.update()keeps the registered strategy and throws, namingreplace()and the right method, for another one; the
builder-local cache that restored an earlier strategy's definition is gone.replace()changes the strategy and,
likeupdate(), keeps the recorded steps and the description. Migration: rename cross-strategy
update(...).<method>(...)calls toreplaceand state the first argument.update()follows JSON Merge Patch:nulldeletes an option ({ name: null }) or every option
(getByRole("button", null),getByRole(null));undefinedand absent values leave the options alone. So
update(x, undefined)no longer wipes the options and{ key: undefined }no longer removes a key. Migration:
grep -rn 'update(' --include=*.ts --exclude-dir=node_modules . | grep undefinedand usenull.add,createReusableandreplacethrow at the call when the strategy's first argument is missing, naming the
method and the path (getByRole requires a role value for "main.button".), and every builder,updateand a seeded
addincluded, throws when it is an empty string forlocator,frameLocatorandgetByRole, which Playwright
cannot use (getById("")already threw). Onupdateand a seededaddan omitted first argument keeps the
registered one, as before.getByTestId("")and the text-likes store the empty string, which Playwright
matches. 2.x registeredgetByTestId("")andframeLocator("")without their value and failed at resolution, a
seededgetByTestId("")silently inherited, and an options-onlygetByRolefrom JavaScript registered without a
role.filter,nthanddescribebefore a strategy no longer compile; at runtime the message names the method and the
strategies to call first.- A seeded registration whose override throws keeps the seeded definition instead of being unregistered. A throwing
DSL call never changes the registry. - A registration ends at the next call on its registry (
add,getLocator,getNestedLocator,getLocatorSchema,
verify, or resolving a query). In 2.x a registration kept in a variable could be given more steps at any time,
after other registrations, after its path was resolved, from a page object's method mid-test, and the registered
locator changed with them; a later step, locator method or seeded override of it now throws
(nth() cannot apply to "item": its registration has ended; …) and changes nothing. Migration:
grep -rnE '((const|let) +\w+|this\.\w+) *= .*\badd\(' --include=*.ts --exclude-dir=node_modules .and give each
kept registration all its steps before the registry is called again; a step for one use becomes a query. PageObjectverifies every registered path right afterdefineLocators(), so a mistypedhas/hasNotpath
reference or a cycle fails at construction, with every failing path listed, instead of at the first action that
resolves it. Registration itself is unchanged: forward references stay allowed.
New
add(path).frameLocator()with no selector registers Playwright's any-frame locator (page.frameLocator(),
Playwright 1.63 and later; the peer floor is 1.64): the descendants resolve in whichever single frame holds them,
the main frame included. It must be the first segment of its chain, takes no steps and has no terminal form;
replace().frameLocator()installs it on a sub-path.registry.verify()on every registry and in the publicLocatorRegistrytype, for standalone registries from
createRegistryWithAccessors.
Fixes
- Steps on frame segments are no longer dropped.
- A registration, seed, update or replacement without its first argument no longer registers and fails later.
update(x, undefined)no longer wipes the registered options.filter,nthanddescribebefore a strategy are compile errors with a runtime message that says what to call
first.- A seeded registration is no longer unregistered by a wrong-type override.
-
#46
0850bf1Thanks @DyHex! - ### Breaking changes- A seed from
createReusableno longer changes:filter,nthanddescribereturn a new seed and leave the seed
they are called on as it was, as a PlaywrightLocatordoes, andseed.definitionreturns a copy. In 2.x they
changed the seed and returned it, so variants derived from one base seed carried each other's steps and
description (row.nth("last")afterrow.nth(0)resolved to the first row). Migration: use the result of a seed
method,add(path, { reuse: seed.filter(f) })instead ofseed.filter(f);followed byadd(path, { reuse: seed }),
which now registers the seed without the filter. add(path, { reuse: "other" })returnsfilter,nthanddescribe, which narrow the copy after the copied steps
(the copy keeps the source's strategy, steps and explicit description, as before; the source never changes). There
is no strategy override and noclearStepsafter a path, and a copy of an any-frameframeLocator()path refuses
all three. 2.x returned nothing (void). Migration: drop avoidannotation on the result; a module compiled with
declaration: truethat returns it from an expression-bodied arrow uses a block body or: void, as for a seed
reuse.
Fixes
- Variants derived from one seed no longer share steps or a description.
- A reuse value that is neither a registered path nor a seed (
{ reuse: null }from JavaScript) throwsreuse requires a registered path or a seed from createReusable for "<path>".instead of aTypeError. - A first argument Playwright cannot take, from JavaScript (
null, a number, an object, a RegExp for a role,
locatororframeLocator), throws<method> requires a <field> value for "<path>".on every builder instead of
being stored and failing later with aTypeError, resolving to nonsense (locator('null'),getByTestId('42')) or
doing nothing. With two arguments the first is the primary, sogetByRole(null, null)is valid nowhere; a lone
nullonupdateor a seeded override is the options. - A seeded override follows
update()'s Merge Patch: anulloption key is deleted instead of stored (a stored
name: nullfailed at resolution), a lonenullclears the seed's options (2.x ignored it),(primary, null)sets
the primary and clears them, and a JavaScript(undefined, options)no longer drops the options. All of these forms
now compile, typed asupdate's. - Steps or a description can no longer reach an any-frame
frameLocator()definition, through a copy by path or a
hand-made seed object: they throw at the call instead of at the first resolution below the path. A copy or seed
without them registers asadd(path).frameLocator()does.
Internal
- The ten locator strategies are described once, in one table that locator creation, the clone, the seeded override,
updateandreplaceread; a strategy without its builder method is a compile error. - The debug-step record of the chain builder, built and never read, is removed.
- A seed from
-
#46
ab76175Thanks @DyHex! - ### Breaking changesSessionStorageis rebuilt on Playwright'spage.sessionStorageand adds only what Playwright lacks: batches, step
titles, origin checks, typed values, and seeding before the app loads.- Requires
@playwright/test1.64 or later; the peer range is now>=1.64.0 <2.0.0.page.sessionStorageneeds
1.61, the any-frameframeLocator()needs 1.63, and the fix that makes every RegExp flag deterministic across
elements (microsoft/playwright#42818) is in 1.64.0. - Values are strings, stored and read exactly as given. 2.x JSON-encoded every value, so
set({ token: "abc" })
reached the app as"abc"with quotes. A structured value is declared once per key with a codec:
new SessionStorage(page, { schema: { user: json<User>() } }), or on a page object thestoragemember of its
options type plus thesessionStorage: { schema }constructor option.json<T>()ships;Codec<T>is exported
for custom codecs. An undeclared key must be a string, at compile time and at runtime. Migration: declare a codec
for keys that held objects and drop theset<T>/get<T>generics; declarejson<string>()for string keys an
app parses as JSON (anngx-webstoragestyle layer), which keeps the quotes. set,get,clearandseedeach take a single key or a record:set("token", "abc"),get("token"),
clear(["a", "b"]),seed({ token }).get(keys)returns every requested key withnullwhen absent;get()returns the present entries. A literal
get([])orclear([])no longer compiles; a computed empty list reads nothing or removes nothing (2.x read or
cleared everything). Migration: a check forundefinedbecomes a check fornull.setOnNextNavigationis replaced byseed(entries, { origin? }). Away from the origin, it adds an init script
that stores the entries when the page's main frame first arrives at the origin, by any navigation (goto, a link,
a script, a form POST, a server redirect, a page a service worker or a mock serves), before the app's first script
runs, and removes it once that document has run it, so a reload never overwrites what the app wrote. Navigations
are never intercepted: the app sees the same request, headers and history as without a seed. It never leaves the
page the test is on, so an origin can be seeded with data learned on the previous one. Already on the origin, it
writes at once. A page that never seeds has nothing registered; two page objects seeding the same origin merge. A
seed still pending when the page closes fails the test, as does a write the browser refuses;seeditself throws
in a browser without the Navigation API and when the page commits a document on the origin while it registers.
Migration:grep -rn 'setOnNextNavigation' --include=*.ts --exclude-dir=node_modules .and rename toseed.waitForContextis removed: an operation on a page without an origin fails at once with a message naming the
fix.reloadis removed: callpage.reload().- A page object's helper operates on that page object's origin and throws, naming both origins, when the page is on
another one. A standalone helper without an origin operates on the current origin; itsseedneeds{ origin }.
New exports:
json,Codec,SessionStorageSchema,StorageTypeFromOptions.Fixes
setno longer stores strings with JSON quotes.- Seeding before the app's first load no longer loses the race against the app's first script, no longer merges and
wipes concurrent calls, and no longer leaks a listener after a failure. get([])andclear([])no longer mean "everything".- An empty string no longer reads back as
null. - No session storage operation waits without a timeout any more.
- Requires
-
#46
5d2371cThanks @DyHex! - ### Breaking changes- The query builder's
remove(subPath?)is replaced byskip(subPath)andunskip(subPath).skipleaves an
ancestor out of the chain when the query resolves and deletes nothing, sounskipbrings it back exactly as it was,
with its definition, steps and description;removedeleted all three from the query, and a laterupdate()or
replace()brought back the definition only. The terminal path cannot be skipped (a compile error, and a runtime
error from JavaScript), andskiphas no form without a sub-path.update,replace,filter,nthand
clearStepson a skipped segment throw<method>() cannot apply to "<sub>": it is skipped in this query; call unskip("<sub>") first., as do a secondskipand anunskipwithout one. Migration: replaceremove("ancestor")
withskip("ancestor"); replaceremove()followed byupdate()/replace()withupdate()/replace(), plus
clearSteps()anddescribe("")where the old deletion of steps and description was wanted. @stepdecorates only methods that return a Promise.test.stepalways returns a Promise and runs the body after
the caller's current line, so a decorated sync method returned a Promise typed as its value and its exceptions
escaped the caller'stry/catch; it is now a compile error naming"@step decorates methods that return a Promise: make the method async", with stage-3 decorators and withexperimentalDecorators. Migration: make decorated
methodsasync.PlaywrightReportLoggerkeeps the message and string arguments exactly as given: no trailing blank lines, no
re-formatting of JSON messages. Other arguments are printed asconsole.logprints them instead of
[object Object]. A message that is a JSON object or array is attached asapplication/json, anything else
("42"included) astext/plain. Attachment names use Playwright'slocaleandtimezoneIdinstead of a fixed
nb-NO: thelogfixture passes them, andattachLogsToTest(testInfo)called from a fixture of your own takes
the project'suse.localeanduse.timezoneIdfrom the config, or{ locale, timeZone }as its second argument.
With no config they read08:19:55 AM 10/15/2026 - INFO : [TestCase]. Entries are attached in call order, without
sorting. Migration: setuse: { locale: "nb-NO" }in the config for the 2.x names; a fixture of your own that
should also followtest.use()passes{ locale, timeZone: timezoneId }from its fixtures. Pass
JSON.stringify(data, null, 2)for pretty JSON or data nested deeper than two levels.- From JavaScript,
describe(null)anddescribe(undefined)throwdescribe requires a string for "<path>"; pass "" to remove the description.instead of falling back to the path, andnth(null)andnth(undefined)reach
Playwright'snth, which matches nothing, instead of being dropped, which matched every element. TypeScript rejected
all four already. Migration: callnthonly when there is an index.
Fixes
- A caller's options or filter object changed after
add(),filter()orcreateReusable, a RegExp it passed
rewritten withcompile(), or a seed's step afteradd(path, { reuse }), no longer changes the registered locator:
builders store copies, RegExps included. - A static method decorated with
@stepis titled by its class instead ofFunction, and a bare@stepon a static
method compiled withexperimentalDecoratorsis no longer left unwrapped. - An array or a
filter-only object inhas/hasNotis reported as an unsupported filter reference instead of
failing with Playwright'sInner "has" locator must belong to the same frame.message. - The duplicate-registration message shows a
Locatorin a step as Playwright prints it (locator('b')) instead of
its internals. - The sub-path error adds
It is a segment of that path, but no locator schema is registered for it.when the
sub-path is an unregistered segment of the query's path. - A page object's registry error and a never-applied
seedpoint at the consumer's line even when the consumer's file
is namedpageObject.tsorsessionStorage.ts.
Internal
- Unreachable branches in the registry and the query builder are removed;
getLocatorresolves a copy of the record
without building a query builder (about twice as fast); a nested resolution copies each segment once instead of
twice;seedandPageObjectshare one call-site helper.
- The query builder's
-
#46
4220bfaThanks @DyHex! - ### Breaking changesgetLocatorSchema(path).replace(subPath?)takes the parameter lists of Playwright's own methods: the first argument
is required and the options are Playwright's option types.replace().getByRole({ name: "Save" }),
replace().getByTestId()and the other calls without a first argument, which always threw, no longer compile, and
neither donulloptions (replace().getByRole("button", null)or{ name: null }), which meant omission.
replace().frameLocator()andreplace().getByRole("button", undefined)still compile;update()is unchanged.
From JavaScript a missing first argument throwsgetByRole requires a role value for "<path>"., the message every
other builder uses, instead ofLocator replace for "<path>" of type "role" requires a "role" value., andnull
options still mean omission. Migration: pass the first argument toreplace()methods and dropnulloptions from
them.UrlTypeOptions,PageObject's second type argument, is renamedPageObjectTypeOptions, since it also carries the
storageschema. There is no alias. Migration: rename it in imports and constraints.- A path literal containing U+FEFF (the byte-order mark) is a compile error; it always threw at registration.
Features
- New type exports, so that shared locator modules, helpers and domain base classes can name what the registry hands
out, and a project compiled withdeclaration: truecan export functions that return it:
LocatorQueryBuilder(whatgetLocatorSchema(path)and each step of its chain return),LocatorUpdateBuilder
(whatupdate()andreplace()return),ReusableLocator(a seed fromcreateReusable, thereuseoption of
add;ReusableLocator<Paths, "role">keeps the strategy,ReusableLocator<Paths>accepts any),FilterDefinition,
IndexSelector,LocatorSchemaPathFormat(the path rules as a type) andLocatorSchemaPathArgument(the path
parameter ofaddand the accessors, for a helper that forwards a path in a base class generic in its paths).
Fixes
- The query builder's internal
applyUpdateandapplyReplacement, which skip the argument checks, are no longer
reachable through its types after a chained call. - The type-level path check rejects the same whitespace as the runtime check, U+FEFF included, and the whitespace
error shows each character but the plain space as an escape (main\u00A0.form) instead of printing it invisibly.
-
#46
4682146Thanks @DyHex! - ### Breaking changesPageObjectURLs now behave exactly like Playwright'sbaseURLhandling, with one base per page object, and the
navigation helper waits the way Playwright does.gotoThisPage()is removed.goto()without a target replaces it: it navigates tofullUrland runs the
post-navigation actions unless{ runPostNavigationActions: false }.goto(target)never runs the actions.
Migration:grep -rn 'gotoThisPage(' --include=*.ts --exclude-dir=node_modules .and dropThisPage.NavigationOptions.waitForLoadStateis removed;waitUntilcovers every method. POMWright no longer defaults
waitUntilto"load"itself; an unset value means Playwright's own default. Migration: rename the option in
navOptionsand in per-call options.- A string
baseUrlmust be a non-empty origin (scheme://host[:port], optional trailing slash; no path, query,
hash, or scheme-less value such aslocalhost:9000). A stringurlPathmust be""or start with exactly one
/. Both are checked at construction and the error names the page object. goto(target)resolves relative input against the page object'sbaseUrlexactly as Playwright resolves
page.gotoagainstuse.baseURL(goto("login"),goto("?tab=1")are resolved; 2.x passed them through). On a
RegExpbaseUrlonly absolute URLs are accepted, at compile time and at runtime.- On a page object with a RegExp
baseUrlorurlPath,fullUrlis aUrlMatcherinstead of aRegExp: the base
is matched against the URL's origin and the path against the rest (pathname, query, hash), each regex as written
with its own flags. Pass it topage.waitForURL,expect(page).toHaveURL, orpage.routeas before, or use
fullUrl.test(url)instead oftoMatch. A base regex that contains a path prefix must move that prefix into
urlPath. expectThisPageandexpectAnotherPageare each onepage.waitForURLcall under the project's
use.navigationTimeout(overridable withNavigationOptions.timeout) instead of a navigation wait followed by an
unbounded exact-string retry. A failure names the page object, the expected URL or matcher, and the URL found.
expectAnotherPagewaits for the URL to change and then fails at once if it bounced back.fullUrlfor a homepage page object (urlPath"") ishttps://app.example/with the trailing slash, the form
the browser reports.
New exports:
ThisPageOptions,NavigationFor,UrlMatcher.Fixes
- A fully anchored RegExp
urlPathsuch as/^\/account\/\d+$/no longer produces afullUrlthat can never match. - A substring RegExp
baseUrlno longer needs to match the URL up to the start of the path. - RegExp flags on
baseUrlorurlPathare no longer dropped. fullUrlandgotono longer produce a double slash for abaseUrlwith a trailing slash.expectThisPageno longer retries forever whenfullUrllacks the trailing slash the browser reports, and
navigation failures name the expected and found URLs.expectAnotherPageno longer passes while still on the page.gotois no longer unavailable on a page object whoseurlPathis a RegExp.
Minor Changes
-
#46
4d9c124Thanks @DyHex! - ### FeaturesPageObjectOptions<Options>, the type of thePageObjectconstructor's options (label,navOptions,
sessionStorage,locators), andLocatorRegistryOptions, the type ofcreateRegistryWithAccessors's second
parameter and oflocators, are exported, so a domain base class forwards the options by name instead of restating
their shape. No migration.- A seeded override of any strategy may be called with no argument and keeps the seed's definition, as
update()does
(add(path, { reuse: seed }).getByRole()); onlyframeLocator()compiled before.
-
#46
0850bf1Thanks @DyHex! - ### Features- Opt-in
strictChains:createRegistryWithAccessors(page, { strictChains: true })and thePageObjectconstructor
optionlocators: { strictChains: true }makeverify()require every ancestor of every registered path to be
registered, and name every one that is not, one line per path:
"main.form.button.save": strictChains requires every ancestor to be registered; "main.form" and "main.form.button" are not.A page object checks it right afterdefineLocators(); a standalone registry when it callsverify().
The option is a boolean,falseby default; without it nothing changes, and an unregistered segment stays a name
that groups paths and is left out of the chain.skipandunskipwork in both modes; under the
option an any-frameframeLocator()is a root path. No migration.
- Opt-in
Patch Changes
-
#46
17f566dThanks @DyHex! - ### Documentation- Every export and every public member now has a doc comment, so the editor's hover is a reference, as Playwright's
own is: a summary, each parameter (with the options ofPageObject's constructor and ofSessionStorageone by
one), the return value, the errors thrown with their messages, an example, and a link to its page in the API reference.navigation.goto,
expectThisPageandexpectAnotherPageare documented on the type a page object'snavigationhas, andfilter,
nthanddescribeafter a locator method on the type a registration chain has, so the hover shows them where
you write them.
- Every export and every public member now has a doc comment, so the editor's hover is a reference, as Playwright's
-
#46
801e4acThanks @DyHex! - ### Fixes- The steps of the navigation helper (
LoginPage: Navigate to this Page,LoginPage: Expect this Page, …) and of
SessionStorage(Auth.SessionStorage.set:, …) are reported at the line that called them, in the HTML report and
the trace, as@steprows are: they are boxed steps now. They showed a line in POMWright's bundle, and the session
storage steps no location at all. A failure inside them was, and is, reported at the test's line.
- The steps of the navigation helper (
-
#46
4d9c124Thanks @DyHex! - ### Fixes- A string
urlPathis compared in the form the browser reports it, asfullUrlis and as Playwright's
toHaveURL(string)compares: for a path such as/søk,/a bor/x?q=a b,expectThisPagetimed out and
expectAnotherPagepassed while the browser was on the page. - A
baseUrlorurlPaththat is neither a string nor a RegExp throws at construction
(LoginPage: baseUrl must be a string or a RegExp; received undefined.) instead of building a page object that never
matched its page, passedexpectAnotherPageand gave its session storage no origin. Migration: a page object built
from an unset environment variable now fails at construction; set the variable. - A hand-made seed object passed to
add(path, { reuse })is checked as every builder checks its first argument
(reuse requires a selector value for "<path>".,reuse requires a non-empty selector for "<path>".) instead of
registering an empty or missing value that failed at the first action. replace(sub).frameLocator()throws at the call on a segment withfilterornthsteps in the query (call
clearSteps(sub)first) and on the query's own path, which the any-frame form cannot resolve to, instead of failing
at resolution.filterandnthon an any-frame segment in a query give the same message as onadd.- A path that is not a string, from JavaScript, throws
LocatorSchemaPath must be a string; received 42.instead of
aTypeError. - The duplicate-registration message prints a RegExp used twice in each place instead of
"[Circular]", and is
headedExisting and attempted schemas:.
- A string