1
0

Frontend Testing With Cypress (#313)

Wait until the request is finished

Wait for the newly created task exists in the dom

Wait until the login request is done

Wait until the list request is done

Make sure no user token is in local storage when trying to register

Make sure to always upload test results

Disable capturing videos of test runs in CI

Add uploading test result screenshots from ci

Assert a success notification is shown after creating a new list

Change input element locators

Fix testing for favorite lists

Make sure faked usernames are always random

Make sure the tests work

Make sure to use node 12 everywhere in ci

Add docs

Fix setting api url for running tests

Use a working node version

Ignore cypress screenshots and videos

Set cache folders

Explicitly ignore cypress files when running unit tests

Trigger Drone

Only run unit tests with yarn test:unit

Add serve dist command to serve built static files

Trigger Drone

Fix cypress image

Change cypress image

Unify test & build step back again to prevent double installation of dependencies

Add cache location config

Move test steps to separate pipeline

Run cypress tests in drone

Fix all tests

Make all factory methods static

Use factories everywhere

Cleanup

Add tests for the editor

Add tests for viewing link shares

Fix seed

Add test to make sure settings elements are hidden if the user does not have the right to edit the current list

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/313
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
This commit is contained in:
konrad
2020-12-10 13:52:35 +00:00
parent 1dcf4520a0
commit b822b3616b
41 changed files with 1907 additions and 39 deletions

View File

@ -1,5 +1,5 @@
kind: pipeline
name: testing
name: build
trigger:
branch:
@ -10,6 +10,13 @@ trigger:
- push
- pull_request
services:
- name: api
image: vikunja/api
environment:
VIKUNJA_SERVICE_TESTINGTOKEN: averyLongSecretToSe33dtheDB
VIKUNJA_LOG_LEVEL: DEBUG
steps:
- name: restore-cache
image: meltwater/drone-cache:dev
@ -30,11 +37,11 @@ steps:
- '.cache'
- name: dependencies
image: node:13
image: node:12
pull: true
group: build-static
environment:
YARN_CACHE_FOLDER: .cache
YARN_CACHE_FOLDER: .cache/yarn/
CYPRESS_CACHE_FOLDER: .cache/cypress/
commands:
- yarn --frozen-lockfile --network-timeout 100000
depends_on:
@ -61,26 +68,62 @@ steps:
- dependencies
- name: build
image: node:13
image: node:12
pull: true
group: build-static
environment:
YARN_CACHE_FOLDER: .cache
YARN_CACHE_FOLDER: .cache/yarn/
CYPRESS_CACHE_FOLDER: .cache/cypress/
commands:
- yarn run lint
- yarn run build
depends_on:
- dependencies
- name: test
image: node:13
- name: test-unit
image: node:12
pull: true
group: build-static
commands:
- yarn test
- yarn test:unit
depends_on:
- dependencies
- name: test-frontend
image: cypress/browsers:node12.18.3-chrome87-ff82
pull: true
environment:
CYPRESS_API_URL: http://api:3456/api/v1
CYPRESS_TEST_SECRET: averyLongSecretToSe33dtheDB
YARN_CACHE_FOLDER: .cache/yarn/
CYPRESS_CACHE_FOLDER: .cache/cypress/
commands:
- sed -i 's/localhost/api/g' public/index.html
- yarn serve & npx wait-on http://localhost:8080
- yarn test:frontend --browser chrome
depends_on:
- dependencies
- name: upload-test-results
image: plugins/s3:1
pull: true
settings:
bucket: drone-test-results
access_key:
from_secret: test_results_aws_access_key_id
secret_key:
from_secret: test_results_aws_secret_access_key
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
source: cypress/screenshots/**/**/*
strip_prefix: cypress/screenshots/
target: /${DRONE_REPO}/${DRONE_PULL_REQUEST}_${DRONE_BRANCH}/${DRONE_BUILD_NUMBER}/
depends_on:
- test-frontend
when:
status:
- failure
- success
---
kind: pipeline
name: release-latest
@ -116,7 +159,7 @@ steps:
- '.cache'
- name: build
image: node:13
image: node:12
pull: true
group: build-static
environment:
@ -186,7 +229,7 @@ steps:
- '.cache'
- name: build
image: node:13
image: node:12
pull: true
group: build-static
environment: