Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] Wrap StagehandPage and StagehandContext #319

Merged
merged 14 commits into from
Dec 20, 2024
Merged

Conversation

kamath
Copy link
Contributor

@kamath kamath commented Dec 18, 2024

why

We want Stagehand to provide a better Playwright experience, so when the user runs stagehand.page we can return a playwright Page wrapper as StagehandPage

what changed

  • Rewrite examples/example.ts to just be a scratchpad. Good Stagehand code can be found with npx create-browser-app
  • Wrap stagehand.page in a StagehandPage object
  • Wrap stagehand.context in a StagehandContext object
  • Add end-to-end (e2e) Playwright tests in evals/deterministic that test Playwright + Browserbase SDK. Added to CI as well before AI evals

test plan

  • Made a deterministic e2e test that can be run with npm run e2e. This just runs Playwright tests using Stagehand

Copy link

changeset-bot bot commented Dec 18, 2024

🦋 Changeset detected

Latest commit: e4430aa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@browserbasehq/stagehand Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kamath kamath changed the title Anirudh/wrap-page Wrap StagehandPage and StagehandContext Dec 20, 2024
@kamath kamath changed the title Wrap StagehandPage and StagehandContext [2.0] Wrap StagehandPage and StagehandContext Dec 20, 2024
@kamath kamath marked this pull request as ready for review December 20, 2024 00:06
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fire

@kamath kamath merged commit bacbe60 into main Dec 20, 2024
3 checks passed
@kamath kamath deleted the anirudh/wrap-page branch December 20, 2024 04:36
@github-actions github-actions bot mentioned this pull request Dec 20, 2024
kamath added a commit that referenced this pull request Jan 3, 2025
Set stagehand env to "LOCAL" if we default to "LOCAL" (#320)

* bug fix: set this.env to LOCAL if BROWSERBASE_API_KEY is not defined

* changeset

[2.0] Wrap StagehandPage and StagehandContext (#319)

* [feat]: start to wrap page

* ignore pnpm lock

* wrap

* temp

* rewrite example

* sample playwright

* working with context

* e2e pass context

* rm example

* uploads/downloads e2e

* ci e2e

* CI env

* changeset

* cleanup context test

update extract_capacitor_info eval (#323)

* use new site

* prettier

Only startDomDebug if it's enabled (#325)

* Only startDomDebug if it's enabled

* changeset

---------

rebase

Version Packages (#321)

Reduce eval spend (#337)

Remove duplicate logging and export page/context types (#344)

Throw custom error if context is referenced without initialization (#353)

* Throw error if context is referenced without initialization. Also remove act/extract handlers from lib/index

* changeset

fix(logger): enable disabling logger (#355)

[fix]: Fix -types exposed to the client to match the expected contract (#358)

Remove Stagehand Nav (#360)

* Remove Stagehand Nav

* changeset

Co-Authored-By: Anirudh Kamath <[email protected]>
Co-Authored-By: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants