agouti icon indicating copy to clipboard operation
agouti copied to clipboard

using Eventually for wait. but error

Open se9958 opened this issue 7 years ago • 1 comments

Eventually(page.Find("#rank_list"), "10s").Should(BeVisible())

get this message

You are trying to make an assertion, but Gomega's fail handler is nil. If you're using Ginkgo then you probably forgot to put your assertion in an It(). Alternatively, you may have forgotten to register a fail handler with RegisterFailHandler() or RegisterTestingT().

have no idea i need to wait for ajax render element finish Is this possible?

se9958 avatar Nov 21 '17 10:11 se9958

Hi @se9958,

If you're using Agouti with Gomega, you need to provide Gomega with a way to fail tests. If you're using the standard library testing package without a test runner like Ginkgo, see: https://onsi.github.io/gomega/#using-gomega-with-golangs-xunit-style-tests

If you aren't using Agouti to run tests (or if you'd just like to avoid using Gomega), you can manually poll page.Find("#rank_list").Visible().

Alternatively, if you're just trying to wait for the page to load and the element to appear, it might be easier to rely on you're webdriver to accomplish this. The three timeout methods here can be set to non-zero values to make any Selection method block until the element is available. I've found that this is less reliable for writing acceptance tests that pass consistently with a variety of webdrivers, but it may be more appropriate for your use case.

sclevine avatar Nov 25 '17 21:11 sclevine