{"id":13587465,"url":"https://github.com/mycargus/nightwatch-docker-grid","last_synced_at":"2025-08-17T20:11:13.281Z","repository":{"id":4222688,"uuid":"52402730","full_name":"mycargus/nightwatch-docker-grid","owner":"mycargus","description":"A dockerized Selenium Grid with Nightwatch","archived":false,"fork":false,"pushed_at":"2023-04-24T23:28:20.000Z","size":514,"stargazers_count":48,"open_issues_count":11,"forks_count":19,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T13:31:50.673Z","etag":null,"topics":["docker","nightwatch","selenium-grid"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/mycargus/nightwatch","language":"Shell","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/mycargus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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":"2016-02-24T00:47:32.000Z","updated_at":"2025-04-04T15:13:49.000Z","dependencies_parsed_at":"2023-07-05T21:16:46.122Z","dependency_job_id":null,"html_url":"https://github.com/mycargus/nightwatch-docker-grid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mycargus/nightwatch-docker-grid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycargus%2Fnightwatch-docker-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycargus%2Fnightwatch-docker-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycargus%2Fnightwatch-docker-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycargus%2Fnightwatch-docker-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mycargus","download_url":"https://codeload.github.com/mycargus/nightwatch-docker-grid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycargus%2Fnightwatch-docker-grid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270899582,"owners_count":24664720,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","nightwatch","selenium-grid"],"created_at":"2024-08-01T15:06:13.441Z","updated_at":"2025-08-17T20:11:13.251Z","avatar_url":"https://github.com/mycargus.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/mycargus/nightwatch-docker-grid.svg?branch=master)](https://travis-ci.com/mycargus/nightwatch-docker-grid)\n\n# A Dockerized Selenium Grid with Nightwatch\n\nI built this project to quickly provision a dockerized environment for running\nUI tests against a dockerized app. It employs a dockerized [Selenium Grid] which\nyields a far more cost-effective CI solution compared to purchasing and\nmaintaining dedicated machines.\n\nThis project is geared toward a Node.js audience, meaning I've included `npm`\nscripts as wrappers for the `docker-compose` commands. Hopefully, once you've\ncompleted the initial setup, you won't have to recall any docker commands.\n:smiley:\n\nNightwatch serves as the testrunner. It is automatically provisioned in the\n`nightwatch` docker image, which you can easily customize in the included\n`nightwatch.conf.js` file.\n\n## Dependencies\n\n- a clone of this repo on your machine\n- [Docker]\n\n## Setup\n\nHere's the default workflow when writing Nightwatch tests in this project:\n\n- `bin/build \u0026\u0026 bin/start \u0026\u0026 bin/test`\n- make changes to files inside the tests/ directory\n- verify changes with `bin/build \u0026\u0026 bin/start \u0026\u0026 bin/test`\n\n:sadtrombone:\n\nTo make your life easier, first do this:\n\n```bash\ncp docker-compose.dev.override.yml docker-compose.override.yml\n```\n\nNow any changes you make within this repo on your host file system will\nautomatically show up in the `nightwatch` docker container. Here's your new\nworkflow:\n\n- `bin/build \u0026\u0026 bin/start \u0026\u0026 bin/test`\n- make changes to files inside the tests/ directory\n- `bin/test`\n\n:party:\n\nSome folks have reported file permission issues with this workflow, so YMMV.\n\n### Where do I add my app?\n\nBy default this project will use a bare-bones Sinatra web [app] as the system\nunder test (SUT). If you want to replace that default web app with your own,\nopen the `docker-compose.yml` file, find the `web` service configuration, and\nreplace `mycargus/hello_docker_world:master` with your app's docker image label.\n\nFor example:\n\n```yaml\nweb:\n  image: my-app-under-test:master\n```\n\nIf you're not sure how to create or pull a docker image, I recommend working\nthrough the official Docker tutorial located on their website.\n\n## How do I execute the tests?\n\nStart the Selenium hub, the SUT, and the Selenium browser nodes:\n\n```bash\nnpm start\n```\n\nExecute the tests with Nightwatch:\n\n```bash\nnpm test\n```\n\nWhen you're done, stop and remove the docker containers:\n\n```bash\nnpm stop\n```\n\nAlternatively, if you don't want to install Node on your native machine, you may\nuse the included `bin/` scripts. For example:\n\n```bash\nbin/start\nbin/test\nbin/stop\n```\n\n## I want to see the app under test. How can I do that?\n\nIf you're using the default web app provided, then open your browser and go to\n\u003chttp://locahost:8080\u003e.\n\nIf you're using your own web app, make sure to expose a port in your web app's\nDockerfile. For example, if you have `EXPOSE 9887` in your web app's Dockerfile,\nthen you can view it at \u003chttp://localhost:9887\u003e.\n\n## Can I view the Selenium grid console?\n\nYep! After having started the Selenium hub and nodes (`npm start`), open a\nbrowser and go to \u003chttp://localhost:4444\u003e, then click the 'console' link.\n\n## A test is failing. How do I debug it?\n\nStart the Selenium hub, the app under test, and the Selenium _debug_ browser\nnodes:\n\n```bash\nnpm run start:debug\n```\n\nor\n\n```bash\nbin/start-debug\n```\n\nView the chrome debug node via VNC (password: `secret`):\n\n```bash\nopen vnc://localhost:5900\n```\n\nView the firefox debug node via VNC (password: `secret`):\n\n```bash\nopen vnc://localhost:5901\n```\n\nNext execute the Nightwatch tests against the debug nodes and watch them run in\nthe VNC window(s):\n\n```bash\nnpm run test:debug\n```\n\nor\n\n```bash\nbin/test-debug\n```\n\n## I want to use the Nightwatch docker container outside of this project\n\nWe publish our image to Dockerhub. Here's an example of using it in a\ndocker-compose config:\n\n```yaml\n# docker-compose.yml\n---\nversion: '3.7'\n\nservices:\n  nightwatch:\n    image: mycargus/nightwatch:master\n    command: nightwatch ui-tests/ -e chrome\n    volumes:\n      - ./:/home/docker/app/\n```\n\nNotice you can override the default container command with standard Nightwatch\nCLI commands, e.g. `nightwatch ui-tests/ -e chrome`.\n\nYou can see an example of this using our `docker-compose.example.yml` config:\n\n```bash\nbin/start\nbin/test-example\n```\n\n## My tests aren't stored in a tests/ directory. How do I specify a different one?\n\nIf you're using our `mycargus/nightwatch` docker image, then you have two ways\nto tell Nightwatch where to find your tests.\n\n### Environment Variable\n\nYou can provide a TESTS_DIRECTORY environment variable and value like so:\n\n```yaml\n# docker-compose.yml\n---\nversion: '3.7'\n\nservices:\n  nightwatch:\n    image: mycargus/nightwatch:master\n    environment:\n      TESTS_DIRECTORY: my_tests_directory/\n    volumes:\n      - ./:/home/docker/app/\n```\n\nNote you must mount your tests directory onto the container as shown above with\nthe `volumes` configuration (or the `docker run --volume` or\n`docker-compose run --volume` CLI equivalents) in order for Nightwatch to find\nyour custom tests directory. The container's default working directory is\n`/home/docker/app`, so as long as you mount your tests directory onto\n`/home/docker/app`, Nightwatch will be able to find them.\n\n### Nightwatch CLI\n\nYou can override the default `tests` directory and any `TESTS_DIRECTORY` value\nby using the Nightwatch CLI inside the container:\n\n```bash\ndocker run --rm --volume=\"./:/home/docker/app\" mycargus/nightwatch:master \\\n  nightwatch my_tests_directory/ -e chrome\n```\n\nUse `docker run --rm mycargus/nightwatch:master nightwatch --help` for more\ninfo.\n\n## Contributing\n\nWe welcome and encourage contributions! See our [Contributing] doc for\ndevelopment instructions and more info.\n\n[app]: https://github.com/mycargus/hello_docker_world\n[contributing]:\n  https://github.com/mycargus/nightwatch-docker-grid/blob/master/CONTRIBUTING.md\n[docker]: https://docs.docker.com/\n[docker for mac]: https://docs.docker.com/\n[selenium grid]: https://github.com/SeleniumHQ/docker-selenium\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmycargus%2Fnightwatch-docker-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmycargus%2Fnightwatch-docker-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmycargus%2Fnightwatch-docker-grid/lists"}