Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update language versions * Fix link to Readme on hex.pm * Update keyboard.ex w/ placeholders * Update coverage.ex w/ placeholders * Update download.ex w/ placeholders * Update coverage.ex w/ placeholders * Update file_chooser.ex w/ placeholders * Update mouse.ex w/ placeholders * Update touchscreen.ex w/ placeholders * Update video.ex w/ placeholders * Update keyboard.ex w/ placeholders * Update mouse.ex w/ placeholders * Update api_request.ex w/ placeholders * Update api_request_context.ex w/ placeholders * Update api_request_context.ex w/ placeholders * Update api_request_context.ex w/ * Update api_response.ex w/ placeholders * Update browser.ex w/ placeholders * Update browser_context.ex w/ placeholders * Update console_message.ex w/ placeholders * Update dialog.ex w/ placeholders * Update element_handle.ex w/ placeholders * Update frame.ex w/ placeholders * Update fetch_request.ex (comment: "obsolete?") * Update js_handle.ex w/ placeholders * Update local_utils.ex (obsolete?) * Update locator.ex w/ placeholders * [Fixed] `Logger.warn` -> `Logger.warning` * Update page.ex w/ placeholders * Update request.ex w/ placeholders * Update response.ex w/ placeholders * Update route.ex w/ placeholders * Update selectors.ex w/ placeholders * Add frame_locator.ex w/ placeholders * Update tracing.ex w/ placeholders * Updagte websocket.ex w/ placeholders * Update worker.ex w/ placeholders * [Changed] start w/ playwright-core at v1.18.1 * [Changed] bump playwright-core to v1.19.0 * [Changed] bump playwright-core to v1.20.0 * [Changed] bump playwright-core to v1.21.0 * [Changed] bump playwright-core to v1.22.0 * [Changed] bump playwright-core to v1.23.0 * [Changed] bump playwright-core to v1.24.0 * [Changed] bump playwright-core to v1.25.0 * [Changed] bump playwright-core to v1.26.0 * [Changed] bump playwright-core to v1.27.0 * [Changed] bump playwright-core to v1.28.0 * [Changed] bump playwright-core to v1.29.0 * [Changed] bump playwright-core to v1.30.0 * [Changed] bump playwright-core to v1.31.0 This version bump includes non-trivial changes to how custom route handling is implemented. * [Changed] bump playwright-core to v1.32.0 * [Changed] bump playwright-core to v1.33.0 * [Changed] API/SDK rebuild (2/n) Rehomed `Playwright.ChannelOwner` into `Playwright.SDK`. * [Changed] API/SDK rebuild (3/n) Rehomed `Playwright.Channel` into `Playwright.SDK`. * [Changed] API/SDK rebuild (3/n) Rehomed `Playwright.CLI` into `Playwright.SDK`. * [Changed] API/SDK rebuild (4/n) Rehomed `Playwright.Config` into `Playwright.SDK`. * [Changed] API/SDK rebuild (5/n) Rehomed `Playwright.Transport` into `Playwright.SDK`. * [Changed] API/SDK rebuild (6/n) Rehomed `Playwright.Channel.*` into `Playwright.SDK`. * [Changed] API/SDK rebuild (7/n) Rehomed `Playwright.Extra.*` into `Playwright.SDK`. * [Changed] API/SDK rebuild (8/n) Rehomed `Playwright.Helpers.*` into `Playwright.SDK`. * [Changed] API/SDK rebuild (9/n) Rehomed `test/unit` as `test/sdk`. * [Fixed] file rename to avoid warning * [Fixed] Update Elixir packages * [Changed] Upgrade NodeJS and NPM packages * [Changed] Lay groundwork for driver.js improvements - Switch to pinning to specific versions of playwright and electron node packages. We should be matching. - Simplify the asset packaging approach. Starting at v1.38 of Playwright (proper), using `esbuild` got much harder, and the benefits seem less evident. So, we're now doing a basic `cp` of what's needed. - Bump playwright_assets to latest, in preparation for what's to come. - Switch to `driver.js`, replacing `playwright_cli.js`; it feels nicer and matches the Elixir module naming. * [Changed] Bump playwright dep to v1.38.0 This change is primarily to prove out the rest of what was needed in order to make this version bump to playwright.js; a follow-on will bump up to the latest. * [Fixed] Rename: `unit_test.ex{s,}` It turns out the module fails to load if saved as a script. * [Changed] Hygiene: clean up `alias` usage * [Fix] Update transport implementation to match Server API These changes bring playwright-elixir's integration with playwright server up to date with playwright-core v1.38.0, which appears to have had a number of breaking changes (for our SDK). Of note: - Update WebSocket transport to send browser type as a header, per recent Playwright Server API changes. - Implement `Playwright.connect`, for WebSocket transport sessions. - Update `ws://...` endpoint to match Playwright Server changes - Clarify options for `Playwright.connect` vs. `Playwright.launch` - Add debug handling of a potential serialization bug. Note that this may have occurred as a side effect of other Playwright Server integration issues that have been fixed. * [Changed] Bump playwright-core to v1.44.0 Yet again, this upgrade changes how the Playwright CLI/program is execute. So, this change also includes a more static defintion of `driver.js`; one that will probably need to be reworked periodically. * [Fixed] Resolves a number of test issues Some of which stem from internal changes, some from changes to playwright-core. * [Fixed] Mark `Page.Accessibility.snapshot/2` as `@deprecated` According to Playwright.dev, accessibility testing should be executed with separate, spacialized libraries. The Playwright implementation is deprecated. This change also removes a failing test, in keeping with the matching removal from Playwright proper. It appears that the browser behavior was considered to be too inconsistent. * [Changed] Bump package version to v1.44.0-alpha.1 Also, clean up locked deps. * [Changed] Roll back playwright-core to v1.33.0 - Major changes to how playwright-core is vendored will come with the next version bump. - Restore `esbuild` approach to `mix assets.build`. - Fix a number of quirks stemming from rebase mistakes. * check: v1.34.0 w/ :skip of console * check: v1.35.0 w/ :skip of route * check: v1.36.0 - no change * check: v1.37.0 - no change * check: v1.38.0 - major changes to assets.build * check: v1.38.0 - fixes for build & install changes * check: v1.39.0 - no change * check: v1.40.0 w/ :skip of `Locator.set_input_files` * check: v1.41.0 - no change * check: v1.42.0 - BIG (temp?) changes Fundamental changes within playwright-core are proving difficult to match for the driver and browser installation tooling. While undesireable, for the timebeing, the entire nodejs package tree is being vendored into `priv/static`. The aim is to continue making progress toward upgrading to the latest playwright-core. Once that's done, we're revisit the vendoring approach. This change also removes Electron from the package, as it is massive and not currently covered, exercised, or supported. * check: v1.43.0 - no change * check: v1.44.0 - no change * Implement basic versions of Page.Keyboard What changed? ============= We implement a basic version of `Page.Keyboard` functions whose specs were commented out in the module. The test cases are the simplest versions I could come up with (having borrowed heavily from [Python's keyboard tests]) The implementation also follows [Python's implementations]. [Python's keyboard tests]: https://github.com/microsoft/playwright-python/blob/2402e1283de6049cb66ea8ec6f303ba681890d2a/tests/async/test_keyboard.py#L1 [Python's implementations]: https://github.com/microsoft/playwright-python/blob/2402e1283de6049cb66ea8ec6f303ba681890d2a/playwright/_impl/_input.py#L25-L38 Noteworthy Highlights ---------------------- 1. Our implementation takes a `%Page{}` struct rather than what the specs suggested (a `Keyboard.t()`). I don't know if it's possible to pass down a narrower type, but as far as I could tell `Page` had both the `session` and `guid` (which are needed for the `Channel.post` call). 2. We namespace `Playwright.Keyboard` under `Page` (i.e. `Playwright.Page.Keyboard`) to match the directory structure and since that seems to match the Playwright documentation as well. 3. Finally, we add a new `test/assets/` directory where we include a new `inputs/keyboard.html` page. That page is [copied directly from Python][keyboard.html], so it follows Python's style of testing. In particular, our tests needed the `getResult()` function to get the values back for our test assertions. [keyboard.html]: https://github.com/microsoft/playwright-python/blob/2402e1283de6049cb66ea8ec6f303ba681890d2a/tests/assets/input/keyboard.html#L1 * Adjust `Keyboard` to `use ...ChannelOwner` * Tidy: alpha-sort & group functions * Tidy/fix: Remove `keyboard.html` test asset A reasonable idea, but unnecessary: The [`playwright-assets`](https://github.com/mechanical-orchard/playwright-assets) dependency provides all of the test assets. Indeed, the `keyboard.html` file that was being utilized in the new keyboard tests is that from the `playwright-assets` server, and not this (removed) file in `test/assets`. * Fix: Remove `npm install` from CI build For the time being, Node packages are installed directly into `priv/static`, and utilized from there. This is not the desired long-term solution, but is what is needed for the moment. * Fix: Add browser install step to CI * Fix: `mix playwright.install` also installs deps * Fix: bump test timeouts: 200ms -> 500ms 200ms allows for some flakiness. Most things will still finish faster. If the event doesn't happen in 500ms, that's probably interesting, finally. * SDK: add `ChannelOwner.post!/3` A long-overdue helper. This implementation also introduces a new pattern for return values in `ChannelOwner` implementations: for calls that have simple, "success" results, we will start returning "self" (the owner), instead of `:ok`. The change is in support of better pipelining. * Tidy: alpha-sort Keyboard tests * Remove proof-of-concept implementations - Remove proof-of-concept implementations in `lib/playwright/api/...`. We've decided to abanon the approach. - Related: restore top-level, exemplar `PlaywrightTest`. * Fix `BrowserType.connect/2` to provide correction options to `WebSocket.setup/1`. * API: fix specs for `Keyboard` * Minor cleanup of docs and advertised version * Docs: improve structure * Restructure: move API tests into test/api * Fix: resolve changes in v1.34.0 affecting `Page.on("console")` A couple changes of note: 1. An `updateSubscription` message needs to be sent to indicate interest in the event. 2. Event binding has moved to `BrowserContext`. * Fix: ensure that `BrowserContext.close/1` is idempotent * Fix: remove `chromium` from default `ws_endpoint` * Fix: correct the message method for `Locator.set_input_files` **NOTE:** Of `payloads`, `local_paths`, and `streams` playwright-core capabilities, only `local_paths` is currently supported by playwright-elixir. * Fix: add lingering changes related to console/route fixes * Fix make `Page.close` idempotent * Fix: `Browser.close` should be idempotent And some stragglers. * API: add start of `@moduledoc` for `Keyboard` * Fix: update repo/license with correct org * v1.44.0-alpha.2 * Update getting-started.md followup mechanical-orchard@42aa38f Playwright.launch/2 returns tuple. * Fix: `Playwright.launch/2` returns an ok tuple Inspired by the PR from kimihito, refrences to the return value and arity for `Playwright.launch/2` are now correct. * Fix: make `Locator.wait_for` timeout safe Previously, failures due to the timeout being reached were treated as unknown, unexpected errors. In such cases, `Channel.recv/2` would `raise`. With this change, we can now match on `%Error{type: "TimeoutError"}`, which avoids the `raise` and improves the API. Note that the change also includes a small "hack": an attempt to ensure that the related `GenServer` timeout does not occur before the Playwright server timeout. Fixes [issue mechanical-orchard#55](mechanical-orchard#55). * v1.44.0-alpha.3 * Doc: use `@doc deprecated` for `Accessibility.snapshot/2` Where as `@deprecated` issues a warning during runtime, which is annoying (in particular, when developing playwright-elixir), the `@doc` form will mark the function as deprecated in the documentation, without the annoyance. * Fix: switch to latest GitHub Action for BEAM * Add: `Locator.all/1` Relatedly, refactor `Locator.count/1`, used by `all/1`, to make use of the new `Frame.query_count/2`. Also, extract some `Locator` module docs which will soon find their way into guides. * Doc: improve module/test docs for some `Locator` functions * Add `Page.expose_binding/4` and `.expose_function/3` * Add `Locator.blur/2` * Add `Locator.clear/2` * Add `Locator.drag_to/3` ...which in turn drives out the implementation of: - `Frame.drag_and_drop/4` - `Page.drag_and_drop/4` * Increase the error-handling timeout adjustment This attempts to ensure the browser server has time to timeout and communicate that timeout to our GenServer, before the GenServer call times out Co-authored-by: German Velasco <[email protected]> Co-authored-by: Corey Innis <[email protected]> * Ignore Jetbrains config files Co-authored-by: Corey Innis <[email protected]> Co-authored-by: Ryan Spore <[email protected]> * Doc: deprecation notices and whitespace cleanup * Adds Page, Frame, and Locator get_by_text/3 functions * Make `Locator.get_by_text_selector/2` private Also, the `options` argument is always provided. * Make `Locator.get_by_text_selector/2` public It's also used by `Frame`. * Adds Releasing guide to README * Adds function docs for get_by_text Also clarifies types for get_by_text options map, marks get_by_text_selector as public-but-internal, and adds a commented out function head for get_by_text to accept a regex as a reminder. Co-authored-by: German Velasco <[email protected]> * Bump to 1.44.0-alpha.4 Co-authored-by: Ryan Spore <[email protected]> * Fixes Locator.wait_for support for waiting for hidden state elements * Fix typo * Add test for `.content` * Add support for `.content` to Page and Frame * Update spec * Add test showing user agent can be set * Show other ways of setting userAgent * Document setting user agent * Update README with release/version notes --------- Co-authored-by: Corey Innis <[email protected]> Co-authored-by: Steven Nunez <[email protected]> Co-authored-by: German Velasco <[email protected]> Co-authored-by: kimihito <[email protected]> Co-authored-by: Ryan Spore <[email protected]> Co-authored-by: German Velasco <[email protected]> Co-authored-by: Martin Feckie <[email protected]>
- Loading branch information