Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use cypress to build app
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
  • Loading branch information
skjnldsv committed Sep 2, 2020
commit 43573a464f4ec8fdadbe3f82a08247934d4dbd87
7 changes: 2 additions & 5 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies & build app
run: |
npm ci
TESTING=true npm run build --if-present

- name: Wait for server
run: |
npm install -g wait-on
Expand All @@ -60,13 +55,15 @@ jobs:
with:
record: true
parallel: true
build: npm run build
# cypress env
ci-build-id: ${{ github.sha }}-${{ github.run_number }}
tag: ${{ github.event_name }}
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# https://github.com/cypress-io/github-action/issues/124
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
TESTING: true

- name: Upload snapshots
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ vendor
.php_cs.cache

# Cypress files
js/*roboto*
cypress/videos
cypress/screenshots
cypress/snapshots/actual
Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/files-shares.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/files.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'

describe('Files default view', function() {
before(function() {
Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/image-small.png.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/image.gif.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/image.png.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/image.svg.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/images-custom-list-loadmore.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/images-custom-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/images.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/sidebar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/video.mkv.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/video.mp4.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/video.ogv.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/video.webm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/videos.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

// Import font so CI has the same
import '!url-loader!style-loader!css-loader?fontsource-roboto'
import { randHash } from '../utils/'
const randUser = randHash()

Expand Down
Binary file modified cypress/snapshots/base/files-shares.spec.js/files-1-base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ __webpack_nonce__ = btoa(OC.requestToken)
// eslint-disable-next-line
__webpack_public_path__ = generateFilePath('viewer', '', 'js/')

// Inject proper font for cypress visual regression testing
if (isTesting) {
// Import font so CI has the same
import(/* webpackChunkName: 'roboto-font' */'fontsource-roboto')
}

// Init Viewer Service
if (window.OCA) {
Object.assign(window.OCA, { Viewer: new ViewerService() })
Expand Down