Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I hover mouse over an element with Codeception?

Hope someone can help/point me to a answer....

I am using Codeception for testing our website. All is well, except that I can not find a way to hover over a menu element to reveal the rest of the menu.

With watir & webdriver I was able to use

browser.div(:class->"menu-item-1").hover

I did find moveMouseOver, but it does not seem to work. I've tried

moveMouseOver('//div/div/div/div/ul/li[2]/a')

and

moveMouseOver('.menu-item-1')

like image 484
user2906554 Avatar asked Oct 22 '13 10:10

user2906554


1 Answers

This is working for me with Codeception version 2.0.9 (to test for the appearance of Pin It buttons on image hover on a WordPress blog post):

$I->amOnPage( '/blog/post-1/' );
$I->moveMouseOver( '.entry-content img' );
$I->seeElement( 'a[title="Pin it!"]' );
like image 97
Mill Hill Automation Avatar answered Oct 26 '22 11:10

Mill Hill Automation