Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
Maybe fix issue with cy.waitForFieldValue which didn't handle integ…
Browse files Browse the repository at this point in the history
…er fields, only strings

#153
  • Loading branch information
TheBestPessimist committed Jul 29, 2019
1 parent 1ddec14 commit 5d06b1e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cypress/support/commands/general.js
Expand Up @@ -418,7 +418,11 @@ Cypress.Commands.add('waitForFieldValue', (alias, fieldName, expectedFieldValue,
return;
}

if (actualFieldValue !== expectedFieldValue) {
/**
* Here i'm using `!=` and not `!==` so that '222' == 222 (a string is equals to a number with the same value)
* We need this for cases such as `cy.writeIntoStringField('QtyEntered', 222, true);`
*/
if (actualFieldValue != expectedFieldValue) {
cy.log(
`5 waitForFieldValue - waited for alias=${alias} and ${fieldName}='${expectedFieldValue}', but the current response body's field has ${fieldName}=${actualFieldValue}; waiting once more`
);
Expand Down

0 comments on commit 5d06b1e

Please sign in to comment.