diff --git a/cypress.json b/cypress.json
new file mode 100644
index 0000000..59049e5
--- /dev/null
+++ b/cypress.json
@@ -0,0 +1,5 @@
+{
+ "supportFile": "cypress/support/index.ts",
+ "fixturesFolder": false,
+ "baseUrl": "http://czydojade.localhost:8080"
+}
\ No newline at end of file
diff --git a/cypress/integration/start.spec.ts b/cypress/integration/start.spec.ts
new file mode 100644
index 0000000..6e8abd6
--- /dev/null
+++ b/cypress/integration/start.spec.ts
@@ -0,0 +1,10 @@
+describe("The Start Page", () => {
+ it("Sucessfully Loads", () => {
+ cy.visit('/dummy');
+ });
+
+ it("Allows to open favourites window", () => {
+ cy.get('#open_favourites_picker').click();
+ cy.get('#favourites_list').should('exist');
+ })
+});
\ No newline at end of file
diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js
new file mode 100644
index 0000000..096cff1
--- /dev/null
+++ b/cypress/plugins/index.js
@@ -0,0 +1,9 @@
+const wp = require('@cypress/webpack-preprocessor');
+
+module.exports = (on) => {
+ const options = {
+ webpackOptions: require('../webpack.config'),
+ };
+
+ on('file:preprocessor', wp(options))
+};
diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts
new file mode 100644
index 0000000..ca4d256
--- /dev/null
+++ b/cypress/support/commands.ts
@@ -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) => { ... })
diff --git a/cypress/support/index.ts b/cypress/support/index.ts
new file mode 100644
index 0000000..bd55847
--- /dev/null
+++ b/cypress/support/index.ts
@@ -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.ts using ES2015 syntax:
+import './commands'
+
+// Alternatively you can use CommonJS syntax:
+// require('./commands')
diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json
new file mode 100644
index 0000000..10c3867
--- /dev/null
+++ b/cypress/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "extends": "../tsconfig",
+ "compilerOptions": {
+ "strict": true,
+ "baseUrl": "../node_modules",
+ "target": "es5",
+ "lib": ["es5", "dom"],
+ "types": ["cypress"],
+ "paths": {
+ "@app/*": ["../resources/ts/*"]
+ }
+ },
+ "include": ["**/*.ts"]
+}
\ No newline at end of file
diff --git a/cypress/webpack.config.js b/cypress/webpack.config.js
new file mode 100644
index 0000000..6412fc2
--- /dev/null
+++ b/cypress/webpack.config.js
@@ -0,0 +1,26 @@
+module.exports = {
+ mode: 'development',
+ // webpack will transpile TS and JS files
+ resolve: {
+ extensions: ['.ts', '.js']
+ },
+ module: {
+ rules: [
+ {
+ // every time webpack sees a TS file (except for node_modules)
+ // webpack will use "ts-loader" to transpile it to JavaScript
+ test: /\.ts$/,
+ exclude: [/node_modules/],
+ use: [
+ {
+ loader: 'ts-loader',
+ options: {
+ // skip typechecking for speed
+ transpileOnly: true,
+ }
+ }
+ ]
+ }
+ ]
+ }
+};
diff --git a/package.json b/package.json
index 871b219..45778c3 100644
--- a/package.json
+++ b/package.json
@@ -34,13 +34,18 @@
"xpath": "^0.0.27"
},
"dependencies": {
+ "@cypress/webpack-preprocessor": "^4.1.1",
"babel-minify-webpack-plugin": "^0.3.1",
"copy-webpack-plugin": "^4.5.2",
+ "cypress": "^3.7.0",
"imagemin-webpack-plugin": "^2.3.0",
"mini-css-extract-plugin": "^0.4.2",
"vue2-leaflet": "^1.0.2",
"vuex": "^3.0.1",
"vuex-class": "^0.3.1",
"workbox-webpack-plugin": "^4.3.1"
+ },
+ "scripts": {
+ "cypress": "cypress open"
}
}
diff --git a/templates/app.html.twig b/templates/app.html.twig
index 497f9cf..a58a26d 100644
--- a/templates/app.html.twig
+++ b/templates/app.html.twig
@@ -116,7 +116,7 @@
Wybierz przystanki
-