{"id":16057882,"url":"https://github.com/ondram/selenium-workshop-phpce","last_synced_at":"2025-03-18T04:31:14.243Z","repository":{"id":143358998,"uuid":"108476725","full_name":"OndraM/selenium-workshop-phpce","owner":"OndraM","description":"phpCE 2017 workshop on November 3, 2017","archived":true,"fork":false,"pushed_at":"2017-11-05T16:49:08.000Z","size":58,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-11T02:37:02.570Z","etag":null,"topics":["php","selenium","workshop"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OndraM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-26T23:36:23.000Z","updated_at":"2025-01-03T12:42:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f12f5ba-7b31-49fe-8f1c-bb807d2bbc57","html_url":"https://github.com/OndraM/selenium-workshop-phpce","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OndraM%2Fselenium-workshop-phpce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OndraM%2Fselenium-workshop-phpce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OndraM%2Fselenium-workshop-phpce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OndraM%2Fselenium-workshop-phpce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OndraM","download_url":"https://codeload.github.com/OndraM/selenium-workshop-phpce/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244156680,"owners_count":20407551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","selenium","workshop"],"created_at":"2024-10-09T03:05:14.476Z","updated_at":"2025-03-18T04:31:14.237Z","avatar_url":"https://github.com/OndraM.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Functional testing made easy with PHPUnit \u0026 Selenium\n\n[PhpCE 2017](https://2017.phpce.eu/) workshop on November 3, 2017.\n\nSee also [slides for the workshop](https://www.slideshare.net/ondram/workshop-functional-testing-made-easy-with-phpunit-selenium-phpce-poland-november-2017-81619016).\n\nThis hands-on training will show you how to start writing functional (aka end-to-end) tests for web applications and how \nto execute them in real browsers, leveraging:\n - [Selenium](https://github.com/SeleniumHQ/selenium) - a cross-browser automation framework,\n - [php-webdriver](https://github.com/facebook/php-webdriver) - PHP adapter for Selenium protocol,\n - [PHPUnit](https://github.com/sebastianbergmann/phpunit) testing framework and\n - [Steward](https://github.com/lmc-eu/steward) - test runner.\n \n## Prerequisites for participants\n\nPlease have your environment prepared **in advance** of the workshop.\n \nYou can choose either *Docker setup* (recommended and simpler) or if you are unable to do so, you can try a *\"classic\" setup*.\n\n### Common prerequisites (for both Docker and Classic setup)\n- own laptop\n- locally installed shell like bash/zsh/etc. (on Windows use [Git BASH](https://git-for-windows.github.io/), cmd.exe is not enough)\n- locally installed Git\n- locally installed PHP 5.6 / 7.0 / 7.1 for command line (no need of Apache, nginx etc.)\n    - the command `php` must be available from the shell\n    - on Windows you may have to add the path to the php executable to the system PATH variable, see [more info here](https://stackoverflow.com/questions/17727436/how-to-properly-set-php-environment-variable-to-run-commands-in-git-bash)\n    - the [xdebug](https://xdebug.org/download.php) extension is recommended \n- locally installed [composer](https://getcomposer.org/)\n    - the command `composer` should be available from the shell\n- IDE (like PhpStorm) will help you a lot (code-completion etc.)\n\n- Try cloning the example repository:\n\n```sh\n$ git clone git@github.com:lmc-eu/steward-example.git\n# or if you don't have set up SSH key on GitHub run:\n$ git clone https://github.com/lmc-eu/steward-example.git\n```\n\n- Install dependencies of the example repository using Composer:\n```sh\n$ cd steward-example\n$ composer install\n```\n\n### A. Docker-only steps 🐳\n\nThis will allow you to start Selenium and the browser inside Docker container. You will need:\n\n- Docker daemon up \u0026 running\n- VNC client to connect to the desktop inside Docker - eg. `vncviewer` (part of `TightVNC`) or [Remmina](https://www.remmina.org/) on Linux, on Mac OS the builtin client should be ok\n- pull and start the [standalone-chrome-debug](https://hub.docker.com/r/selenium/standalone-chrome-debug/) image:\n\n```sh\n$ docker run -p 4444:4444 -p 5900:5900 selenium/standalone-chrome-debug:3.6.0\n```\n**⚠ The Docker image is almost 400 MB download, so definitely do this ⤴ in advance!**\n\nThe previous command will make Selenium listening on `localhost` port `4444` and on port 5900 the browser GUI is exposed for VNC.\nSo to see the GUI, you just need to use your favorite remote desktop VNC viewer and connect to host `127.0.0.1:5900`.\n\nFor example on Linux with `vncviewer`:\n\n```sh\n$ vncviewer 127.0.0.1:5900 # if asked, enter password 'secret'\n```\n\nIf you see an empty desktop with Ubuntu logo on black background, the environment is prepared to execute the Selenium tests. 🎉\n\nIf you wan't to stop the running Docker image, hit `Ctrl+C` in the shell where it was started.\n\n### B. Classic setup-only steps 💻\n\nUsing this setup, the tests will be started on you local browser. While this may have some advantages,\n it may be a bit mote complicated to set it up, so if you can, please use the Docker way. Otherwise, you will need:\n\n- Java 8+, executable from command line (try command `java -version`)\n- Latest Chrome/Chromium browser (version 62)\n- Latest [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/downloads) (version 2.33)\n    - On Linux you may use a package from your distribution, like `chromium-chromedriver` on Ubuntu, aur/chromedriver on Arch etc.\n    - The `chromedriver` or `chromedriver.exe` command must be executable from the shell\n\n- When inside the `steward-example` directory, run this to download Selenium server `jar` file:\n\n```sh\n$ ./vendor/bin/steward install 3.4.0\n```\n\n- Now you can start the Selenium server:\n```sh\n$ java -jar ./vendor/bin/selenium-server-standalone-3.4.0.jar\n```\n\nIf you didn't place the `chromedriver` binary to the system PATH and thus Selenium cannot find it, you will need to \nspecify the path to is using parameters passed to the command like this:\n\n```sh\n$ java -Dwebdriver.chrome.driver=\"/opt/chromium-browser/chromedriver\" -jar vendor/bin/selenium-server-standalone-3.4.0.jar\n```\n \n### Try it 🚀\n\nHaving Selenium server listening (either inside Docker or locally) you can try running some example tests.\n \n```sh\n# make sure you are in steward-example directory (see above)\n$ ./vendor/bin/steward run production chrome -vv\n```\n\nIf you used Docker, open the VNC client window to see browser being controlled by Selenium inside the Docker container.\n\nIf you started Selenium locally, Chrome windows should start popping-up right in front of you.\n\n### Troubles?\n\nIf you encounter any trouble while preparing your environment for the workshop, please\n[fill an issue](https://github.com/OndraM/selenium-workshop-phpce/issues/new) in this repository.\nI will do my best to help you as soon as possible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fondram%2Fselenium-workshop-phpce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fondram%2Fselenium-workshop-phpce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fondram%2Fselenium-workshop-phpce/lists"}