Page MenuHomeIn-Portal Phabricator

INP-1827 - Connect a testing framework
ClosedPublic

Authored by alex on Nov 15 2023, 3:19 AM.

Details

Test Plan

Preparations

  1. create a Selenium Windows folder on the Desktop
  2. download https://github.com/SeleniumHQ/selenium/releases/download/selenium-3.141.59/selenium-server-standalone-3.141.59.jar file (Selenium Server) into the above-created folder
  3. download a geckodriver-vA.B.C-win64.zip file from the release on the https://github.com/mozilla/geckodriver/releases page, that matches your Firefox version (if you're using Firefox 119, then download a file from the 0.33.0 release)
  4. unpack the above-downloaded file into the above-created folder
  5. in the same folder create a run.bat file with this content:
java -jar selenium-server-standalone-3.141.59.jar
  1. double-click on the run.bat file to execute it
  2. a window with a running Selenium Server (see approximate content below) will open and won't automatically close:
C:\Users\Username\Desktop\Selenium Windows>java -jar selenium-server-standalone-3.14
1.59.jar
11:31:14.190 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, re
vision: e82be7d358
11:31:14.377 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standal
one Selenium Server on port 4444
2023-11-15 11:31:14.598:INFO::main: Logging initialized @1096ms to org.seleniumh
q.jetty9.util.log.StdErrLog
11:31:15.194 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
11:31:15.449 INFO [SeleniumServer.boot] - Selenium Server is up and running on p
ort 4444
  1. create the /system/mink_config.php file with this content (replace IP_OF_WINDOWS_COMPUTER with the internal IP computer, where Selenium Server was started) :
<?php
return array(
    'default' => array('alias' => 'ff_local'),

    'ff_local' => array(
        'browserName' => 'firefox', 'host' => 'IP_OF_WINDOWS_COMPUTER', 'port' => 4444, 'timeout' => 15
    ),
);
  1. run the composer install command in the root folder of In-Portal
  2. in the Admin Console reset unit config cache for new PHP classes to be discovered

Testing

  1. run the ./vendor/bin/phpunit -c tools/build/inc/phpunit.xml in the root folder of In-Portal installation
  2. confirm, that:
    • during command execution Firefox was started automatically with In-Portal shown in it and some interactions (e.g. buttons clicked) were done in these windows
    • PHPUnit tests had no errors (example of successful output below):
...

Time: 23.21 seconds, Memory: 10.00MB

OK (3 tests, 3 assertions)

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alex created this revision.Nov 15 2023, 3:19 AM
alex requested review of this revision.Nov 15 2023, 3:19 AM
alex edited the test plan for this revision. (Show Details)Nov 15 2023, 3:35 AM
alex edited the test plan for this revision. (Show Details)Nov 15 2023, 3:39 AM
erik accepted this revision.Nov 15 2023, 5:17 AM
This revision is now accepted and ready to land.Nov 15 2023, 5:17 AM
alex edited the test plan for this revision. (Show Details)Nov 15 2023, 5:17 AM
alex added a project: Restricted Project.
This revision was landed with ongoing or failed builds.Nov 15 2023, 5:29 AM
Closed by commit rINP16761: Fixes INP-1827 - Connect a testing framework (authored by alex, committed by ). · Explain Why
This revision was automatically updated to reflect the committed changes.