-1

I have a website need test e2e, in each case, I must hover the main menu for sub-menu showing, then click goto next step.

Because only click sub-menu success after menu is hovered in 1.5 seconds, So every time I want to goto next page, I must pay 2 seconds for waiting sub-menu showing and click it.

Is there others ways to work around it? My test case running really slow now

Thanks :)

Peter89
  • 706
  • 8
  • 26

1 Answers1

1

You have a couple of options: If it's your sites code set the activation time for your sub-menus to be much shorter when run in the test environment. If not - what exactly are you testing? If you're testing that the menu works then you'll just have to live with the delay. If however you just want to test that the links in the menu go to valid places you could find the hidden menu entries, get the destinations, and visit them directly

visit(find_link('Sub-Menu entry text', visible: :all)['href'])

It really does depend on what your testing environment is and what exactly you're trying to test.

Thomas Walpole
  • 48,548
  • 5
  • 64
  • 78
  • Thanks @tom :) . Your answer is cool, but in my testing website, all menu link-button is javascript. So I must click link directly to go to next page I want. I found solution: < page.execute_script("$('#{tag}').css('display','block')"); > . It will show all imediately instead of waiting 2 seconds – Peter89 Oct 13 '15 at 08:43