mirror of
https://github.com/logseq/logseq.git
synced 2026-04-25 06:35:02 +00:00
test: cypress scaffolding
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -34,3 +34,4 @@ resources/electron.js
|
||||
/libs/dist/
|
||||
charlie/
|
||||
.vscode
|
||||
/.preprocessor-cljs
|
||||
|
||||
1
cypress.json
Normal file
1
cypress.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
5
cypress/fixtures/example.json
Normal file
5
cypress/fixtures/example.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "Using fixtures to represent data",
|
||||
"email": "hello@cypress.io",
|
||||
"body": "Fixtures are a great way to mock data for responses to routes"
|
||||
}
|
||||
10
cypress/integration/app/window.cljs
Normal file
10
cypress/integration/app/window.cljs
Normal file
@@ -0,0 +1,10 @@
|
||||
(ns app.window
|
||||
(:require-macros [latte.core :refer [describe beforeEach it]]))
|
||||
|
||||
(def cy js/cy)
|
||||
|
||||
(describe "Window"
|
||||
(beforeEach []
|
||||
(.visit cy "https://example.cypress.io/commands/window"))
|
||||
(it "cy.window() - get the global window object" []
|
||||
(.should (.window cy) "have.property" "top")))
|
||||
7
cypress/plugins/index.js
Normal file
7
cypress/plugins/index.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const makeCljsPreprocessor = require('cypress-clojurescript-preprocessor');
|
||||
/**
|
||||
* @type {Cypress.PluginConfig}
|
||||
*/
|
||||
module.exports = (on, config) => {
|
||||
on('file:preprocessor', makeCljsPreprocessor(config));
|
||||
};
|
||||
25
cypress/support/commands.js
Normal file
25
cypress/support/commands.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add('login', (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
20
cypress/support/index.js
Normal file
20
cypress/support/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// ***********************************************************
|
||||
// This example support/index.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
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
@@ -9,6 +9,7 @@
|
||||
"@types/gulp": "^4.0.7",
|
||||
"cross-env": "^7.0.3",
|
||||
"cssnano": "^4.1.10",
|
||||
"cypress": "^7.5.0",
|
||||
"del": "^6.0.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-clean-css": "^4.3.0",
|
||||
@@ -35,6 +36,7 @@
|
||||
"dev-electron-app": "gulp electron",
|
||||
"release-electron": "run-s gulp:build && gulp electronMaker",
|
||||
"debug-electron": "cd static/ && yarn electron:debug",
|
||||
"e2e-test": "./node_modules/.bin/cypress open",
|
||||
"clean": "gulp clean",
|
||||
"test": "run-s cljs:test cljs:run-test",
|
||||
"report": "run-s cljs:report",
|
||||
@@ -65,6 +67,7 @@
|
||||
"chokidar": "^3.5.1",
|
||||
"chrono-node": "^2.2.4",
|
||||
"codemirror": "^5.58.1",
|
||||
"cypress-clojurescript-preprocessor": "^0.1.4",
|
||||
"diff": "5.0.0",
|
||||
"diff-match-patch": "^1.0.5",
|
||||
"electron": "^13.0.0",
|
||||
|
||||
Reference in New Issue
Block a user