|
8 | 8 | ) |
9 | 9 |
|
10 | 10 | const ( |
11 | | - playwrightNodeImage = "mcr.microsoft.com/playwright:v1.52.0-noble" |
12 | | - playwrightPythonImage = "mcr.microsoft.com/playwright/python:v1.52.0-noble" |
| 11 | + playwrightVersion = "1.52.0" |
| 12 | + playwrightNodeImage = "mcr.microsoft.com/playwright:v" + playwrightVersion + "-noble" |
| 13 | + playwrightPythonImage = "mcr.microsoft.com/playwright/python:v" + playwrightVersion + "-noble" |
13 | 14 | ) |
14 | 15 |
|
15 | 16 | // BrowserRunConnector wraps user Playwright scripts with boilerplate and |
@@ -110,18 +111,18 @@ func (c *BrowserRunConnector) Execute(ctx context.Context, params map[string]any |
110 | 111 | // The official Playwright Docker image ships browsers and system deps but |
111 | 112 | // NOT the npm package. Install it (pinned to match the image version) then |
112 | 113 | // run the wrapper from stdin. |
113 | | - containerCmd = []string{"sh", "-c", "npm install --no-save --silent playwright 2>/dev/null && node"} |
| 114 | + containerCmd = []string{"sh", "-c", "npm install --no-save --silent playwright@" + playwrightVersion + " 2>/dev/null && node"} |
114 | 115 | case "typescript": |
115 | 116 | containerImage = playwrightNodeImage |
116 | 117 | wrapperScript = buildJSWrapper(script) |
117 | 118 | // Same as JS but with TypeScript type-stripping enabled. |
118 | | - containerCmd = []string{"sh", "-c", "npm install --no-save --silent playwright 2>/dev/null && node --experimental-strip-types"} |
| 119 | + containerCmd = []string{"sh", "-c", "npm install --no-save --silent playwright@" + playwrightVersion + " 2>/dev/null && node --experimental-strip-types"} |
119 | 120 | case "python": |
120 | 121 | containerImage = playwrightPythonImage |
121 | 122 | wrapperScript = buildPythonWrapper(script) |
122 | 123 | // The official Playwright Python image ships browsers and system deps but |
123 | | - // NOT the pip package. Install it then run the wrapper from stdin. |
124 | | - containerCmd = []string{"sh", "-c", "pip install --quiet playwright 2>/dev/null && python3 -"} |
| 124 | + // NOT the pip package. Pin to match the image version. |
| 125 | + containerCmd = []string{"sh", "-c", "pip install --quiet playwright==" + playwrightVersion + " 2>/dev/null && python3 -"} |
125 | 126 | } |
126 | 127 |
|
127 | 128 | // --- build docker/run params --- |
|
0 commit comments