You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Cypress, the scrollIntoView function accepts a parameter named duration to control the scrolling animation duration. However, if the parameter is misspelled as durution, the function still works without throwing an error or warning. The scrolling animation proceeds as expected despite the typo.
typo :
test case pass with typo in parametre.
Steps to Reproduce
Open a Cypress test file.
Use the scrollIntoView function with the parameter durution instead of duration as shown above.
Run the test.
Observe that no error or warning is thrown, and the scrolling animation works as if the correct parameter was provided.
Desired behavior
An error or warning should be thrown, indicating that durution is not a recognized parameter for the scrollIntoView function. The typo should be flagged, and the function should not silently accept incorrect parameters.
Test code to reproduce
describe("Demo Website Automation",()=>{it(' scrolling the page ',()=>// {cy.visit("https://www.worldometers.info/geography/flags-of-the-world/")cy.get("img[src='/img/flags/small/tn_tu-flag.gif']").scrollIntoView().should("be.visible")// for scrolling cy.get("img[src='/img/flags/small/tn_tu-flag.gif']").scrollIntoView({durution:5000})// this duration function takes time i.e in how many second we want to scroll to that locationcy.get("body > div:nth-child(19) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(5) > div:nth-child(1) > div:nth-child(164) > div:nth-child(1) > div:nth-child(2)").contains("Sri Lanka")});});
Possible Cause
The issue may arise because Cypress does not strictly validate option keys passed to the scrollIntoView function. It might silently ignore unrecognized parameters or treat them as valid, leading to unintended behavior.
Current behavior
In Cypress, the scrollIntoView function accepts a parameter named duration to control the scrolling animation duration. However, if the parameter is misspelled as durution, the function still works without throwing an error or warning. The scrolling animation proceeds as expected despite the typo.
typo :
![Image](https://private-user-images.githubusercontent.com/175556629/407098305-3ff7d708-d1be-48a1-b6ca-faf9ff859caa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MDQ2OTMsIm5iZiI6MTczODkwNDM5MywicGF0aCI6Ii8xNzU1NTY2MjkvNDA3MDk4MzA1LTNmZjdkNzA4LWQxYmUtNDhhMS1iNmNhLWZhZjlmZjg1OWNhYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QwNDU5NTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NDc1MThiNzYzNDMwMDViNGViZjY0NmZmMWIzMmYzYTYxMGZlOTIzOWJhYmY3OTE2ZmQwMWFlMGM0MmEwZGY0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.N50aoP97wCBO1c0Xy225j-nU6CoYUsc_aveSOi5LdTc)
test case pass with typo in parametre.
Steps to Reproduce
Desired behavior
An error or warning should be thrown, indicating that durution is not a recognized parameter for the scrollIntoView function. The typo should be flagged, and the function should not silently accept incorrect parameters.
Test code to reproduce
Cypress Version
13.17.0
Node version
10.9.2
Operating System
window 22H2
Debug Logs
Other
Possible Cause
The issue may arise because Cypress does not strictly validate option keys passed to the scrollIntoView function. It might silently ignore unrecognized parameters or treat them as valid, leading to unintended behavior.
Reported By
Name: Masaid Zeb
Email: masaid.zeb2244@gmail.com
My LinkedIn
The text was updated successfully, but these errors were encountered: