Skip to content

Commit

Permalink
Support for GitPod.io
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-molak committed Dec 20, 2022
1 parent a983d4c commit 38b2b12
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
image:
file: .gitpod/.gitpod.Dockerfile

ports:
- port: 8080
onOpen: notify
visibility: public

tasks:
- name: 'Install'
init: |
nvm install
nvm use
npm ci
gp sync-done installation
- name: 'Serenity Reports'
init: gp sync-await installation
command: |
mkdir -p target/site/serenity
npx http-server -p 8080 target/site/serenity/
- name: 'Welcome'
init: gp sync-await installation
command: |
npm test
echo "To view Serenity Reports, visit:"
gp url 8080
vscode:
extensions:
- dbaeumer.vscode-eslint
- EditorConfig.EditorConfig
- CucumberOpen.cucumber-official

github:
prebuilds:
master: true
branches: true
pullRequests: true
pullRequestsFromForks: true
addCheck: prevent-merge-on-error
addComment: false
addBadge: true
37 changes: 37 additions & 0 deletions .gitpod/.gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM gitpod/workspace-full-vnc

ARG DEBIAN_FRONTEND=noninteractive
ARG TZ=UTC
ENV SHELL=/bin/bash

## https://www.gitpod.io/docs/config-docker
USER gitpod

# ######################################################################################################################
# Install Firefox and Microsoft Edge
# https://github.com/webdriverio/webdriverio/blob/36d8c142c6efd3323199819b86e185acc5a5a800/.gitpod/dev.dockerfile

RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \
&& sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/ \
&& sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list' \
&& sudo rm microsoft.gpg \
&& sudo apt-get update \
&& sudo apt-get install -y \
firefox \
microsoft-edge-dev

# ######################################################################################################################
# Install ChromeDriver
#
# Chromium and ChromeDriver are now distributed via Snap, which is not available on Gitpod.io
# Since Google Chrome is already installed in Gitpod Node workspace, all we need is ChromeDriver
# https://github.com/gitpod-io/workspace-images/blob/e91b47d148d6687703e258a7589b8cba74367a88/dazzle.yaml#L59
# https://github.com/gitpod-io/workspace-images/blob/e91b47d148d6687703e258a7589b8cba74367a88/chunks/tool-chrome/Dockerfile
#
# Running: /usr/bin/google-chrome
# Outputs: Google Chrome 103.0.5060.134
# Extract the major version
RUN bash -c "export GOOGLE_CHROME_VERSION=$(/usr/bin/google-chrome --version | sed -E 's/[[:alpha:]|(|[:space:]]//g' | awk -F. '{print $1}') \
&& npm install --location=global chromedriver@\$GOOGLE_CHROME_VERSION \
&& export NODE_PATH='$(npm root --location=global):\$NODE_PATH' \
&& node -e 'console.log(\`export CHROMEDRIVER_FILEPATH=\${ require(\"chromedriver\").path}\`)' >> /home/gitpod/.bashrc.d/99-chromedriver"
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"CucumberOpen.cucumber-official"
],
"unwantedRecommendations": []
}
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files.autoSave": "onFocusChange",
"workbench.startupEditor": "readme",
"workbench.tree.indent": 12,
"cucumber.features": [
"features/**/*.feature"
],
"cucumber.glue": [
"features/**/*.steps.ts"
],
"cucumber.parameterTypes": [
{ "name": "actor", "regexp": "[A-Z][a-z]+" },
{ "name": "pronoun", "regexp": "he|she|they|his|her|their" }
]
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ Follow the [installation instructions](https://serenity-js.org/handbook/integrat

## Usage

This repository is a GitHub template. You can use it to create new [GitHub repositories](https://help.github.com/en/articles/creating-a-repository-from-a-template) or simply [clone it to your computer](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/cloning-a-repository).
This repository is a GitHub template. You can use it to [create a new GitHub repository](https://help.github.com/en/articles/creating-a-repository-from-a-template), [clone it to your computer](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/cloning-a-repository).

You can also launch it in a virtual Gitpod workspace without having to install anything on your machine:

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)

### Installation

Expand Down

0 comments on commit 38b2b12

Please sign in to comment.