Skip to content

refactor: add v1.24.3 constraint, update README.md #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 18 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
[![tests](https://github.com/ddev/ddev-selenium-standalone-chrome/actions/workflows/tests.yml/badge.svg)](https://github.com/ddev/ddev-addon-template/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2025.svg)
[![add-on registry](https://img.shields.io/badge/DDEV-Add--on_Registry-blue)](https://addons.ddev.com)
[![tests](https://github.com/ddev/ddev-selenium-standalone-chrome/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ddev/ddev-selenium-standalone-chrome/actions/workflows/tests.yml?query=branch%3Amain)
[![last commit](https://img.shields.io/github/last-commit/ddev/ddev-selenium-standalone-chrome)](https://github.com/ddev/ddev-selenium-standalone-chrome/commits)
[![release](https://img.shields.io/github/v/release/ddev/ddev-selenium-standalone-chrome)](https://github.com/ddev/ddev-selenium-standalone-chrome/releases/latest)

# DDEV Selenium Standalone Chrome

## Introduction
## Overview

This service can be used with any project type. The examples below are Drupal-specific. Contributions for docs and tests that show this service working with other project types are appreciated.

## Install/Update
## Installation

For DDEV v1.23.5 or above run

```sh
```bash
ddev add-on get ddev/ddev-selenium-standalone-chrome
```

For earlier versions of DDEV run

```sh
ddev get ddev/ddev-selenium-standalone-chrome
```

Then restart your project

```sh
ddev restart
```

> [!NOTE]
> If you change `additional_hostnames` or `additional_fqdns`, you have to re-run `ddev add-on get ddev/ddev-selenium-standalone-chrome`
> Run `ddev add-on get ddev/ddev-selenium-standalone-chrome` after changes to `name`, `additional_hostnames`, `additional_fqdns`, or `project_tld` in `.ddev/config.yaml` so that `.ddev/docker-compose.selenium-chrome_extras.yaml` is regenerated.

After installation, make sure to commit the `.ddev` directory to version control.

### Optional steps

1. Update the provided `.ddev/config.selenium-standalone-chrome.yaml` as you see fit (and remove the #ddev-generated line). You can also just override lines in your `.ddev/config.yaml`
1. Check `config.selenium-standalone-chrome.yaml` and `docker-compose.selenium-chrome.yaml` into your source control.
1. Update by re-running `ddev add-on get ddev/ddev-selenium-standalone-chrome`.

## Use
## Usage

- Your project is now ready to run FunctionalJavascript and [Nightwatch](https://www.drupal.org/docs/automated-testing/javascript-testing-using-nightwatch) tests from Drupal core, or [Drupal Test Traits](https://gitlab.com/weitzman/drupal-test-traits) (DTT). All these types are tested in this repo. Some examples to try:
- FunctionalJavascript:
Expand All @@ -53,10 +45,10 @@ ddev restart

### The easy way: Use noVNC (built-in)

1. Remove --headless from the MINK_DRIVER_ARGS_WEBDRIVER in your project's .ddev/config.selenium-standalone-chrome.yaml. Run `ddev restart`.
2. On your host, run `ddev launch :7900` or browse to https://[DDEV SITE URL]:7900 to watch tests run with noVNC (neat!).
1. Remove `--headless` from the `MINK_DRIVER_ARGS_WEBDRIVER` in your project's `.ddev/config.selenium-standalone-chrome.yaml`. Run `ddev restart`.
2. On your host, run `ddev launch :7900` or browse to `https://[DDEV SITE URL]:7900` to watch tests run with noVNC (neat!).

By default noVNC connects without password, you can enable password by removing the "VNC_NO_PASSWORD=1" line in the file `docker-compose.selenium-chrome.yaml`, the default password will be `secret`, and you can set the custom one via `VNC_PASSWORD` environment variable.
By default noVNC connects without password, you can enable password by removing the `VNC_NO_PASSWORD=1` line in the file `docker-compose.selenium-chrome.yaml`, the default password will be `secret`, and you can set the custom one via `VNC_PASSWORD` environment variable.

This enables you to quickly see what is going on with your tests.

Expand All @@ -74,15 +66,15 @@ If you want to use the browser provided by this addon to check out the test resu
2. Uncomment the two lines about `ports` and `5900:5900`.
3. Execute `ddev restart`.

You can now connect to [DDEV SITE URL]:5900 (password: `secret`) in your VNC client.
You can now connect to `[DDEV SITE URL]:5900` (password: `secret`) in your VNC client.

Note that when using `ports`, only one project at a time can be running with port 5900.

### Behat config example

If you use Behat as a test running, adjust your `behat.yml`

```yml
```yaml
extensions:
Behat\MinkExtension:
base_url: http://web
Expand All @@ -101,6 +93,6 @@ If you use Behat as a test running, adjust your `behat.yml`

- Anyone is welcome to submit a PR to this repo. See README.md at https://github.com/ddev/ddev-addon-template, the parent of this repo.

## Maintainer
## Credits

- Contributed and maintained by [@weitzman](https://github.com/weitzman).
**Contributed and maintained by [@weitzman](https://github.com/weitzman)**
3 changes: 3 additions & 0 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project_files:
- docker-compose.selenium-chrome.yaml
- config.selenium-standalone-chrome.yaml

ddev_version_constraint: '>= v1.24.3'

post_install_actions:
- |
#ddev-nodisplay
Expand All @@ -25,6 +27,7 @@ post_install_actions:
- "ddev-router:{{- replace (env "DDEV_TLD") "\\${DDEV_TLD}" (replace (env "DDEV_PROJECT") "\\${DDEV_PROJECT}" $n) -}}"
{{- end }}
END

removal_actions:
- |
#ddev-nodisplay
Expand Down
Loading