Skip to content

Commit 55800e4

Browse files
Merge branch 'main' into tab-closing
merge main
2 parents bbd8289 + 021c946 commit 55800e4

17 files changed

+599
-35
lines changed

.changeset/daffy-rapid-turaco.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/masterful-amiable-leopard.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/sceptical-mutant-shrew.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/woodoo-frog-of-growth.md renamed to .changeset/silkworm-of-regular-downpour.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"stagehand": patch
33
---
44

5-
fix logging param name
5+
added regression tests

.github/workflows/feature-parity.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
owner: context.repo.owner,
4848
repo: context.repo.repo,
4949
issue_number: context.issue.number,
50-
body: `❌ **Parity Label Removed**\n\n@${context.actor}, you do not have sufficient permissions to add the 'parity' label. Only users with write access can trigger feature parity issues.\n\nIf you believe this feature should be implemented in the Python SDK, please ask a maintainer to add the label.`
50+
body: `❌ **Parity Label Removed**\n\n@${context.actor}, you do not have sufficient permissions to add the 'parity' label. Only users with write access can trigger feature parity issues.\n\nIf you believe this feature should be implemented in the Typescript SDK, please ask a maintainer to add the label.`
5151
});
5252
5353
throw new Error(`User ${context.actor} does not have write access to add parity label`);
@@ -62,7 +62,7 @@ jobs:
6262
app-id: ${{ secrets.PARITY_APP_ID }}
6363
private-key: ${{ secrets.PARITY_APP_PRIVATE_KEY }}
6464
owner: browserbase
65-
repositories: stagehand
65+
repositories: stagehand-python
6666

6767
- name: Create issue in Python SDK repository
6868
uses: actions/github-script@v7
@@ -104,7 +104,7 @@ jobs:
104104
const issueTitle = `[Feature Parity] ${pullRequest.title}`;
105105
const issueBody = `## Feature Parity Request
106106
107-
This issue was automatically created from a pull request in the TypeScript Stagehand repository that was labeled with 'parity'.
107+
This issue was automatically created from a pull request in the Python Stagehand repository that was labeled with 'parity'.
108108
109109
### Original PR Details
110110
- **PR**: #${context.issue.number} - ${pullRequest.title}
@@ -120,12 +120,12 @@ jobs:
120120
${commentsSection}
121121
122122
### Action Required
123-
Please review the changes in the original PR and implement equivalent functionality in the Python SDK if applicable.
123+
Please review the changes in the original PR and implement equivalent functionality in the Typescript SDK if applicable.
124124
125125
---
126126
*This issue was automatically generated by the Feature Parity workflow.*`;
127127
128-
// Create the issue in the Python repository
128+
// Create the issue in the Typescript repository
129129
const { data: issue } = await github.rest.issues.create({
130130
owner: 'browserbase',
131131
repo: 'stagehand',
@@ -141,5 +141,5 @@ jobs:
141141
owner: context.repo.owner,
142142
repo: context.repo.repo,
143143
issue_number: context.issue.number,
144-
body: `🔄 **Feature Parity Issue Created**\n\nAn issue has been automatically created in the Python SDK repository to track parity implementation:\n${issue.html_url}`
144+
body: `🔄 **Feature Parity Issue Created**\n\nAn issue has been automatically created in the Typescript SDK repository to track parity implementation:\n${issue.html_url}`
145145
});

.github/workflows/test.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,66 @@ jobs:
180180
name: smoke-test-results
181181
path: junit-smoke.xml
182182

183+
test-regression:
184+
name: Regression Tests
185+
runs-on: ubuntu-latest
186+
needs: test-unit
187+
if: |
188+
contains(github.event.pull_request.labels.*.name, 'test-regression') ||
189+
contains(github.event.pull_request.labels.*.name, 'regression')
190+
191+
steps:
192+
- uses: actions/checkout@v4
193+
194+
- name: Set up Python 3.11
195+
uses: actions/setup-python@v4
196+
with:
197+
python-version: "3.11"
198+
199+
- name: Install system dependencies
200+
run: |
201+
sudo apt-get update
202+
sudo apt-get install -y xvfb
203+
204+
- name: Install dependencies
205+
run: |
206+
python -m pip install --upgrade pip
207+
pip install -e ".[dev]"
208+
pip install jsonschema
209+
playwright install chromium
210+
playwright install-deps chromium
211+
212+
- name: Run regression tests
213+
run: |
214+
xvfb-run -a pytest tests/ -v \
215+
--cov=stagehand \
216+
--cov-report=xml \
217+
--junit-xml=junit-regression.xml \
218+
-m "regression" \
219+
--tb=short \
220+
--maxfail=10
221+
env:
222+
BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY || 'mock-api-key' }}
223+
BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID || 'mock-project-id' }}
224+
MODEL_API_KEY: ${{ secrets.MODEL_API_KEY || 'mock-model-key' }}
225+
STAGEHAND_API_URL: ${{ secrets.STAGEHAND_API_URL || 'http://localhost:3000' }}
226+
227+
- name: Upload regression test results
228+
uses: actions/upload-artifact@v4
229+
if: always()
230+
with:
231+
name: regression-test-results
232+
path: junit-regression.xml
233+
234+
- name: Upload coverage data
235+
uses: actions/upload-artifact@v4
236+
if: always()
237+
with:
238+
name: coverage-data-regression
239+
path: |
240+
.coverage
241+
coverage.xml
242+
183243
test-e2e:
184244
name: End-to-End Tests
185245
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Stagehand Python Changelog
22

3+
## 0.5.0
4+
5+
### Minor Changes
6+
[#167](https://github.com/browserbase/stagehand-python/pull/167) [`76669f0`](https://github.com/browserbase/stagehand-python/commit/76669f0) Thanks @miguelg719! - Enable access to iframes on api
7+
8+
### Patch Changes
9+
10+
[#168](https://github.com/browserbase/stagehand-python/pull/168) [`a7d8c5e`](https://github.com/browserbase/stagehand-python/commit/a7d8c5e) Thanks @miguelg719! - Patch issue with passing a created session_id to init on api mode
11+
[#155](https://github.com/browserbase/stagehand-python/pull/155) [`8d55709`](https://github.com/browserbase/stagehand-python/commit/8d55709) Thanks @Zach10za! - Fix error in press_key act util function
12+
[#158](https://github.com/browserbase/stagehand-python/pull/158) [`426df10`](https://github.com/browserbase/stagehand-python/commit/426df10) Thanks @miguelg719! - Fix parsing schema for extract with no arguments (full page extract)
13+
[#166](https://github.com/browserbase/stagehand-python/pull/166) [`15fd40b`](https://github.com/browserbase/stagehand-python/commit/15fd40b) Thanks @filip-michalsky! - fix logging param name
14+
[#159](https://github.com/browserbase/stagehand-python/pull/159) [`cd3dc7f`](https://github.com/browserbase/stagehand-python/commit/cd3dc7f) Thanks @tkattkat! - Add support for claude 4 sonnet in agent & remove all images but the last two from anthropic cua client
15+
316
## 0.4.1
417

518
### Patch Changes

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "stagehand"
7-
version = "0.4.1"
7+
version = "0.5.0"
88
description = "Python SDK for Stagehand"
99
readme = "README.md"
1010
classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent",]

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ markers =
1212
local: marks tests as local integration tests
1313
api: marks tests as API integration tests
1414
e2e: marks tests as end-to-end tests
15+
regression: marks tests as regression tests
1516

1617
log_cli = true
1718
log_cli_level = INFO

stagehand/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ async def _create_session(self):
3030
"modelName": self.model_name,
3131
"verbose": 2 if self.verbose == 3 else self.verbose,
3232
"domSettleTimeoutMs": self.dom_settle_timeout_ms,
33+
"browserbaseSessionID": self.session_id,
3334
"browserbaseSessionCreateParams": (
3435
browserbase_session_create_params
3536
if browserbase_session_create_params

0 commit comments

Comments
 (0)