0
votes

I am using phpStorm IDE with composer and codeception to write selenium acceptance tests in my mac machine.But I couldn't able to run my tests.

I started my Selenium Stand alone jar and chromedriver in my mac machine using the below command.

java -Dwebdriver.chrome.driver="/Users/krishna/Downloads/chromedriverNewChrome" -jar selenium-server-standalone-3.141.59.jar

Below is the console information and not sure if the Chrome driver is running or not.

00:34:19.637 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358 00:34:19.722 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444 2019-02-08 00:34:19.777:INFO::main: Logging initialized @348ms to org.seleniumhq.jetty9.util.log.StdErrLog 00:34:19.985 INFO [WebDriverServlet.] - Initialising WebDriverServlet 00:34:20.086 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444

<?php
use \AcceptanceTester;

class IndexTest

{

    public function _before(AcceptanceTester $I){}

    // tests
    public function tryToTest(AcceptanceTester $I)
    {
        $I->amOnUrl('http://codeception.com');
        $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart
    }
}

acceptance.yml file

actor: AcceptanceTester
modules:
    enabled:
        - WebDriver:
              url: 'http://localhost/'
              window_size: false # disabled in ChromeDriver
              port: 43008
              browser: chrome

Running in the following way:

Go to PhpStorm>Run>EditConfiguration>Codeception>Select Type as acceptance tests and run it.

I see following error in the console after I run the tests.

Testing started at 00:50 ... /usr/bin/php /private/var/folders/4v/cltv5gzs79n6v77b53zw52z00000gn/T/ide-codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-ansi --no-interaction -c /Users/kabothu/PhpstormProjects/CodeCeptionAutomation/codeception.yml acceptance

Warning: Declaration of PhpStorm_Codeception_ReportPrinter::writeProgress($progress): void should be compatible with PHPUnit\TextUI\ResultPrinter::writeProgress(string $progress): void in /private/var/folders/4v/cltv5gzs79n6v77b53zw52z00000gn/T/ide-codeception_24_70.php on line 2 Codeception PHP Testing Framework v2.5.3 Powered by PHPUnit 7.5.3 by Sebastian Bergmann and contributors. Running with seed:

Time: 148 ms, Memory: 8.00MB

No tests executed!

Process finished with exit code 0

1

1 Answers

0
votes

You named your test class IndexTest, it would work if it extended PhpUnit\Framework\TestCase or Codeception\Test\Unit.
However your test code shows that you wanted to implement test in Cest format, to get it working you must rename your test class to IndexCestand file to IndexCest.php.