Closed asfixia closed 5 years ago
I was not able to reproduce the issue. However, I found a mistake in the following code:
export async function closeIntroJs(t) {
const introJsContainer = Selector('.introjs-tooltip');
if (introJsContainer.exists) {
await t.click(Selector('.introjs-skipbutton'))
}
}
The Selector
method returns a Promise, so you can not use its exists
property. I recommend you refer the following article https://devexpress.github.io/testcafe/documentation/test-api/built-in-waiting-mechanisms.html#waiting-for-elements-when-evaluating-selectors
After that you can modify your closeIntroJs
function in the following manner:
export async function closeIntroJs (t) {
const introJsSnapshot = await Selector('.introjs-tooltip', { timeout: 20000 })();
if (introJsSnapshot)
await t
.click(Selector('.introjs-skipbutton'));
}
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.
What is your Test Scenario?
I need to click in a button to close a panel with a tutorial when someone new enters in the site.
What is the Current behavior?
In my code i use a click at a given selector which returns that the elements doesn't exists in the dom, but using document.getElementsByClassName it exists.
What is the Expected behavior?
Click in the given link/button.
What is your web application and your TestCafe test code?
My test code is in: https://github.com/asfixia/Testcafe---issue-example
The site that i want to debug is: https://maps.csr.ufmg.br
Steps to Reproduce:
Just run the testcafe with the file "TimelinePanelTest.js"
Your Environment details: