-
Notifications
You must be signed in to change notification settings - Fork 279
chore(ui5-dynamic-page): migrate wdio tests to cypress #11778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
.should("exist"); | ||
|
||
cy.get("@dynamicPage") | ||
.invoke("prop", "headerSnapped", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion: I noticed that in several tests we set the headerPinned and headerSnapped properties dynamically using .invoke(). While this approach works fine, it might improve clarity and readability to define separate mount configurations where the prop is set upfront. This way, the component's initial state is explicit in the test setup.
That said, the current approach is valid and working well, so feel free to keep it as is if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! You're right that setting properties upfront in JSX is cleaner.
After testing this approach, I discovered that the DynamicPage component has an initialization timing issue with headerSnapped={true} in JSX - it causes Cannot read properties of null (reading 'scrollTop') errors because the component tries to access scroll elements before they're ready.
So I use a hybrid approach:
Properties like headerPinned={true}, showFooter work fine in JSX and are set there
Only headerSnapped uses .invoke("prop") after mounting
Convert DynamicPage tests to Cypress component tests while maintaining test coverage and functionality parity with original specs.
JIRA: BGSOFUIPIRIN-6816