K
K
ksivasid2016-07-12 16:01:58
PHPUnit
ksivasid, 2016-07-12 16:01:58

How to run a test without a console?

I am writing phpunit + selenium tests, everything seems to be normal, but the task appeared to run tests not through the console, but through the browser (the user presses the button to run the test, a get request flies to the server, the test starts), how to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ksivasid, 2016-07-12
@ksivasid

this is understandable in general terms, but how exactly to do it technically.
For example I have a class

class FooBar extends PHPUnit_Extensions_Selenium2TestCase
{

protected function setUp()
  {
    $this->setHost('localhost');
    $this->setPort(4444);
    $this->setBrowser('firefox');
    $this->setBrowserUrl("http://foo-bar.ru/");
    $this->prepareSession()->currentWindow()->maximize();
  }

  public function testFooBar()
  {
    $this->url("index.php");
    $this->byId('auth_user_name')->value('foo');
    $this->byId('auth_user_password')->value('bar');
    $this->byCssSelector('input.enter_btn')->click();
  }
}

I run it through the console:
phpunit.bat FooBar.php
But I just can't figure out how to run this test class without the console

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question