Skip to content

Commit f97b5e8

Browse files
authored
Add npm lint to ui tests maven build (#1184)
1 parent 276dc34 commit f97b5e8

File tree

8 files changed

+2324
-31
lines changed

8 files changed

+2324
-31
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@
164164
165165
<profiles>
166166
<!--
167-
Profile for only executing the basic integration tests (without frondend modules, because they increase the build time
168-
significantly)
167+
Profile for only executing the basic integration tests (without frontend modules,
168+
because they increase the build time significantly)
169169
-->
170170
<profile>
171171
<id>it-basic</id>

src/main/archetype/ui.tests.cypress/pom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,49 @@
9494
</build>
9595

9696
<profiles>
97+
<profile>
98+
<id>ui-tests-check</id>
99+
<activation>
100+
<activeByDefault>true</activeByDefault>
101+
</activation>
102+
<build>
103+
<plugins>
104+
<plugin>
105+
<groupId>com.github.eirslett</groupId>
106+
<artifactId>frontend-maven-plugin</artifactId>
107+
<version>${frontend-maven-plugin.version}</version>
108+
<executions>
109+
<execution>
110+
<id>install node and npm</id>
111+
<phase>validate</phase>
112+
<goals>
113+
<goal>install-node-and-npm</goal>
114+
</goals>
115+
<configuration>
116+
<nodeVersion>v18.14.2</nodeVersion>
117+
<npmVersion>9.5.0</npmVersion>
118+
<installDirectory>test-module</installDirectory>
119+
</configuration>
120+
</execution>
121+
<execution>
122+
<id>lint</id>
123+
<phase>test</phase>
124+
<goals>
125+
<goal>npm</goal>
126+
</goals>
127+
<configuration>
128+
<arguments>run lint</arguments>
129+
</configuration>
130+
</execution>
131+
</executions>
132+
<configuration>
133+
<workingDirectory>test-module</workingDirectory>
134+
</configuration>
135+
</plugin>
136+
</plugins>
137+
</build>
138+
</profile>
139+
97140
<profile>
98141
<id>ui-tests-docker-build</id>
99142
<activation>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
"plugins": [
3+
"cypress",
4+
"chai-friendly"
5+
],
6+
"extends": [
7+
"plugin:cypress/recommended"
8+
],
9+
"rules": {
10+
"no-unused-expressions": 0,
11+
"chai-friendly/no-unused-expressions": 2
12+
}
13+
}

src/main/archetype/ui.tests.cypress/test-module/cypress/e2e/assets.cy.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ describe('AEM Assets', () => {
3838
cy.visit(`${Cypress.env('AEM_AUTHOR_URL')}/assets.html${assetsPath}`);
3939

4040
// Wait for any lazy loaded dialogs to appear
41+
/* eslint-disable cypress/no-unnecessary-waiting */
4142
cy.wait(3000)
4243

4344

@@ -47,7 +48,8 @@ describe('AEM Assets', () => {
4748
cy.get('dam-chunkfileupload.dam-ChunkFileUpload > input').first().selectFile(localPath, {force: true})
4849

4950
// rename image
50-
cy.get('input#dam-asset-upload-rename-input').clear().type(remoteImageName, {force: true});
51+
cy.get('input#dam-asset-upload-rename-input').clear()
52+
cy.type(remoteImageName, {force: true});
5153

5254
// Press the upload button.
5355
cy.get('coral-dialog.is-open coral-dialog-footer [variant="primary"]').click({force: true});
@@ -63,6 +65,7 @@ describe('AEM Assets', () => {
6365
});
6466

6567
// Wait before deletion as immediate deletion may fail
68+
/* eslint-disable cypress/no-unnecessary-waiting */
6669
cy.wait(3000)
6770

6871
// Delete Asset

src/main/archetype/ui.tests.cypress/test-module/cypress/support/commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ Cypress.Commands.add('AEMDeleteAsset', function (assetPath) {
6464
const form = new FormData();
6565
form.append('cmd', 'deletePage');
6666
form.append('path', assetPath);
67-
form.append('force', 'true'),
68-
form.append('_charset_', 'utf-8');
67+
form.append('force', 'true');
68+
form.append('_charset_', 'utf-8');
6969

7070
const body = {
7171
cmd: 'deletePage',

0 commit comments

Comments
 (0)