Skip to content

Commit 4a4084b

Browse files
committed
add .env for playwright url
1 parent e7cdba2 commit 4a4084b

File tree

6 files changed

+42
-11
lines changed

6 files changed

+42
-11
lines changed

.github/workflows/playwright.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
name: 🧪 Playwright End To End (e2e) Tests Workflow
22

33
on:
4-
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches:
7+
- main
58

6-
# Allows you to run this workflow manually from the Actions tab
9+
# Allows you to run this workflow manually from the Actions tab
710
workflow_dispatch:
811

912
jobs:
1013
tests_e2e:
11-
name: Run end-to-end tests
14+
name: Run end-to-end tests for live website
1215
runs-on: ubuntu-latest
16+
env:
17+
BASE_URL_TESTING: ${{ vars.BASE_URL_TESTING }}
1318
steps:
1419
- uses: actions/checkout@v3
1520
- uses: actions/setup-node@v3

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ _vendor/
88
/playwright-report/
99
/blob-report/
1010
/playwright/.cache/
11+
.env
12+
.venv

hugo_stats.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@
7070
"bi-circle-half",
7171
"bi-moon",
7272
"bi-save",
73+
"blockquote",
74+
"blockquote-alert",
75+
"blockquote-alert-caution",
76+
"blockquote-alert-heading",
77+
"blockquote-alert-important",
78+
"blockquote-alert-note",
7379
"border",
7480
"border-0",
7581
"border-1",
@@ -178,12 +184,15 @@
178184
"fa-calendar",
179185
"fa-calendar-day",
180186
"fa-check-to-slot",
187+
"fa-circle-info",
181188
"fa-code",
182189
"fa-ellipsis",
190+
"fa-exclamation",
183191
"fa-face-frown",
184192
"fa-fw",
185193
"fa-github",
186194
"fa-globe",
195+
"fa-hand",
187196
"fa-laptop-medical",
188197
"fa-link",
189198
"fa-linkedin",
@@ -336,7 +345,6 @@
336345
"shadow",
337346
"show",
338347
"slide",
339-
"small",
340348
"start-0",
341349
"start-50",
342350
"sticky-top",
@@ -679,6 +687,7 @@
679687
"externalcosts-property",
680688
"fa-calendar",
681689
"fa-face-frown",
690+
"fa-hand",
682691
"fab-blogger",
683692
"fab-github",
684693
"fab-linkedin",
@@ -692,8 +701,10 @@
692701
"fas-book",
693702
"fas-calendar-day",
694703
"fas-check-to-slot",
704+
"fas-circle-info",
695705
"fas-code",
696706
"fas-ellipsis",
707+
"fas-exclamation",
697708
"fas-globe",
698709
"fas-laptop-medical",
699710
"fas-link",

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"autoprefixer": "^10.4.20",
7373
"cssnano": "^7.0.5",
7474
"cssnano-preset-advanced": "^7.0.5",
75+
"dotenv": "^16.4.5",
7576
"hugo-bin": "0.131.0",
7677
"purgecss-whitelister": "^2.4.0"
7778
},

playwright.config.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
// @ts-check
22
const { defineConfig, devices } = require('@playwright/test');
3+
import dotenv from 'dotenv';
4+
import path from 'path';
35

4-
/**
5-
* Read environment variables from file.
6-
* https://github.com/motdotla/dotenv
7-
*/
8-
// require('dotenv').config({ path: path.resolve(__dirname, '.env') });
6+
// Read from ".env" file.
7+
dotenv.config({ path: path.resolve(__dirname, '.env') });
98

10-
const port = 1313;
11-
const baseURL = `http://localhost:${port}`;
9+
// Use the environment variable for the base URL
10+
const baseURL = process.env.BASE_URL_TESTING;
1211

1312
/**
1413
* @see https://playwright.dev/docs/test-configuration

0 commit comments

Comments
 (0)