From c91cf3739dbfed5b9601517324f4ef28c4118459 Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:43:36 +0000 Subject: [PATCH 1/4] Simplify chrome/chromedriver documentation Also adds VPN notice to the homepage --- README.md | 19 ++++++++++--------- app/views/home/index.html.erb | 4 +++- data/interactions.yml | 6 +++--- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7c50e5d..ddebe59 100644 --- a/README.md +++ b/README.md @@ -24,21 +24,22 @@ bundle exec npm install bundle exec yarn install ``` +## Setup Chrome for Testing + chromedriver -## Ensure your chromedriver is installed/up to date/has executable permission -- Update to the latest version of Google Chrome. -- Note your version of Google Chrome by clicking the Menu in the top right of Chrome, then clicking Help > About Chrome -- Download the version of `chromedriver` relevant to your version of Google Chrome from https://googlechromelabs.github.io/chrome-for-testing/ - you'll want the `mac-arm64` version if you're on an M1 Mac. **Make sure you have downloaded `chromedriver` and not `chrome` ! (see screenshot)** - - -- Copy the relevant chromedriver URL from the table, and open it in a new tab so that the download process begins. -- Once download, extract the `.zip` file by double clicking it. -- Move the `chromedriver` file to `/usr/local/bin`. You can do this by doing `cp /Users/[YOUR.NAME]/Downloads/chrome-mac-arm64/chromedriver /usr/local/bin/chromedriver` +- Download both `chrome` AND `chromedriver` from https://googlechromelabs.github.io/chrome-for-testing/ - you'll want the `mac-arm64` version if you're on an M1 Mac. +- Extract the zip file for `chrome` by double clicking the downloaded file. +- Open your terminal, and go to the folder where Chrome was extracted, e.g. `~/Downloads/chrome-mac-arm64` +- Run `sudo xattr -cr 'Google Chrome for Testing.app'`. This removes Apple's security, which prevents files that originated from zip files from being executed. +- In your Finder, move `Google Chrome for Testing.app` into your Mac's Applications folder, like you usually do to install applications on a Mac. +- Now, we need to setup `chromedriver`. +- Extract the `.zip` file for `chromedriver` by double clicking the downloaded file. +- Move the `chromedriver` file to `/usr/local/bin`. You can do this by running `cp /Users/[YOUR.NAME]/Downloads/chrome-mac-arm64/chromedriver /usr/local/bin/chromedriver` - Change directory to `/usr/local/bin` in your terminal - Run `chmod +x chromedriver` to make chromedriver executable - Run `sudo xattr -r -d com.apple.quarantine chromedriver` to remove Apple's security quarantine from the file - Restart your terminal, and to test chromedriver is working, run `chromedriver -v` +- You shouldn't need to run these steps ever again, unless you want to update your test version of Google Chrome ### Running the application diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index dffadc8..4db55bb 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -4,7 +4,9 @@
This form will run any tests listed in interactions.yaml on the chosen environment
+This form will run any tests listed in interactions.yaml on the chosen environment.
+Connect to the developer VPN to test on staging/integration environments.
+ <%= form_with url: fake_path, method: :post do |form| %>This page shows all the possible GA4 events for a given URL. This is a work in progress - only a few interactions are implemented.
+
Currently, this works by loading a page, and clicking every element with data-ga4-event, data-ga4-link, or data-ga4-form (with some JS to prevent default behaviour.)
<%= form_with url: runner_path, method: :post do |form| %>
This page shows all the possible GA4 events for a given URL. This is a work in progress - only a few interactions are implemented.
Currently, this works by loading a page, and clicking every element with data-ga4-event, data-ga4-link, or data-ga4-form (with some JS to prevent default behaviour.)
+
Connect to the developer VPN to test on staging/integration environments.
<%= form_with url: runner_path, method: :post do |form| %>