0

I am trying to test my store by running the functional tests provided in CE 1.9.2.0.

I have configured the environment and when the test starts a browser opens up and I can see it working.

However, before completing the first CreateAdminUserRoleEntityTest test, I run into an error. I would expect PHP Unit to mark the test as failed and move on to the next. Instead it just hangs and tries to find the same CSS selector over and over again, until the timeout is reached and the testing stops.

Is this expected behavior? How can I get it to keep testing when getting an exception from Selenium?


The Magento error I'm getting after save is Invalid current password. The error in Selenium is

10:59:34.704 INFO - Done: [execute script: return document['readyState'], []]
10:59:34.706 INFO - Executing: [find element: By.cssSelector: .success-msg li])
10:59:36.724 WARN - Exception thrown
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"css selector","selector":".success-msg li"}
Command duration or timeout: 1.66 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'

Solution

I found the error was

Fatal error: Call to undefined method Mage\Admin\Test\TestCase\CreateAdminUserEntityTest::hasExpectationOnOutput()

I was using the wrong version of phpunit. Instead I needed to use the version that was installed with composer.

2

Some things to check

  • Make sure you're using the correct version of phpunit, i.e., use the one installed with composer. Also try using --debug and --verbose options.
    • ./vendor/bin/phpunit --verbose --debug
  • Use the selenium server included with composer
    • java -jar vendor/netwing/selenium-server-standalone/selenium-server-standalone-2.39.0.jar
  • Don't change the backendLogin/backendPassword credentials in dev/tests/functional/etc/config.xml. If you search through the source, you'll find that the 123123q password is hard coded in several places.
  • If you're still having issues, try adding ini_set('display_errors', 1); before the rest of the code in dev/tests/functional/bootstrap.php and debug the stack trace
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.