2
votes

everyone!

I have been trying to configure Codeception 2.3.6 with Laravel 5.3.30 running on PHP 7.0.23 powered by WAMP 3.1.0. My functional test cases are running fine, but when I try to run my acceptance test cases, a new chrome window opens and then closes without doing anything.

The output in the HTML Report is Codeception Results OK(0s), while the output on the command line is:

WelcomeCept: Perform actions and see result (0.00s)

Time: 3.24 seconds, Memory: 22.75MB
OK (1 test, 0 assertions)
HTML report generated in file://D:\wamp\www\myApp\tests/_output\report.html

First I start ChromeDriver with the command

chromedriver --url-base=/wd/hub

Then I start Selenium Standalone Server 3.13.0 with the command:

java -Dwebdriver.chrome.driver="chromedriver" -jar selenium-server-standalone-3.13.0.jar -port 4445

Then I run my acceptance test suite which contains a single test file, with the command:

call vendor/bin/codecept run acceptance --html

My acceptance.suite.yml is:

class_name: AcceptanceTester
modules:
enabled:
    - WebDriver:
        url: http://lcms.com/
        window_size: false # disabled in ChromeDriver
        port: 9515
        browser: 'chrome'
        restart: true
        wait: 200
        capabilities:
          unexpectedAlertBehaviour: 'accept'
          webStorageEnabled: true
          javascriptEnabled: true

    - Laravel5:
        part: ORM
        cleanup: false # can't wrap into transaction
        environment_file: .env
    - \Helper\Acceptance

My WelcomeCept.php file, just for testing the configuration, is:

<?php

class WelcomeCept
{
    public function welcomeTest(AcceptanceTester $I)
    {
        $I->wantTo('perform actions and see result');
    }
}

Please review my workflow and let me know if I'm doing things incorrectly or am missing something.

Thanks!

Update: Same thing is happening using GeckoDriver or PhantomJS in WebDriver mode. The tests are passing with OK but not performing any actions.

1
Could you try to run tests with --steps option? - a_sarana
By using --steps option, the test is passing, Scenario is empty. - Imran Habib
What happens when you run a test which actually does something? Because in your example doing nothing is an expected result. - Naktibalda
@Naktibalda same thing happens. I get nothing in scenario. I have tests that are meant to test creating a resource in my app. But even those tests do not perform anything, giving test result OK and taking 0 seconds for execution. - Imran Habib
Using --coverage option, it gives Classes (0/0), Methods (0/0), Lines (0/0). Which actually is showing that the tests are not being executed, but somehow they are still passing. Strange! - Imran Habib

1 Answers

2
votes

Solved! I tried WelcomeCest instead of WelcomeCept and things have fallen into place.