Recently, I've delved into the world of PageObjects but have encountered some challenges.
I'm trying to perform a command directly on a specific section rather than just on elements. For instance, I want to
.waitForElementVisible
directly within a section (not on individual elements). Is this even possible? I've experimented with various combinations like:browser.page.topMenu().section.loginBox.section.unauthenticated.waitForElementVisible('@loginTooltip', 10000)
So essentially, in this scenario: topMenu()
is my PageObject file, followed by the loginBox
section which contains -> the unauthenticated
section containing -> the loginTooltip
section. My goal is to call .waitForElementVisible
on the final section. How can this be achieved? While I understand that sections can be combined without limitations, how do I interact with them subsequently?
- [consider this question as an added challenge since it deviates from the main topic] I am struggling with making assertions on a section within another section. Any tips on how to accomplish this successfully? I've attempted multiple approaches, one of them being:
browser.page.topMenu().expect.section('@loginBox').to.be.visible
- this works fine when dealing with just a single section
browser.page.topMenu().expect.section('@loginBox').section('@unauthenticated').to.be.visible
- does not yield the desired result; my intention is to verify if the unauthenticated
section nested within the loginBox
section is visible. How should this task be approached?
Thank you in advance for any assistance provided; despite my efforts, I haven't been able to resolve these issues independently.