the tests example code:
<?php
use yii\helpers\Url;
class ApiTestConnectionCest {
public function testSuccessfullConnection(AcceptanceTester $I) {
$I->amOnPage(Url::toRoute('/apis/update?id=1'));
$I->fillField('input[name="LoginForm[username]"]', 'admin');
$I->fillField('input[name="LoginForm[password]"]', 'asdassad');
$I->click('login-button');
$I->wait(1); // wait for button to be clicked
$I->see('Update Hotel Apis: The May Fair Hotel','h1');
$I->amGoingTo('Test successful api connection!');
$I->click('#connection-test');
$I->wait(6);
$I->see('Connection information is correct');
}
}
i just changed tests/acceptance.suite.yml to
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: http://app:8001
browser: chrome
host: webdriver
port: 4444
capabilities:
goog:chromeOptions:
args: [âallow-insecure-localhostâ,âheadlessâ,âstart-maximizedâ]
i dont why codeception try acceptance tests with ssl; the error show failing with ssl
Thank you for taking the time
but error not changed
i think error relate to ssl, i didnât add https anywhere but codeception in docker selenium chrome try with ssl and it failed.
finally i solved the problem, change the container name from app to tools and problem solved.
it seems the app name is reserved by the browser and redirect to https.
my new docker-compose.yml file:
tools:
image: yiisoftware/yii2-php:7.2-fpm
volumes:
- .:/app/
ports:
- 8001:8001
depends_on:
- mysql
- webdriver
command: bash -c âphp -S 0.0.0.0:8001 -t /webâ
networks:
- yii
webdriver:
image: selenium/standalone-chrome
restart: always
hostname: webdriver
privileged: true
shm_size: 2g
ports:
- 4444:4444
- 5900:5900
volumes:
- /dev/shm:/dev/shm
networks:
- yii
and acceptance.suite.yml config:
WebDriver:
url: âhttp://tools:8001/â
browser: chrome
host: webdriver
port: 4444