ccqa 1.40.6 → 1.40.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/ccqa.mjs +10 -4
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/bin/ccqa.mjs
CHANGED
|
@@ -15289,12 +15289,18 @@ function assertToLine(action, locator) {
|
|
|
15289
15289
|
return assertLine ?? comment;
|
|
15290
15290
|
}
|
|
15291
15291
|
/**
|
|
15292
|
-
* `url_contains` →
|
|
15293
|
-
*
|
|
15294
|
-
*
|
|
15292
|
+
* `url_contains` → "the URL contains this".
|
|
15293
|
+
*
|
|
15294
|
+
* A `${VAR}` only has a value at run time, which rules out both forms that take
|
|
15295
|
+
* the pattern up front: a regular expression would have to match the reference
|
|
15296
|
+
* span with `.*` (so `${APP_BASE_URL}` alone would assert nothing at all), and
|
|
15297
|
+
* the glob `toHaveURL` accepts is compared against the whole URL, so an
|
|
15298
|
+
* absolute one never matches. Polling `page.url()` keeps the substring
|
|
15299
|
+
* semantic and the resolved value.
|
|
15295
15300
|
*/
|
|
15296
15301
|
function urlContainsAssert(value) {
|
|
15297
|
-
|
|
15302
|
+
const expr = jExpr(value);
|
|
15303
|
+
if (expr.startsWith("`")) return `await expect.poll(() => page.url()).toContain(${expr});`;
|
|
15298
15304
|
return `await expect(page).toHaveURL(new RegExp(${j(escapeRegExp(value))}));`;
|
|
15299
15305
|
}
|
|
15300
15306
|
function escapeRegExp(s) {
|
package/dist/package.json
CHANGED