{"id":13588745,"url":"https://github.com/labs42io/web-automation","last_synced_at":"2026-03-03T16:45:18.509Z","repository":{"id":37562800,"uuid":"245997190","full_name":"labs42io/web-automation","owner":"labs42io","description":"BDD tests with Cucumber, WebdriverIO and Docker Selenium","archived":false,"fork":false,"pushed_at":"2022-04-17T15:11:30.000Z","size":154,"stargazers_count":135,"open_issues_count":4,"forks_count":43,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-13T21:06:28.260Z","etag":null,"topics":["automation-testing","cucumber","docker-selenium","testing","typescript","web-automation","webdriverio"],"latest_commit_sha":null,"homepage":"https://labs42io.github.io/web-automation","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labs42io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-09T09:45:50.000Z","updated_at":"2025-02-10T22:28:51.000Z","dependencies_parsed_at":"2022-09-11T19:23:38.806Z","dependency_job_id":null,"html_url":"https://github.com/labs42io/web-automation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/labs42io/web-automation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labs42io%2Fweb-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labs42io%2Fweb-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labs42io%2Fweb-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labs42io%2Fweb-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labs42io","download_url":"https://codeload.github.com/labs42io/web-automation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labs42io%2Fweb-automation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30052132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T15:26:47.567Z","status":"ssl_error","status_checked_at":"2026-03-03T15:26:17.132Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["automation-testing","cucumber","docker-selenium","testing","typescript","web-automation","webdriverio"],"created_at":"2024-08-01T15:06:53.840Z","updated_at":"2026-03-03T16:45:18.490Z","avatar_url":"https://github.com/labs42io.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Web Automation Framework\n\n[![CircleCI](https://circleci.com/gh/labs42io/web-automation/tree/master.svg?style=svg)](https://circleci.com/gh/labs42io/web-automation/tree/master) \n[![CI](https://github.com/labs42io/web-automation/workflows/CI/badge.svg)](https://github.com/labs42io/web-automation/actions) \n[![Build Status](https://travis-ci.org/labs42io/web-automation.svg?branch=master)](https://travis-ci.org/labs42io/web-automation)  \n\nBoilerplate project to write BDD tests with [Cucumber](https://cucumber.io/) and execute with [docker selenium](https://github.com/SeleniumHQ/docker-selenium).\nTests are written in an ordinary language that bridges the gap between business and technical people.\nThe docker selenium simplifies the setup and avoids any local installation of browser specific dependencies.\n\n## Features\n\n- Simple setup, no need for local preinstalled Selenium Grid and browser drivers\n- Test with *Chrome* and *Firefox* with zero configuration\n- Integrated with [WebdriverIO](https://webdriver.io/)\n- BDD tests with [Cucumber](https://cucumber.io/docs/cucumber/) and over 150 predefined steps\n- Implement custom steps with [TypeScript](https://www.typescriptlang.org/)\n- Support for debugging tests\n- Possibility to visually see the execution in browser with *VNC*\n- Detailed report generation ([example](https://wswebcreation.github.io/multiple-cucumber-html-reporter/browsers/index.html))\n- Integration with CI tools\n\n## Requirements\n\n- To run *Firefox* and *Chrome* browsers with docker selenium you need:\n  - `docker`\n  - `docker-compose`\n\n- Tests are executed with Node.js, requires:\n  - `Node.js` version 10 or higher\n  - `npm` version 6 or higher\n\n## Quick start\n\n1. Install dependencies required to run the tests:\n\n```sh\nnpm install\n```\n\n2. Start docker selenium containers with `docker-compose`:\n\n```sh\n# starts the selenium hub and browser nodes in docker containers\nnpm run selenium\n```\n\n3. Run the tests and view the report:\n\n```sh\n# run tests and open the report\nnpm run test\n```\n\nTo stop all the docker containers from step 2:\n\n```sh\nnpm run selenium:stop\n```\n\nNote that selenium containers can be started once and then used across multiple sessions of running and debugging tests.\n\n## Test examples\n\n|File||\n|--|--|\n|`./src/features/google.search.feature`|An example of testing the Google search|\n|`./src/features/sample.snippets.feature`|Samples of using the existing test snippets. Credits [Christian Bromann](https://github.com/christian-bromann)|\n\n## Adding tests\n\nTests are written using [Gherkin syntax](https://cucumber.io/docs/gherkin/) in a fashion that can be used as feature documentation:\n\n```gherkin\n# This is a single line comment\nFeature: Performing a Google Search\n\n    As a user on the Google search page\n    I want to search for Selenium-Webdriver\n    Because I want to learn more about it\n\n    Background:\n        Given I open the url \"https://google.com\"\n\n    Scenario: Searching for Selenium Webdriver\n        When I set \"Selenium Webdriver\" to the inputfield \"[name=q]\"\n        And  I press \"Enter\"\n        Then I expect that element \"#search\" becomes displayed\n```\n\nAll tests should be located in `./src/features/*` directory with extension `.feature` (configured in `./config/tests.config.ts`).  \nFor a list of predefined and supported steps see files:\n- `./src/steps/given.ts` \n- `./src/steps/when.ts` \n- `./src/steps/then.ts`.  \n\nThe steps are inspired from [cucumber-boilerplate](https://github.com/webdriverio/cucumber-boilerplate#list-of-predefined-steps) repository.\n\n### Implementing custom steps\nThere are over 150 predefined steps, but in case you need an extra step you can add it in one of the `./src/steps` file.  \nThe snippets are defined using regular expressions. It allows to implement powerful and complex sentences.\nEverything that's within `\"([^\"]*)?\"` gets captured and appended to the callback.  \nTo access browser functionality, reference the global variable `browser` which is a *WebdriverIO* browser instance.\nSee the [documentation](https://webdriver.io/docs/api.html) for a list of supported methods.  \nAssertions are written using [chai](https://www.chaijs.com/). \n\n### Browser specific tests\nTo run a test against a specific browser use predefined [tags](https://cucumber.io/docs/cucumber/api/#tags):\n\n```gherkin\nFeature: Performing a Google Search\n\n    ...\n\n    # This scenario will run only in Chrome browser\n    @OnlyChrome\n    Scenario: Searching in chrome browser\n    ...\n\n    # This scenario will run only in Firefox browser\n    @OnlyFirefox\n    Scenario: Searching in Firefox browser\n    ...\n```\n\n### Pending tests\n\nTo skip a test, use the `@Pending` tag:\n```gherkin\nFeature: Performing a Google Search\n\n    ...\n\n    # This scenario will be skipped\n    @Pending\n    Scenario: Searching for WebdriverIO\n    ...\n```\n\n### Verbose tests\n\nCurrently, a screenshot is attached only for a failing test. In case you want screenshots for a test regardless of its completion status,\nuse the `@Verbose` tag:\n\n```gherkin\nFeature: Performing a Google Search\n\n    ...\n\n    # A screenshot and additional test details will be attached to the report\n    @Verbose\n    Scenario: Searching for WebdriverIO\n    ...\n```\n\n### Hooks\n\nHooks are blocks of code that can run at various points in the Cucumber execution cycle. It is possible to write conditional hooks.  \nSee examples of scenario hooks in `./src/steps/hooks.ts`. For a more advanced usage, configure hooks in \n`./config/hooks.config.ts`.  \n\nYou can customize existing hooks or implement your own.\nSee the WebdriverIO [documentation]((https://webdriver.io/docs/options.html#hooks)) about hooks. \n\n## Configurations\n\n### Environment variables \n\nThe configurable options are set in the `.env` file.\n\n|Variable|Usage|\n|--|--|\n|`SELENIUM_VERSION`|Configure the version of selenium hub and nodes. Change this version if you want to run tests against a specific browser version. See the [list](https://github.com/SeleniumHQ/docker-selenium/releases) of available selenium releases and browser versions.|\n|`SCREEN_WIDTH` `SCREEN_HEIGHT`|Configure browser window size.|\n\n### WebdriverIO options\n\nWebdriverIO specific [options](https://webdriver.io/docs/options.html) are all in `./config` directory.  \nFor example, to configure a default url change the `baseUrl` option in `./config/index.ts`:  \n\n```typescript\nexport const config = {\n  runner: 'local',\n  baseUrl: 'https://webdriver.io',\n  ...\n```\n\n## Debugging tests\n\nThere is a `./.vscode/launch.json` file that has a debugger configuration for *Visual Studio Code*, but you can enable debugging in any other editor\nthat supports integration with Node.js debugger.  \n\nTo debug a single feature file:\n\n- *Prerequisites*: selenium containers are running (`npm run selenium`)\n\n- The `.feature` file to test is active in VS Code\n\n- From VS Code *Run and Debug* menu select the *Debug current test* option\n\nThe test will start and run only the current file. Once started you can navigate to any `.ts` file and place a breakpoint.  \n\nTo debug all files follow the same steps but use the *Debug all tests* option.\n\n## VNC support\n\nIn some cases, you might need to visually see the execution in the browser. That is possible thanks to docker selenium debug images that \nhave `XVFB` and `VNC` server installed. Note that debug images are slower and are intended only for development mode.  \n\n### Prerequisites\n\nDownload on your machine the [VNC viewer](https://www.realvnc.com/en/connect/download/viewer/).\n\n### Selenium Debug containers\n\nIf you already have docker selenium containers running, stop them:\n\n```sh\nnpm run selenium:stop\n```\n\nStart selenium *debug* containers that enable the VNC support:\n\n```sh\n# starts the selenium containers with VNC support\nnpm run selenium:vnc\n```\n\n### VNC connection options  \n\n|Browser|Connection options|\n|--|--|\n|**Chrome**|`127.0.0.1:5900`|\n|**Firefox**|`127.0.0.1:5901`|\n\n\nNow you can connect and enter the remote session.  \n\n### Running tests\n\nTests by default run in *headless* mode so that a browser window is not visually created.\nTo run the tests with enabled browser window:\n\n```sh\n# runs the tests without headless option\nnpm run test:vnc\n```\n\nNote that even if you started selenium with VNC support, you need to run the `test:vnc` command to see the browsers visually.\n\nDebugging with VNC support is also possible. If you're using *Visual Studio Code* there are `VNC Debug current test` and \n`VNC Debug all tests` debugging configurations that work similar to configurations described in [Debugging tests](#debugging-tests) section.  \n\nTo stop the debug containers use the same command:\n\n```sh\nnpm run selenium:stop\n```\n\n## CI integration\n\nIntegration with a CI tool is easy if it supports `docker` and `docker-compose` tools.  \nThere is a *Dockerfile* to build an image that bundles Node.js, npm and tests.\nThe `docker-compose.ci.yml` configures all the dependencies required to run the tests in containers:\n\n```sh\ndocker-compose -f docker-compose.ci.yml up --abort-on-container-exit --exit-code-from node\n```\n\nThere are `npm` scripts to avoid running long commands:\n\n```sh\n# only builds the Dockerfile image\nnpm run ci:build\n\n# runs the tests in containers\nnpm run ci\n```\n\n|CI|Status|Config|Artifacts|\n|--|--|--|--|\n|**CircleCI**| [![CircleCI](https://circleci.com/gh/labs42io/web-automation/tree/master.svg?style=svg)](https://circleci.com/gh/labs42io/web-automation/tree/master) |`./.circleci/default.yml`|Report uploaded as artifacts that can be viewed directly in the browser.|\n|**Github Actions**| [![CI](https://github.com/labs42io/web-automation/workflows/CI/badge.svg)](https://github.com/labs42io/web-automation/actions) |`./.github/workflows/main.yml`|Report files available as a downloadable zip in artifacts. |\n|**TravisCI**| [![Build Status](https://travis-ci.org/labs42io/web-automation.svg?branch=master)](https://travis-ci.org/labs42io/web-automation) |`./.travis.yml`|You need to configure Amazon S3 account to enable artifacts. |\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabs42io%2Fweb-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabs42io%2Fweb-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabs42io%2Fweb-automation/lists"}