tewip-ai 0.17.1 → 0.17.2

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.
@@ -82,4 +82,4 @@ export function hasAssertionAfter(source, line) {
82
82
  * fixed-wait removals were refused as "nothing is asserted after the wait" when the very next line
83
83
  * was an assertion, which is how this was found. Python's bare `assert` counts for the same reason.
84
84
  */
85
- const ASSERTION = /\bexpect\s*\(|\.should\s*\(|\bassert\s+|\bassertThat\s*\(/;
85
+ const ASSERTION = /\bexpect\s*\(|\.should\s*\(|\bassert\s*[.(]|\bassert\s+|\bassertThat\s*\(/;
@@ -19,6 +19,10 @@
19
19
  // else Tewip must name something to wait for, or refuse.
20
20
  /** A step that waits by itself, so a fixed wait in front of it only adds time. */
21
21
  export function nextStepRetries(line, framework) {
22
+ // A step that is itself a wait needs no framework behind it: `await waitFor(() => ready)` blocks
23
+ // until the condition holds, so a fixed sleep in front of it is pure delay whatever the stack.
24
+ if (SELF_WAITING.test(line))
25
+ return true;
22
26
  if (framework === 'cypress') {
23
27
  // Every cy.* query retries until it resolves, except cy.wait itself.
24
28
  return /\bcy\.(?!wait\b)\w+\s*\(/.test(line);
@@ -38,7 +42,7 @@ export function nextStepRetries(line, framework) {
38
42
  // An action on a locator waits for that element to be actionable first.
39
43
  return ACTION_ON_LOCATOR.test(line);
40
44
  }
41
- const SELF_WAITING = /\.\s*waitFor(?:Selector|URL|LoadState|Function|Event|Response|Request|Navigation)?\s*\(|\.\s*goto\s*\(/;
45
+ const SELF_WAITING = /\.\s*waitFor(?:Selector|URL|LoadState|Function|Event|Response|Request|Navigation)?\s*\(|\.\s*goto\s*\(|\b(?:waitFor|waitUntil|wait_for|waitForCondition|until)\w*\s*\(/;
42
46
  const LOCATOR_EXPRESSION = /(?:page|frame|component|[\w$]+)\s*\.\s*(?:getBy\w+|locator|frameLocator)\s*\(|^\s*[\w$]+\s*$/;
43
47
  const ACTION_ON_LOCATOR = /(?:getBy\w+\([^;]*?\)|locator\([^;]*?\))(?:\s*\.\s*\w+\([^;]*?\))*?\s*\.\s*(?:click|fill|press|check|uncheck|selectOption|hover|type|tap|dragTo|setInputFiles|focus)\s*\(/;
44
48
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tewip-ai",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "description": "Tewip finds why each failing test failed - real bug, flaky test, environment, test data or changed selector - for any stack, from the command line, CI, or your editor.",
5
5
  "keywords": [
6
6
  "test-failures",