-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(#29): add e2e tests * chore(#29): update e2e job * chore(#29): add cypress tests * chore(#29): add artifact step
- Loading branch information
Showing
8 changed files
with
13,647 additions
and
42,707 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: test-e2e | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [14] | ||
|
||
steps: | ||
- name: Checkout 🛎 | ||
uses: actions/checkout@master | ||
|
||
- name: Setup node env 🏗 | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node }} | ||
check-latest: true | ||
|
||
- name: Get yarn cache directory path 🛠 | ||
id: yarn-cache-dir-path | ||
run: cd nuxt && echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Cache node_modules 📦 | ||
uses: actions/[email protected] | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Setup ddev | ||
uses: jonaseberle/github-action-setup-ddev@v1 | ||
with: | ||
autostart: false | ||
- name: Start ddev | ||
run: cd drupal && ddev start | ||
|
||
- name: Install Drupal 👨🏻💻 | ||
run: cd drupal && ddev drupal-install | ||
|
||
- name: Install Nuxt.js 👨🏻💻 | ||
run: cd nuxt && yarn | ||
|
||
# - name: Run linting 🔎 | ||
# run: cd nuxt && yarn lint | ||
|
||
# - name: Run Jest tests 🧪 | ||
# run: cd nuxt && yarn test:jest | ||
|
||
- name: Run end-to-end tests 🧪 | ||
run: cd nuxt && NODE_TLS_REJECT_UNAUTHORIZED=0 yarn test:e2e | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: cypress-screenshots | ||
path: nuxt/cypress/screenshots | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: cypress-videos | ||
path: nuxt/cypress/videos | ||
|
||
# - uses: codecov/codecov-action@v3 | ||
# with: | ||
# files: ./nuxt/coverage/clover.xml | ||
# name: codecov-umbrella | ||
# fail_ci_if_error: true | ||
# verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { defineConfig } = require("cypress"); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:3000', | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
it('Homepage', () => { | ||
cy.visit('/') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// *********************************************************** | ||
// This example support/e2e.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.