Skip to content

Commit 3a6fc5e

Browse files
Merge pull request #20 from SundeepChand/tests/setup
Updated github actions to run Cypress tests
2 parents b7e1425 + b0c4495 commit 3a6fc5e

38 files changed

+315
-2284
lines changed

.github/workflows/github-ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,35 @@ jobs:
6464

6565
- name: Test JS
6666
run: npm run test:js
67+
68+
test_cypress:
69+
needs: cache_node_modules
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- name: Checkout repository code
74+
uses: actions/checkout@v2
75+
76+
- name: Run backend container
77+
run: docker-compose -f "docker-compose.test.yml" up -d --build
78+
79+
- name: Load node_modules
80+
id: cache-node-modules
81+
uses: actions/cache@v2
82+
with:
83+
path: node_modules
84+
key: node_modules-${{ hashFiles('package-lock.json') }}
85+
86+
- name: Install node_modules
87+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
88+
run: npm install
89+
90+
- name: Create config.json
91+
run: echo "$TEST_CONFIG_JSON" > src/config.json
92+
env:
93+
TEST_CONFIG_JSON: ${{ secrets.TEST_CONFIG_JSON }}
94+
95+
- name: Test Cypress
96+
uses: cypress-io/github-action@v2
97+
with:
98+
start: npm start

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ yarn-error.log*
3838
/cypress/fixtures
3939
/cypress/plugins
4040
cypress.env.json
41+
/cypress/screenshots
42+
/cypress/videos

cypress.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
{
2-
"baseUrl": "http://localhost:3000"
2+
"baseUrl": "http://localhost:3000",
3+
"env": {
4+
"testUsername": "user1",
5+
"testUserEmail": "[email protected]",
6+
"testUserPassword": "password",
7+
"testStoryTitle": "This is a test story",
8+
"testStoryProduct": "EOS Icons",
9+
"testCategory": "Documentation"
10+
},
11+
"testFiles": [
12+
"user_story.spec.js",
13+
"test_filters.spec.js"
14+
]
315
}

cypress/integration/examples/actions.spec.js

Lines changed: 0 additions & 313 deletions
This file was deleted.

0 commit comments

Comments
 (0)