@eeacms/volto-group-block 4.3.7 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/RELEASE.md ADDED
@@ -0,0 +1,74 @@
1
+ ## Release
2
+
3
+ ### Automatic release using Jenkins
4
+
5
+ * The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
6
+ * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
7
+ * The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
8
+ * Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
9
+ * As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
10
+ * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
11
+ * You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
12
+ * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
13
+
14
+ ### Manual release from the develop branch ( beta release )
15
+
16
+ #### Installation and configuration of release-it
17
+
18
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
19
+
20
+ ```
21
+ npm install -g release-it
22
+ ```
23
+
24
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
25
+
26
+ Release-it is a tool that automates 4 important steps in the release process:
27
+
28
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
29
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
30
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
31
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
32
+
33
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
34
+
35
+ ```
36
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
37
+ ```
38
+
39
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
40
+
41
+ ```
42
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
43
+ ```
44
+
45
+ #### Using release-it tool
46
+
47
+ There are 3 yarn scripts that can be run to do the release
48
+
49
+ ##### yarn release-beta
50
+
51
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
52
+
53
+ ```
54
+ ? Select increment (next version):
55
+ ❯ prepatch (0.1.1-beta.0)
56
+ preminor (0.2.0-beta.0)
57
+ premajor (1.0.0-beta.0)
58
+ Other, please specify...
59
+ ```
60
+
61
+ ##### yarn release-major-beta
62
+
63
+ Same as `yarn release-beta`, but with premajor version pre-selected.
64
+
65
+ ##### yarn release
66
+
67
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
68
+
69
+ #### Important notes
70
+
71
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
72
+
73
+ > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
74
+
@@ -0,0 +1,17 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+ const presets = ['razzle'];
4
+ const plugins = [
5
+ [
6
+ 'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
7
+ {
8
+ messagesDir: './build/messages/',
9
+ },
10
+ ],
11
+ ];
12
+
13
+ return {
14
+ plugins,
15
+ presets,
16
+ };
17
+ };
@@ -0,0 +1,26 @@
1
+ const { defineConfig } = require('cypress');
2
+
3
+ module.exports = defineConfig({
4
+ viewportWidth: 1280,
5
+ defaultCommandTimeout: 8888,
6
+ chromeWebSecurity: false,
7
+ reporter: 'junit',
8
+ video: true,
9
+ retries: {
10
+ runMode: 8,
11
+ openMode: 0,
12
+ },
13
+ reporterOptions: {
14
+ mochaFile: 'cypress/reports/cypress-[hash].xml',
15
+ jenkinsMode: true,
16
+ toConsole: true,
17
+ },
18
+ e2e: {
19
+ setupNodeEvents(on, config) {
20
+ // e2e testing node events setup code
21
+ require('@cypress/code-coverage/task')(on, config);
22
+ return config;
23
+ },
24
+ baseUrl: 'http://localhost:3000',
25
+ },
26
+ });
@@ -9,18 +9,18 @@ module.exports = {
9
9
  '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
10
10
  '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
11
11
  '@package/(.*)$': '<rootDir>/src/$1',
12
+ '@root/(.*)$': '<rootDir>/src/$1',
12
13
  '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
13
14
  '@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
14
- 'volto-slate/(.*)$': '<rootDir>/src/addons/volto-slate/src/$1',
15
+ '@plone/volto-slate':
16
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
15
17
  '~/(.*)$': '<rootDir>/src/$1',
16
18
  'load-volto-addons':
17
19
  '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
20
+ '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
18
21
  },
19
22
  transform: {
20
23
  '^.+\\.js(x)?$': 'babel-jest',
21
- '^.+\\.css$': 'jest-css-modules',
22
- '^.+\\.less$': 'jest-css-modules',
23
- '^.+\\.scss$': 'jest-css-modules',
24
24
  '^.+\\.(png)$': 'jest-file',
25
25
  '^.+\\.(jpg)$': 'jest-file',
26
26
  '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-group-block",
3
- "version": "4.3.7",
3
+ "version": "5.0.0",
4
4
  "description": "volto-group-block: Volto block to be used to group other blocks",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -20,22 +20,28 @@
20
20
  },
21
21
  "dependencies": {},
22
22
  "devDependencies": {
23
- "@cypress/code-coverage": "^3.9.5",
24
- "babel-plugin-transform-class-properties": "^6.24.1"
23
+ "@plone/scripts": "*",
24
+ "@cypress/code-coverage": "^3.10.0",
25
+ "babel-plugin-transform-class-properties": "^6.24.1",
26
+ "md5": "^2.3.0"
25
27
  },
26
28
  "scripts": {
27
29
  "release": "release-it",
28
30
  "release-major-beta": "release-it major --preRelease=beta",
29
31
  "release-beta": "release-it --preRelease=beta",
30
32
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
31
- "stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
32
- "stylelint:overrides": "../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
33
- "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
34
- "prettier": "../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'",
35
- "prettier:fix": "../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'",
36
- "lint": "../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'",
37
- "lint:fix": "../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'",
38
- "cypress:run": "../../../node_modules/cypress/bin/cypress run",
39
- "cypress:open": "../../../node_modules/cypress/bin/cypress open"
33
+ "test": "make test",
34
+ "test:fix": "make test-update",
35
+ "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
36
+ "stylelint": "make stylelint",
37
+ "stylelint:overrides": "make stylelint-overrides",
38
+ "stylelint:fix": "make stylelint-fix",
39
+ "prettier": "make prettier",
40
+ "prettier:fix": "make prettier-fix",
41
+ "lint": "make lint",
42
+ "lint:fix": "make lint-fix",
43
+ "i18n": "make i18n",
44
+ "cypress:run": "make cypress-run",
45
+ "cypress:open": "make cypress-open"
40
46
  }
41
47
  }
package/Jenkinsfile DELETED
@@ -1,242 +0,0 @@
1
- pipeline {
2
- agent any
3
-
4
- environment {
5
- GIT_NAME = "volto-group-block"
6
- NAMESPACE = "@eeacms"
7
- SONARQUBE_TAGS = "volto.eea.europa.eu,forest.eea.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,biodiversity.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu"
8
- DEPENDENCIES = ""
9
- VOLTO = "16.0.0-alpha.14"
10
- }
11
-
12
- stages {
13
-
14
- stage('Release') {
15
- when {
16
- allOf {
17
- environment name: 'CHANGE_ID', value: ''
18
- branch 'master'
19
- }
20
- }
21
- steps {
22
- node(label: 'docker') {
23
- withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
24
- sh '''docker pull eeacms/gitflow'''
25
- sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow'''
26
- }
27
- }
28
- }
29
- }
30
-
31
- stage('Code') {
32
- when {
33
- allOf {
34
- environment name: 'CHANGE_ID', value: ''
35
- not { changelog '.*^Automated release [0-9\\.]+$' }
36
- not { branch 'master' }
37
- }
38
- }
39
- steps {
40
- parallel(
41
-
42
- "ES lint": {
43
- node(label: 'docker') {
44
- sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci eslint'''
45
- }
46
- },
47
-
48
- "Style lint": {
49
- node(label: 'docker') {
50
- sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci stylelint'''
51
- }
52
- },
53
-
54
- "Prettier": {
55
- node(label: 'docker') {
56
- sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci prettier'''
57
- }
58
- }
59
- )
60
- }
61
- }
62
-
63
- stage('Tests') {
64
- when {
65
- allOf {
66
- environment name: 'CHANGE_ID', value: ''
67
- anyOf {
68
- not { changelog '.*^Automated release [0-9\\.]+$' }
69
- branch 'master'
70
- }
71
- }
72
- }
73
- steps {
74
- parallel(
75
-
76
- "Volto": {
77
- node(label: 'docker') {
78
- script {
79
- try {
80
- sh '''docker pull plone/volto-addon-ci'''
81
- sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci'''
82
- sh '''rm -rf xunit-reports'''
83
- sh '''mkdir -p xunit-reports'''
84
- sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/coverage xunit-reports/'''
85
- sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/junit.xml xunit-reports/'''
86
- sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/unit_tests_log.txt xunit-reports/'''
87
- stash name: "xunit-reports", includes: "xunit-reports/**"
88
- archiveArtifacts artifacts: "xunit-reports/unit_tests_log.txt", fingerprint: true
89
- publishHTML (target : [
90
- allowMissing: false,
91
- alwaysLinkToLastBuild: true,
92
- keepAll: true,
93
- reportDir: 'xunit-reports/coverage/lcov-report',
94
- reportFiles: 'index.html',
95
- reportName: 'UTCoverage',
96
- reportTitles: 'Unit Tests Code Coverage'
97
- ])
98
- } finally {
99
- catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
100
- junit testResults: 'xunit-reports/junit.xml', allowEmptyResults: true
101
- }
102
- sh script: '''docker rm -v $BUILD_TAG-volto''', returnStatus: true
103
- }
104
- }
105
- }
106
- }
107
- )
108
- }
109
- }
110
-
111
- stage('Integration tests') {
112
- when {
113
- allOf {
114
- environment name: 'CHANGE_ID', value: ''
115
- anyOf {
116
- not { changelog '.*^Automated release [0-9\\.]+$' }
117
- branch 'master'
118
- }
119
- }
120
- }
121
- steps {
122
- parallel(
123
-
124
- "Cypress": {
125
- node(label: 'docker') {
126
- script {
127
- try {
128
- sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
129
- sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci cypress'''
130
- } finally {
131
- try {
132
- sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
133
- sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
134
- sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
135
- sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
136
- coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
137
- if ( coverage == 0 ) {
138
- publishHTML (target : [allowMissing: false,
139
- alwaysLinkToLastBuild: true,
140
- keepAll: true,
141
- reportDir: 'cypress-coverage/coverage/lcov-report',
142
- reportFiles: 'index.html',
143
- reportName: 'CypressCoverage',
144
- reportTitles: 'Integration Tests Code Coverage'])
145
- }
146
- sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
147
- archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
148
- stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
149
- }
150
- finally {
151
- catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
152
- junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
153
- }
154
- sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
155
- sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
156
- sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
157
-
158
- }
159
- }
160
- }
161
- }
162
- }
163
-
164
- )
165
- }
166
- }
167
-
168
- stage('Report to SonarQube') {
169
- when {
170
- allOf {
171
- environment name: 'CHANGE_ID', value: ''
172
- anyOf {
173
- branch 'master'
174
- allOf {
175
- branch 'develop'
176
- not { changelog '.*^Automated release [0-9\\.]+$' }
177
- }
178
- }
179
- }
180
- }
181
- steps {
182
- node(label: 'swarm') {
183
- script{
184
- checkout scm
185
- unstash "xunit-reports"
186
- unstash "cypress-coverage"
187
- def scannerHome = tool 'SonarQubeScanner';
188
- def nodeJS = tool 'NodeJS';
189
- withSonarQubeEnv('Sonarqube') {
190
- sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
191
- sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
192
- sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
193
- }
194
- }
195
- }
196
- }
197
- }
198
-
199
- stage('Pull Request') {
200
- when {
201
- not {
202
- environment name: 'CHANGE_ID', value: ''
203
- }
204
- environment name: 'CHANGE_TARGET', value: 'master'
205
- }
206
- steps {
207
- node(label: 'docker') {
208
- script {
209
- if ( env.CHANGE_BRANCH != "develop" ) {
210
- error "Pipeline aborted due to PR not made from develop branch"
211
- }
212
- withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
213
- sh '''docker pull eeacms/gitflow'''
214
- sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-pr" -e GIT_CHANGE_TARGET="$CHANGE_TARGET" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e LANGUAGE=javascript eeacms/gitflow'''
215
- }
216
- }
217
- }
218
- }
219
- }
220
-
221
- }
222
-
223
- post {
224
- always {
225
- cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
226
- }
227
- changed {
228
- script {
229
- def details = """<h1>${env.JOB_NAME} - Build #${env.BUILD_NUMBER} - ${currentBuild.currentResult}</h1>
230
- <p>Check console output at <a href="${env.BUILD_URL}/display/redirect">${env.JOB_BASE_NAME} - #${env.BUILD_NUMBER}</a></p>
231
- """
232
- emailext(
233
- subject: '$DEFAULT_SUBJECT',
234
- body: details,
235
- attachLog: true,
236
- compressLog: true,
237
- recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'CulpritsRecipientProvider']]
238
- )
239
- }
240
- }
241
- }
242
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "Using fixtures to represent data",
3
- "email": "hello@cypress.io",
4
- "body": "Fixtures are a great way to mock data for responses to routes"
5
- }
@@ -1,43 +0,0 @@
1
- import { setupBeforeEach, tearDownAfterEach } from '../support';
2
-
3
- describe('Blocks Tests', () => {
4
- beforeEach(setupBeforeEach);
5
- afterEach(tearDownAfterEach);
6
-
7
- it('Add Block: Empty', () => {
8
- // without this the clear command below does nothing sometimes
9
- cy.wait(500);
10
-
11
- // Change page title
12
- cy.get('[contenteditable=true]').first().clear();
13
-
14
- cy.get('[contenteditable=true]').first().type('My Add-on Page');
15
-
16
- cy.get('.documentFirstHeading').contains('My Add-on Page');
17
-
18
- cy.get('[contenteditable=true]').first().type('{enter}');
19
-
20
- // Add block
21
- cy.get('.ui.basic.icon.button.block-add-button').first().click();
22
- cy.get('.blocks-chooser .title').contains('Common').click();
23
- cy.get('.content.active.common .button.group').contains('Group').click();
24
-
25
- cy.get('.block-editor-group [contenteditable=true]').focus().click().type('test{enter}');
26
- cy.get('.block-editor-group [contenteditable=true]').eq(1).focus().click().type('test2{enter}');
27
- cy.get('.block-editor-group [contenteditable=true]').eq(1).focus().click().type('test3');
28
-
29
- cy.get('.block-toolbar svg')
30
- .first()
31
- .trigger('mousedown', { button: 0 })
32
- .trigger('mousemove', 10, -40, { force: true })
33
- .trigger('mouseup', 10, -40, { force: true });
34
-
35
- // Save
36
- cy.get('#toolbar-save').click();
37
- cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');
38
-
39
- // then the page view should contain our changes
40
- cy.contains('My Add-on Page');
41
- cy.contains('test2');
42
- });
43
- });
@@ -1,26 +0,0 @@
1
- /// <reference types="cypress" />
2
- // ***********************************************************
3
- // This example plugins/index.js can be used to load plugins
4
- //
5
- // You can change the location of this file or turn off loading
6
- // the plugins file with the 'pluginsFile' configuration option.
7
- //
8
- // You can read more here:
9
- // https://on.cypress.io/plugins-guide
10
- // ***********************************************************
11
-
12
- // This function is called when a project is opened or re-opened (e.g. due to
13
- // the project's config changing)
14
-
15
- /**
16
- * @type {Cypress.PluginConfig}
17
- */
18
- module.exports = (on, config) => {
19
- // `on` is used to hook into various events Cypress emits
20
- // `config` is the resolved Cypress config
21
- /* coverage-start
22
- require('@cypress/code-coverage/task')(on, config)
23
- on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'))
24
- return config
25
- coverage-end */
26
- };