Skip to content

Commit

Permalink
Add npm lint to ui tests maven build
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvac committed Apr 8, 2024
1 parent 863d4f3 commit 9e7fd8a
Show file tree
Hide file tree
Showing 8 changed files with 2,324 additions and 31 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
<profiles>
<!--
Profile for only executing the basic integration tests (without frondend modules, because they increase the build time
significantly)
Profile for only executing the basic integration tests (without frontend modules,
because they increase the build time significantly)
-->
<profile>
<id>it-basic</id>
Expand Down
43 changes: 43 additions & 0 deletions src/main/archetype/ui.tests.cypress/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,49 @@
</build>

<profiles>
<profile>
<id>ui-tests-check</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
<executions>
<execution>
<id>install node and npm</id>
<phase>validate</phase>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v18.14.2</nodeVersion>
<npmVersion>9.5.0</npmVersion>
<installDirectory>test-module</installDirectory>
</configuration>
</execution>
<execution>
<id>lint</id>
<phase>test</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run lint</arguments>
</configuration>
</execution>
</executions>
<configuration>
<workingDirectory>test-module</workingDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>ui-tests-docker-build</id>
<activation>
Expand Down
13 changes: 13 additions & 0 deletions src/main/archetype/ui.tests.cypress/test-module/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
"plugins": [
"cypress",
"chai-friendly"
],
"extends": [
"plugin:cypress/recommended"
],
"rules": {
"no-unused-expressions": 0,
"chai-friendly/no-unused-expressions": 2
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe('AEM Assets', () => {
cy.visit(`${Cypress.env('AEM_AUTHOR_URL')}/assets.html${assetsPath}`);

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


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

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

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

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

// Delete Asset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Cypress.Commands.add('AEMDeleteAsset', function (assetPath) {
const form = new FormData();
form.append('cmd', 'deletePage');
form.append('path', assetPath);
form.append('force', 'true'),
form.append('_charset_', 'utf-8');
form.append('force', 'true');
form.append('_charset_', 'utf-8');

const body = {
cmd: 'deletePage',
Expand Down
Loading

0 comments on commit 9e7fd8a

Please sign in to comment.