Skip to content

Commit 91cf839

Browse files
authored
Merge pull request #71 from lukem235/SITES-26731-simple-test-app
Simple test app
2 parents 0022a3c + d3bb23b commit 91cf839

40 files changed

+39156
-0
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: E2E Tests
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
e2e-tests:
7+
name: Run E2E Tests with TestCafe
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
host-app-version: [ "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.9.0", "0.9.1", "0.9.2", "0.10.0","0.10.1", "0.10.2","0.10.3","0.10.4", "latest" ]
13+
guest-app-version: [ "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.9.0", "0.9.1", "0.9.2", "0.10.0","0.10.1", "0.10.2","0.10.3","0.10.4", "latest" ]
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18' # Adjust this as per project requirements
23+
24+
- name: Install Dependencies for Host App
25+
working-directory: e2e/host-app
26+
run: |
27+
npm install @adobe/uix-host-react@${{ matrix.host-app-version }}
28+
npm install
29+
30+
- name: Install Dependencies for Guest App
31+
working-directory: e2e/guest-app
32+
33+
run: |
34+
npm install @adobe/uix-guest@${{ matrix.guest-app-version }}
35+
npm install
36+
37+
- name: Start Host App
38+
working-directory: e2e/host-app
39+
run: |
40+
npm start &
41+
42+
- name: Start Guest App
43+
working-directory: e2e/guest-app
44+
run: |
45+
npm start &
46+
47+
- name: Wait for Applications to be Ready
48+
run: |
49+
echo "Waiting for services to start..."
50+
sleep 10 # Adjust the time based on how long the apps take to start
51+
52+
- name: Run E2E Tests with TestCafe
53+
working-directory: e2e/e2e-tests
54+
run: |
55+
npm install
56+
npm test
57+
58+

e2e/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

e2e/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# UIX SDK end-to-end tests
2+
3+
To run the end-to-end tests locally, you need to do the following:
4+
5+
- cd to host-app folder
6+
```bash
7+
npm install
8+
npm start
9+
```
10+
11+
- cd to guest-app folder
12+
```bash
13+
npm install
14+
npm start
15+
```
16+
17+
- cd to e2e-tests folder
18+
```bash
19+
npm install
20+
npm test
21+
```
22+
23+
The end-to-end tests will run, and you will see the results in the console.
24+
25+
The host-app and guest-app have the last version of the sdk installed.
26+
27+
To test any new version of the sdk, you need to update the matrix in the `root/.github/workflows/e2e-tests.yml` file adding the new version.
28+
29+
```yaml
30+
strategy:
31+
matrix:
32+
host-app-version: [ "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.9.0", "0.9.1", "0.9.2", "0.10.0","0.10.1", "0.10.2","0.10.3","0.10.4", "latest" ]
33+
guest-app-version: [ "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.9.0", "0.9.1", "0.9.2", "0.10.0","0.10.1", "0.10.2","0.10.3","0.10.4", "latest" ]
34+
35+
```

e2e/e2e-tests/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
/artifacts
8+
9+
# testing
10+
/coverage
11+
12+
# production
13+
/build
14+
15+
# misc
16+
.DS_Store
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

e2e/e2e-tests/.testcaferc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"src": "./tests/**/*.js",
3+
"browsers": ["chrome:headless"],
4+
"baseUrl": "http://localhost:3000",
5+
"hostname": "localhost",
6+
"screenshots": {
7+
"path": "./artifacts/screenshots/",
8+
"takeOnFails": true,
9+
"fullPage": true
10+
},
11+
"reporter": "spec",
12+
"speed": 0.2,
13+
"debugMode": false,
14+
"debugOnFail": true,
15+
"stopOnFirstFail": true,
16+
"selectorTimeout": 5000,
17+
"assertionTimeout": 10000,
18+
"pageLoadTimeout": 10000,
19+
"pageRequestTimeout": 80000
20+
}

0 commit comments

Comments
 (0)