Skip to content
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

clarify how to enable VNC #18

Merged
merged 3 commits into from
Feb 3, 2023
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
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,32 @@ This service can be used with any project type. The examples below are Drupal-sp
- Drupal Test Traits
- Ensure you have a working site that has the `weitzman/drupal-test-traits` Composer package.
- `ddev exec -d /var/www/html/web "../vendor/bin/phpunit --bootstrap=../vendor/weitzman/drupal-test-traits/src/bootstrap-fast.php --printer '\Drupal\Tests\Listeners\HtmlOutputPrinter' ../vendor/weitzman/drupal-test-traits/tests/ExampleSelenium2DriverTest.php"`
- On your host, browse to https://[DDEV SITE URL]:7900 (password: `secret`) to watch tests run (neat!).

## Watching the tests

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

On your host, browse to https://[DDEV SITE URL]:7900 (password: `secret`) to watch tests run with noVNC (neat!).

This is a no-configuration solution that enables you to quickly see what is going on with your tests.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering we need to make configuration changes and restart DDEV, I'm not so sure about the wording here. 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I didn't realize that --headless is set in the YAML file, so there should probably be a section on how and why to disable headless as well. What's the reason for setting --headless as a default in the first place? Is it just speed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imaging there would be memory savings from using --headless, which might be more important when running on CI.

Note there are 2 references, one for Mink tests and one forr DTT tests.

@weitzman , are there issues removing this as the default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm able to watch just fine with the existing configuration.


### Use a local VNC client (try noVNC first!)

If you are using something like behat and want to debug tests when they fail by manually navigating around your site in the Chromium browser included with this addon, you might want to use a VNC client installed on your machine, such as Screen Sharing on macOS (built-in) or TightVNC on Linux and Windows (must be downloaded and installed). This is because with noVNC, you are running a browser (Chromium) inside another browser (whatever browser you use on your local machine), which can be inconvenient-- for example, the keyboard shortcut to reload a page in Chromium will reload your local browser and kick you out of noVNC instead of reloading Chromium, and it may be hard to type a new url in the Chromium address bar due to how your local browser handles keyboard input.

In other words, if you just want to watch the tests, use noVNC.

If you want to use the browser provided by this addon to check out the test results by poking around your site, consider using a local VNC client. To do so, you need to open port 5900.

#### How to open port 5900 for VNC access

1. Open `.ddev/docker-compose.selenium-chrome.yaml`.
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.

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

## Contribute

Expand Down
9 changes: 5 additions & 4 deletions docker-compose.selenium-chrome.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ services:
- HTTP_EXPOSE=7910:7900
external_links:
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
#ports:
# VNC access for a traditional VNC client like macOS "Screen Sharing".
# - "5900:5900"
# To enable VNC access for traditional VNC clients like macOS "Screen Sharing",
# uncomment the following two lines.
#ports:
# - "5900:5900"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
Expand All @@ -30,4 +31,4 @@ services:

web:
links:
- selenium-chrome
- selenium-chrome