diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 4c53acc..9eed2bc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -39,7 +39,9 @@ jobs: - name: Build and push Docker images uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: - context: ./server/ + context: | + ./server/ + ./ui/ push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 76b1ee0..3cb6b81 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -72,6 +72,51 @@ jobs: path: | coverage + test-ui-integration: + runs-on: ubuntu-latest + needs: [build] + + strategy: + matrix: + mongodb-version: [4.2] + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Start MongoDB v${{ matrix.mongodb-version }} + uses: supercharge/mongodb-github-action@1.2.0 + with: + mongodb-version: ${{ matrix.mongodb-version }} + + - name: UI - install packages + run: | + npm i --prefix server + npm i --prefix ui + + - name: Cypress run + uses: cypress-io/github-action@v3 + with: + browser: chrome + working-directory: ui + config-file: cypress.json + start: | + npm start --prefix ../server + npm run serve --prefix + wait-on: 'http://localhost:8080' + + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: cypress-screenshots + path: ui/tests/e2e/screenshots/ + + - uses: actions/upload-artifact@v2 + if: always() + with: + name: cypress-videos + path: ui/tests/e2e/videos/ + test-server: runs-on: ubuntu-latest needs: [build] @@ -130,7 +175,7 @@ jobs: deploy: runs-on: ubuntu-latest - needs: [test-server,test-ui-unit] + needs: [test-server,test-ui-unit,test-ui-integration] if: >- github.event_name == 'pull_request' diff --git a/ui/cypress.json b/ui/cypress.json index 612024c..4513da2 100644 --- a/ui/cypress.json +++ b/ui/cypress.json @@ -1,5 +1,4 @@ { "pluginsFile": "tests/e2e/plugins/index.js", - "baseUrl": "http://localhost:8080/", - "testFiles": "**/*.test.js" + "baseUrl": "http://localhost:8080/" } diff --git a/ui/tests/e2e/plugins/index.js b/ui/tests/e2e/plugins/index.js index a18eab8..3ce3c6c 100644 --- a/ui/tests/e2e/plugins/index.js +++ b/ui/tests/e2e/plugins/index.js @@ -1,10 +1,8 @@ module.exports = (on, config) => { - - return Object.assign({}, config, { - fixturesFolder: 'tests/e2e/fixtures', - integrationFolder: 'tests/e2e/tests', - screenshotsFolder: 'tests/e2e/screenshots', - videosFolder: 'tests/e2e/videos', - supportFile: 'tests/e2e/support/index.js' - }) -} + return Object.assign({}, config, { + fixturesFolder: "tests/e2e/fixtures", + integrationFolder: "tests/e2e/tests", + screenshotsFolder: "tests/e2e/screenshots", + videosFolder: "tests/e2e/videos", + }); +}; diff --git a/ui/tests/e2e/tests/mybills.test.js b/ui/tests/e2e/tests/mybills.spec.js similarity index 100% rename from ui/tests/e2e/tests/mybills.test.js rename to ui/tests/e2e/tests/mybills.spec.js diff --git a/ui/tests/e2e/tests/navbar.test.js b/ui/tests/e2e/tests/navbar.spec.js similarity index 100% rename from ui/tests/e2e/tests/navbar.test.js rename to ui/tests/e2e/tests/navbar.spec.js diff --git a/ui/tests/e2e/tests/routes.test.js b/ui/tests/e2e/tests/routes.spec.js similarity index 100% rename from ui/tests/e2e/tests/routes.test.js rename to ui/tests/e2e/tests/routes.spec.js