?
avatar astridx
astridx
24 Jan 2020

Steps to reproduce the issue

I looked at the read.me in the tests directory and followed the instructions here.

This is my acceptance.suite.yml

# Codeception Test Suite Configuration
# Suite for acceptance tests.
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.

class_name: AcceptanceTester
modules:
    enabled:
        - Asserts
        - JoomlaBrowser
        - Helper\Acceptance
        - Helper\JoomlaDb
    config:
        JoomlaBrowser:
            url: 'http://localhost/joomla-cms4'     # the url that points to the joomla installation at /tests/system/joomla-cms
            browser: 'chrome'
            window_size: 1920x1080
            capabilities:
              'goog:chromeOptions':
                args: ["whitelisted-ips", "disable-gpu", "no-sandbox", "window-size=1920x1080", "--disable-dev-shm-usage"]
            name: 'jane doe'                       # Name for the Administrator
            username: 'admin'                      # UserName for the Administrator
            password: 'admin'                      # Password for the Administrator
            database host: 'localhost'           # place where the Application is Hosted #server Address
            database user: 'root'                  # MySQL Server user ID, usually root
            database password: 'mypassword'         # MySQL Server password, usually empty or root
            database name: 'joomla_db4'           # DB Name, at the Server
            database type: 'mysqli'                # type in lowercase one of the options: MySQL\MySQLi\PDO
            database prefix: 'jos_'                # DB Prefix for tables
            install sample data: 'no'              # Do you want to Download the Sample Data Along with Joomla Installation, then keep it Yes
            sample data: 'Default English (GB) Sample Data'    # Default Sample Data
            admin email: 'admin@mydomain.com'      # email Id of the Admin
            language: 'English (United Kingdom)'   # Language in which you want the Application to be Installed
            timeout: 90                            # or 90000 the same result
            log_js_errors: true
        Helper\JoomlaDb:
            dsn: 'mysql:host=mysql;dbname=joomla_db4'
            user: 'root'
            password: 'mypasswor'
            prefix: 'jos_'
        Helper\Acceptance:
            url: 'http://localhost/joomla-cms4'   # the url that points to the joomla installation at /tests/system/joomla-cms - we need it twice here
            MicrosoftEdgeInsiders: false           # set this to true, if you are on Windows Insiders
            cmsPath: '/tests/www/test-install'                # ; If you want to setup your test website (document root) in a different folder, you can do that here.
            localUser: 'www-data'                          # (Linux / Mac only) If you want to set a different owner for the CMS test folder

error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED"

env:
    postgres:
        modules:
            config:
                JoomlaBrowser:
                    database host: 'postgres'
                    database type: 'pgsql'
                Helper\JoomlaDb:
                    dsn: 'pgsql:host=postgres;dbname=test_joomla'
    mysql8:
        modules:
            config:
                JoomlaBrowser:
                    database host: 'mysql8'
    mysql:
    # Nothing to change

At first everything looks pretty good.


/var/www/html/joomla-cms4$ ./node_modules/.bin/selenium-standalone install
----------
selenium-standalone installation starting
----------

---
selenium install:
from: https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.5.jar
to: /var/www/html/joomla-cms4/node_modules/selenium-standalone/.selenium/selenium-server/3.141.5-server.jar
---
chrome install:
from: https://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip
to: /var/www/html/joomla-cms4/node_modules/selenium-standalone/.selenium/chromedriver/2.43-x64-chromedriver
---
firefox install:
from: https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz
to: /var/www/html/joomla-cms4/node_modules/selenium-standalone/.selenium/geckodriver/0.23.0-x64-geckodriver
---
File from https://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip has already been downloaded
---
File from https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.5.jar has already been downloaded
---
File from https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz has already been downloaded


-----
selenium-standalone installation finished
-----
astrid@astrid-TravelMate-5760G:/var/www/html/joomla-cms4$ ./node_modules/.bin/selenium-standalone start
20:07:43.930 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.5, revision: d54ebd709a
20:07:44.026 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2020-01-24 20:07:44.075:INFO::main: Logging initialized @387ms to org.seleniumhq.jetty9.util.log.StdErrLog
20:07:44.326 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
20:07:44.405 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
Selenium started

But if I run

libraries/vendor/bin/codecept run acceptance tests/Codeception/acceptance/install

i get

/var/www/html/joomla-cms4$ libraries/vendor/bin/codecept run acceptance tests/Codeception/acceptance/install
Codeception PHP Testing Framework v3.1.0
Powered by PHPUnit 8.3.4 by Sebastian Bergmann and contributors.
Running with seed: 


In Db.php line 555:
                                                                                                                                    
  Db: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known while creating PDO connection  
                                                                                                                                    

run [-o|--override OVERRIDE] [-e|--ext EXT] [--report] [--html [HTML]] [--xml [XML]] [--phpunit-xml [PHPUNIT-XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--bootstrap [BOOTSTRAP]] [--no-redirect] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--coverage-crap4j [COVERAGE-CRAP4J]] [--coverage-phpunit [COVERAGE-PHPUNIT]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-x|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--no-rebuild] [--seed SEED] [--] [<suite> [<test>]]

What am I doing wrong?
I tested this on Ubuntu 18.04 and PHP 7.2.24

avatar astridx astridx - open - 24 Jan 2020
avatar joomla-cms-bot joomla-cms-bot - change - 24 Jan 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Jan 2020
avatar astridx astridx - change - 24 Jan 2020
Title
System Testing for Joomla
[4.0] System Testing for Joomla
avatar astridx astridx - edited - 24 Jan 2020
avatar wilsonge
wilsonge - comment - 24 Jan 2020

Is the database credentials you've pasted in your acceptance.yml here valid for the db. assuming yes - but just to be sure

avatar astridx astridx - change - 25 Jan 2020
The description was changed
avatar astridx astridx - edited - 25 Jan 2020
avatar astridx
astridx - comment - 25 Jan 2020

Thank you for your reply. I am sure that I have entered the correct credentials in my file. I think the connection settings are not correct. I found this:
https://stackoverflow.com/a/30187838/4260616

avatar astridx astridx - change - 25 Jan 2020
The description was changed
avatar astridx astridx - edited - 25 Jan 2020
avatar wilsonge
wilsonge - comment - 25 Jan 2020

the fact your acceptance suite is specifying mysqli and your using pdo isn't a good sign :/

avatar brianteeman
brianteeman - comment - 31 Jan 2020

@astridx did you resolve this?

avatar astridx
astridx - comment - 31 Jan 2020

Unfortunately not. I haven't had time to investigate further.

avatar astridx astridx - change - 16 Feb 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-02-16 00:20:14
Closed_By astridx
avatar astridx
astridx - comment - 16 Feb 2020

i do not know why, but now I can run the tests.

avatar astridx astridx - close - 16 Feb 2020

Add a Comment

Login with GitHub to post a comment