Skip to content

Commit 323af23

Browse files
authored
Merge pull request #19 from CloudCannon/feat/port-placeholder
Add `toolproof_test_port` default placeholder
2 parents 80a9649 + 5648460 commit 323af23

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
## Unreleased
1111

12+
* Added a `toolproof_test_port` default placeholder.
13+
1214
## v0.11.2 (March 20, 2025)
1315

1416
* If the `I click {text}` action finds multiple options, but only one is an exact match, it will now click it rather than error.

docs/content/docs/_index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ steps:
173173

174174
Toolproof provides some placeholders by default:
175175

176-
| placeholder | value |
177-
| --------------------------- | ----------------------------------------------------------- |
178-
| toolproof_process_directory | The working directory that you ran the Toolproof command in |
179-
| toolproof_test_directory | The temporary directory that the current test is running in |
176+
| placeholder | value |
177+
| --------------------------- | ---------------------------------------------------------------- |
178+
| toolproof_process_directory | The working directory that you ran the Toolproof command in |
179+
| toolproof_test_directory | The temporary directory that the current test is running in |
180+
| toolproof_test_port | If serving files, the port that Toolproof is using for this test |

toolproof/src/segments.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ impl<'a> SegmentArgs<'a> {
165165
tmp_dir.path().to_string_lossy().into_owned(),
166166
);
167167
}
168+
169+
if let Some(assigned_server_port) = &civ.assigned_server_port {
170+
placeholders.insert(
171+
"toolproof_test_port".to_string(),
172+
assigned_server_port.to_string(),
173+
);
174+
}
168175
}
169176

170177
if let Some(transient_placeholders) = transient_placeholders {

0 commit comments

Comments
 (0)