Skip to content

Commit

Permalink
Add nightwatch tests (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
FriggaHel authored Apr 15, 2024
1 parent 9875fba commit 303646f
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
push:
paths:
- 'cypress/**'
- '.github/workflows/cypress.yml'
branches:
- main
pull_request:
paths:
- 'cypress/**'
- '.github/workflows/cypress.yml'
branches:
- main

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
push:
paths:
- 'dotnet-*/**'
- '.github/workflows/dotnet.yml'
branches:
- main
pull_request:
paths:
- 'dotnet-*/**'
- '.github/workflows/dotnet.yml'
branches:
- main

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
push:
paths:
- 'wd-java*/**'
- '.github/workflows/java.yml'
branches:
- main
pull_request:
paths:
- 'wd-java*/**'
- '.github/workflows/java.yml'
branches:
- main

Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/nightwatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Nigthwatch Tests

on:
push:
paths:
- 'nigthwatch*/**'
- '.github/workflows/nightwatch.yml'
branches:
- main
pull_request:
paths:
- 'nigthwatch*/**'
- '.github/workflows/nightwatch.yml'
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
cucumber:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run nightwatch example
uses: docker/build-push-action@v4
with:
context: ./nightwatch/cucumberjs
file: ./nightwatch/cucumberjs/Dockerfile
push: false
secrets: |
"dotenv=${{ secrets.DOTENV }}"
default:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run nightwatch example
uses: docker/build-push-action@v4
with:
context: ./nightwatch/default
file: ./nightwatch/default/Dockerfile
push: false
secrets: |
"dotenv=${{ secrets.DOTENV }}"
mocha:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run nightwatch example
uses: docker/build-push-action@v4
with:
context: ./nightwatch/mocha
file: ./nightwatch/mocha/Dockerfile
push: false
secrets: |
"dotenv=${{ secrets.DOTENV }}"
2 changes: 2 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
push:
paths:
- 'storybook*/**'
- '.github/workflows/storybook.yml'
branches:
- main
pull_request:
paths:
- 'storybook*/**'
- '.github/workflows/storybook.yml'
branches:
- main

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/wdio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
push:
paths:
- 'wdio*/**'
- '.github/workflows/wdio.yml'
branches:
- main
pull_request:
paths:
- 'wdio*/**'
- '.github/workflows/wdio.yml'
branches:
- main

Expand Down
27 changes: 27 additions & 0 deletions nightwatch/cucumberjs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:22.04 as amd64

RUN apt-get update && apt-get install -y curl

# Install runme
RUN curl -sSL https://download.stateful.com/runme/1.2.6/runme_linux_x86_64.tar.gz | tar -xz -C /usr/local/bin runme
RUN runme --version

FROM ubuntu:22.04 as arm64

RUN apt-get update && apt-get install -y curl

# Install runme
RUN curl -sSL https://download.stateful.com/runme/1.2.6/runme_linux_arm64.tar.gz | tar -xz -C /usr/local/bin runme
RUN runme --version

FROM ${TARGETARCH}

RUN mkdir -p /workspace
WORKDIR /workspace

COPY . .

RUN runme run nodejs-linux
RUN runme run npm-install
RUN --mount=type=secret,id=dotenv,target=/workspace/.env runme run npm-run
RUN --mount=type=secret,id=dotenv,target=/workspace/.env runme run npm-run-modified
1 change: 1 addition & 0 deletions nightwatch/cucumberjs/nightwatch.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// \_| \_/|_| \__, ||_| |_| \__| \_/\_/ \__,_| \__| \___||_| |_|
// __/ |
// |___/
require('dotenv').config();

module.exports = {
// An array of folders (excluding subfolders) where your tests are located;
Expand Down
27 changes: 27 additions & 0 deletions nightwatch/default/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:22.04 as amd64

RUN apt-get update && apt-get install -y curl

# Install runme
RUN curl -sSL https://download.stateful.com/runme/1.2.6/runme_linux_x86_64.tar.gz | tar -xz -C /usr/local/bin runme
RUN runme --version

FROM ubuntu:22.04 as arm64

RUN apt-get update && apt-get install -y curl

# Install runme
RUN curl -sSL https://download.stateful.com/runme/1.2.6/runme_linux_arm64.tar.gz | tar -xz -C /usr/local/bin runme
RUN runme --version

FROM ${TARGETARCH}

RUN mkdir -p /workspace
WORKDIR /workspace

COPY . .

RUN runme run nodejs-linux
RUN runme run npm-install
RUN --mount=type=secret,id=dotenv,target=/workspace/.env runme run npm-run
RUN --mount=type=secret,id=dotenv,target=/workspace/.env runme run npm-run-modified
27 changes: 27 additions & 0 deletions nightwatch/mocha/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:22.04 as amd64

RUN apt-get update && apt-get install -y curl

# Install runme
RUN curl -sSL https://download.stateful.com/runme/1.2.6/runme_linux_x86_64.tar.gz | tar -xz -C /usr/local/bin runme
RUN runme --version

FROM ubuntu:22.04 as arm64

RUN apt-get update && apt-get install -y curl

# Install runme
RUN curl -sSL https://download.stateful.com/runme/1.2.6/runme_linux_arm64.tar.gz | tar -xz -C /usr/local/bin runme
RUN runme --version

FROM ${TARGETARCH}

RUN mkdir -p /workspace
WORKDIR /workspace

COPY . .

RUN runme run nodejs-linux
RUN runme run npm-install
RUN --mount=type=secret,id=dotenv,target=/workspace/.env runme run npm-run
RUN --mount=type=secret,id=dotenv,target=/workspace/.env runme run npm-run-modified

0 comments on commit 303646f

Please sign in to comment.