diff --git a/README.md b/README.md index 5c097de7..8b5b1667 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ helm install example webgrid/webgrid kubectl port-forward service/example-webgrid 8080:80 ``` -Your grid is now available at the [`localhost:8080`](http://localhost:8080/) service. Use any standard Kubernetes method to access it! +Your grid is now available at the [`localhost:8080`](http://localhost:8080/) service. If you are deploying to a RBAC enabled cluster you might have to tweak some settings. Take a look at the [documentation](https://webgrid.dev/kubernetes/configuration/) on how to use your own ServiceAccount and PersistentVolumeClaims. diff --git a/docs/getting-started.md b/docs/getting-started.md index 2c35562a..8ea60c2a 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -26,9 +26,6 @@ docker-compose up Continue [reading below](#using-the-grid) on how to send requests to your grid. -!!! todo - The compose file refers locally built images. Replace them with hub.docker.com ones once the repository goes public! - ## Kubernetes WebGrid provides a [Helm](https://helm.sh) chart to get started as quickly as possible. Below is a guide on how to add the chart repository and install the chart. @@ -49,7 +46,7 @@ Once you have started the grid you can send requests to it using the regular Sel === "Java" ```java FirefoxOptions firefoxOptions = new FirefoxOptions(); - WebDriver driver = new RemoteWebDriver(new URL("http://localhost"), firefoxOptions); + WebDriver driver = new RemoteWebDriver(new URL("http://localhost:8080"), firefoxOptions); driver.get("http://www.google.com"); driver.quit(); ``` @@ -60,7 +57,7 @@ Once you have started the grid you can send requests to it using the regular Sel firefox_options = webdriver.FirefoxOptions() driver = webdriver.Remote( - command_executor='http://localhost', + command_executor='http://localhost:8080', options=firefox_options ) driver.get("http://www.google.com") @@ -70,7 +67,7 @@ Once you have started the grid you can send requests to it using the regular Sel === "C#" ```csharp FirefoxOptions firefoxOptions = new FirefoxOptions(); - IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost"), firefoxOptions); + IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:8080"), firefoxOptions); driver.Navigate().GoToUrl("http://www.google.com"); driver.Quit(); ``` @@ -79,7 +76,7 @@ Once you have started the grid you can send requests to it using the regular Sel ```ruby require 'selenium-webdriver' - driver = Selenium::WebDriver.for :remote, url: "http://localhost", desired_capabilities: :firefox + driver = Selenium::WebDriver.for :remote, url: "http://localhost:8080", desired_capabilities: :firefox driver.get "http://www.google.com" driver.close ``` @@ -90,7 +87,7 @@ Once you have started the grid you can send requests to it using the regular Sel var capabilities = Capabilities.firefox(); (async function helloSelenium() { let driver = new Builder() - .usingServer("http://localhost") + .usingServer("http://localhost:8080") .withCapabilities(capabilities) .build(); try { @@ -104,7 +101,7 @@ Once you have started the grid you can send requests to it using the regular Sel === "Kotlin" ```kotlin firefoxOptions = FirefoxOptions() - driver: WebDriver = new RemoteWebDriver(new URL("http://localhost"), firefoxOptions) + driver: WebDriver = new RemoteWebDriver(new URL("http://localhost:8080"), firefoxOptions) driver.get("http://www.google.com") driver.quit() ``` diff --git a/docs/index.md b/docs/index.md index 7b3db0cb..909e634f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,129 @@ -# Home +

WebGrid

-Here shall be a tag line and a link to GitHub plus a link to the [Getting started](getting-started.md) + +

+ Banner +

+ +

+ + + Install + + | + + Usage + + | + + Docs + + +

+ + +

+ + Contributor Covenant + + + GitHub + + +
+ + + Maintenance + + + GitHub last commit + + +
+ You have an idea for a logo? Submit it here! +

+ +--- + + +* **Cluster ready.** Designed with concurrency, on-demand scalability and cluster operation in mind +* **Debuggable.** Provides browser screen recordings and extensive logs +* **Resilient.** Built with automatic error recovery at its core +* **[W3C Specification](https://www.w3.org/TR/webdriver1/) compilant.** Fully compatible with existing Selenium clients + +--- + +## Install + +Below are quick-start tutorials to get you started. For a more detailed guide visit the dedicated [Getting Started guide](https://webgrid.dev/getting-started/)! + +### 🐳 Docker + +To run a basic grid in Docker you can use Docker Compose. Below is a bare-bones example of getting all required components up and running! + +```bash +# Create prerequisites +docker volume create webgrid +docker network create webgrid + +# Download compose file +curl -fsSLO https://webgrid.dev/docker-compose.yml + +# Launch the grid +docker-compose up +``` + +You can now point your Selenium client to [`localhost:8080`](http://localhost/) and browse the API at [`/api`](http://localhost/api). + +### ☸️ Kube + +For deployment to Kubernetes a Helm repository is available. The default values provide a good starting point for basic cluster setups like [K3s](https://k3s.io) or [microk8s](https://microk8s.io). + +```bash +# Add the repository +helm repo add webgrid https://webgrid.dev/ + +# Install the chart +helm install example webgrid/webgrid + +# Make it accessible locally for evaluation +kubectl port-forward service/example-webgrid 8080:80 +``` + +Your grid is now available at the [`localhost:8080`](http://localhost:8080/) service. + +If you are deploying to a RBAC enabled cluster you might have to tweak some settings. Take a look at the [documentation](https://webgrid.dev/kubernetes/configuration/) on how to use your own ServiceAccount and PersistentVolumeClaims. + +## Usage + +Once you have your grid up and running there is a couple of things you can do! + +### πŸš€ Launch browser instances + +Point your selenium client to [`http://localhost:8080`](http://localhost:8080) to create a new browser container/pod and interact with it! You can use all features supported by Selenium. + +### πŸ” Browse the API + +The grid provides a GraphQL API at [`/api`](http://localhost:8080/api) with a Playground for you to explore. It exposes all available metadata about sessions, grid health and advanced features like video recordings. + +### πŸ“Ί Watch your browsers + +You can take a **live** look at what your browsers are doing by taking the [Session ID](https://webgrid.dev/features/screen-recording/#session-id) of a instance and visiting `localhost:8080/embed/`. You can also embed the videos in your existing tools! Head over to the embedding documentation to learn how. + +!!! warning "Screen recordings in clusters" + Video recordings are disabled by default in K8s as every cluster has specific requirements for file storage. The storage documentation explains how to enable it. + +## Developing + +If you want to build the project locally you can use the [Makefile](https://github.com/TilBlechschmidt/WebGrid/blob/main/Makefile). To create Docker images for every component and run them locally run these commands: + +```bash +# Build docker images +make + +# Start components in docker +make install +``` + +To start individual components outside of Docker or setup the development environment, see the [development environment documentation](https://webgrid.dev/contribute/dev-environment/). \ No newline at end of file