Closed colenso closed 2 years ago
@rwjblue Any idea on what this is about? Or how I can get around this?
It (the visit helper) waits for the page to be "settled", if I understand well the API Documentation, which kind of makes sense (you usually wanna wait for the whole page to be loaded and finished). For info on the "settled" keyword, lookithere.
Maybe what you're looking for in this particular issue is more like a waitFor(HeaderSelector)
(cf. link).
Thanks @frykten this is exactly the behavior that I was experiencing. Since this is not a bug, I'm going to close this issue now.
I was trying to get started with acceptance testing in our app and had a case where I was setting a flag after 60 seconds. But for some reason the code
await visit('/login')
waits for thelater
code to execute. Here's my sample app: https://github.com/colenso/test-appIt's pretty simple: app/controllers/login.js has the code that sets the flag
app/templates/login.hbs has the code that calls the function
And tests/acceptance/login-test.js has the test code that I got following the guides for writing acceptance tests https://guides.emberjs.com/release/testing/testing-application/
The test times out at 60 seconds because for some weird reason it's waiting for the later code to execute.