Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
Testing reusable flow 10
Browse files Browse the repository at this point in the history
  • Loading branch information
lholota committed May 22, 2023
1 parent 70dcc9c commit 4760be7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/run-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,28 @@ on:
# TODO: Set token perms

jobs:
load-config:
runs-on: [ self-hosted ]
steps:
- name: Load variables
id: vars
run: cat ./environments/local.${{ inputs.environment }}.env >> "$GITHUB_OUTPUT"

e2e-tests:
runs-on: [ self-hosted ]
services:
webdriver-chrome:
image: selenium/standalone-chrome
image: selenium/standalone-chrome # TODO: We need to configure the DNS !!!
ports:
- 4444
# options: --dns ${{ steps.primary_dns. }}
# options: DNS HOW
steps:
- name: Test node
run: echo ${{ job.services.webdriver-chrome.ports[4444] }}
- name: Debug 1
run: echo ${{ steps.vars.outputs.DNS1 }}

- name: Debug 2
run: echo ${{ steps.vars.outputs.DNS2 }}

- name: Check out e2e repository
uses: actions/checkout@v3.5.2
Expand All @@ -29,9 +41,12 @@ jobs:
- name: Install dependencies
run: cd e2e && yarn

- name: Ping webdriver
run: ping webdriver-chrome
- name: Run tests
run: cd e2e && yarn test:${{ inputs.environment }}
env:
WEBDRIVER_HOST: host.docker.internal
WEBDRIVER_PORT: ${{ job.services.webdriver-chrome.ports[4444] }}


# TODO: Start a chrome driver container
# TODO: Run E2E
# TODO: Kill the chrome driver container (runs always !!!)
4 changes: 2 additions & 2 deletions nightwatch.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ module.exports = {
on_failure: true,
path: "screenshots"
},
selenium_port: 4444,
selenium_host: "127.0.0.1",
selenium_port: "${WEBDRIVER_PORT}",
selenium_host: "${WEBDRIVER_HOST}",
desiredCapabilities: {
browserName: "chrome",
javascriptEnabled: true,
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"client:local:lab": "env-cmd -f ./environments/local.lab.env docker-compose up --force-recreate --remove-orphans",
"client:local:prod": "env-cmd -f ./environments/local.prod.env docker-compose up --force-recreate --remove-orphans",
"client:remote": "env-cmd -f ./environments/remote.env docker-compose up --force-recreate --remove-orphans",
"test:lab": "nightwatch --skiptags remoteonly -e lab",
"test:prod": "nightwatch --skiptags localonly -e prod"
"test:local:lab": "nightwatch --skiptags remoteonly -e lab",
"test:local:prod": "nightwatch --skiptags remoteonly -e prod",
"test:remote:lab": "nightwatch --skiptags localonly -e lab",
"test:remove:prod": "nightwatch --skiptags localonly -e prod"
},
"devDependencies": {
"env-cmd": "^10.1.0",
Expand Down

0 comments on commit 4760be7

Please sign in to comment.