diff --git a/cypress/package-lock.json b/cypress/package-lock.json index c65edd1d41..03089c62be 100644 --- a/cypress/package-lock.json +++ b/cypress/package-lock.json @@ -1,11 +1,10 @@ { - "name": "Geotrek-admin", + "name": "cypress", "lockfileVersion": 2, "requires": true, "packages": { "": { "dependencies": { - "@foreachbe/cypress-tinymce": "^1.0.0", "cypress": "^9.5.1" } }, @@ -54,11 +53,6 @@ "ms": "^2.1.1" } }, - "node_modules/@foreachbe/cypress-tinymce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@foreachbe/cypress-tinymce/-/cypress-tinymce-1.0.0.tgz", - "integrity": "sha512-/uiJBAPtSp1gYdSd6SAOZ91EGk23458eL93R5tQFwsgmARy3KSHFzQQuJwCH1RFwLWZ/M2wc9a9knRA7httlKA==" - }, "node_modules/@types/node": { "version": "14.18.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", @@ -1822,11 +1816,6 @@ } } }, - "@foreachbe/cypress-tinymce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@foreachbe/cypress-tinymce/-/cypress-tinymce-1.0.0.tgz", - "integrity": "sha512-/uiJBAPtSp1gYdSd6SAOZ91EGk23458eL93R5tQFwsgmARy3KSHFzQQuJwCH1RFwLWZ/M2wc9a9knRA7httlKA==" - }, "@types/node": { "version": "14.18.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", diff --git a/cypress/package.json b/cypress/package.json index 3e4ab401d2..47c40ca88d 100644 --- a/cypress/package.json +++ b/cypress/package.json @@ -1,6 +1,5 @@ { "dependencies": { - "@foreachbe/cypress-tinymce": "^1.0.0", "cypress": "^9.5.1" } } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 7a3b3e8b20..9b6e5e749d 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -21,4 +21,18 @@ Cypress.Commands.add('loginByCSRF', (username, password) => { Cypress.Commands.add('mockTiles', (username, password) => { cy.intercept("https://*.tile.opentopomap.org/*/*/*.png", {fixture: "images/tile.png"}).as("tiles"); +}); + +Cypress.Commands.add('setTinyMceContent', (tinyMceId, content) => { + cy.window().then((win) => { + const editor = win.tinymce.get(tinyMceId); + editor.setContent(content); + }); +}); + +Cypress.Commands.add('getTinyMceContent', (tinyMceId, content) => { + cy.window().then((win) => { + const editor = win.tinymce.get(tinyMceId); + return editor.getContent(); + }); }); \ No newline at end of file diff --git a/cypress/support/index.js b/cypress/support/index.js index 767b6718c4..63268c1f34 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -17,5 +17,4 @@ import './commands' // Alternatively you can use CommonJS syntax: -// require('./commands') -import '@foreachbe/cypress-tinymce' \ No newline at end of file +// require('./commands') \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 5d079111c1..e68fd3d634 100644 --- a/requirements.txt +++ b/requirements.txt @@ -114,6 +114,7 @@ django==4.2.16 # django-leaflet # django-modelcluster # django-modeltranslation + # django-tinymce # django-treebeard # django-weasyprint # djangorestframework @@ -158,7 +159,7 @@ django-modeltranslation==0.18.11 # via mapentity django-mptt==0.14.0 # via geotrek (setup.py) -django-tinymce==3.5.0 +django-tinymce==4.1.0 # via mapentity django-treebeard==4.7.1 # via geotrek (setup.py)