- Notifications
You must be signed in to change notification settings - Fork1.1k
Commit782a105
authored
test: use toHaveValue() to avoid flaky parameter verification (#20990)
## ProblemThe test `create workspace with default and required parameters` wasflaky because `verifyParameters` in `site/e2e/helpers.ts` didn't waitfor input values to be populated before asserting.After PR#20710 removed classic parameters, the form now uses dynamicparameters loaded asynchronously via WebSocket. The input field can bevisible before its value is populated.Closescoder/internal#1154## FixReplace immediate read + assertion:```typescriptconst value = await parameterField.inputValue();expect(value).toEqual(buildParameter.value);```With Playwright's auto-retrying assertion:```typescriptawait expect(parameterField).toHaveValue(buildParameter.value);```From [Playwright docs for`inputValue()`](https://playwright.dev/docs/api/class-locator#locator-input-value):> **NOTE** If you need to assert input value, prefer`expect(locator).toHaveValue(value[, options])` to avoid flakiness. Seeassertions guide for more details.---This PR was fully generated by [mux](https://github.com/coder/mux), andreviewed by a human.1 parent7d45d07 commit782a105
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | | - | |
| 210 | + | |
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
| |||
0 commit comments
Comments
(0)