Skip to content
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f4db4fc
Add initial skeleton for UI Tests
bdhoine Nov 16, 2024
56bf9ce
Add build for UI tests
bdhoine Nov 23, 2024
004ba10
Add credentials for private container pull
bdhoine Nov 23, 2024
ea278ff
Use correct image
bdhoine Nov 23, 2024
089b16f
Remove needs for testing
bdhoine Nov 23, 2024
03f9eba
Add config for aem host
bdhoine Nov 23, 2024
3395227
Test connectivity
bdhoine Nov 23, 2024
e68c0c1
Make sure build does not fail
bdhoine Nov 23, 2024
742af20
Print docker logs
bdhoine Nov 23, 2024
c6a0145
Retry with new image with correct amd64 binary
bdhoine Nov 23, 2024
f89efe4
Try with config for package read without credentials
bdhoine Nov 23, 2024
e06b050
Add full build definition
bdhoine Nov 23, 2024
12313db
Cache playwright binaries
bdhoine Nov 24, 2024
30f3b86
Make mvn commands less verbose
bdhoine Nov 24, 2024
7002d3e
Update action versions
bdhoine Nov 24, 2024
e0d1372
Add report as artifact
bdhoine Nov 25, 2024
d38e141
Use correct artifact path
bdhoine Nov 25, 2024
0dcf30f
Add basic test
bdhoine Nov 25, 2024
9bf395d
Add auth setup
bdhoine Nov 25, 2024
22032dd
Enable typescript-eslint again
bdhoine Nov 25, 2024
fdad268
Add test dictionary and test to create dictionaries
bdhoine Nov 25, 2024
5b098f1
Test page object models
bdhoine Nov 25, 2024
7eee30a
WIP
bdhoine Nov 27, 2024
5c42046
Update tests with new locators
bdhoine Dec 9, 2024
8b5c633
Clear replication queue and add basic auth headers
bdhoine Dec 9, 2024
a2b864e
Add comments for tests
bdhoine Dec 9, 2024
cc580d3
Add setup step
bdhoine Dec 9, 2024
38123f5
Use default 30s timeout for initial AEM slowlyness
bdhoine Dec 9, 2024
85f2019
Hide product tour before starting tests
bdhoine Dec 9, 2024
2653d59
Merge branch 'main' into ui-tests
bdhoine Dec 9, 2024
3db711a
Add dependabot for npm packages
bdhoine Dec 9, 2024
895400e
Fix reference to preferences and lower test timeout
bdhoine Dec 9, 2024
08f18dd
Update dependencies and increate timeout for login
bdhoine Dec 10, 2024
60aa6dd
Add logs as artifact
bdhoine Dec 10, 2024
d142aea
Update artifact upload steps config
bdhoine Dec 10, 2024
f5f6b42
Remove volume config
bdhoine Dec 10, 2024
d703e1d
Add name for workflow call
bdhoine Dec 10, 2024
0904130
Use consistent syntax
bdhoine Dec 10, 2024
ba264d1
Format
bdhoine Dec 10, 2024
eea9359
Make sure github actions also stay up to date
bdhoine Dec 11, 2024
26aa3d6
Rework test setup
bdhoine Dec 11, 2024
b09d03d
Make minimal runtime requirements more clear
bdhoine Dec 11, 2024
11a25e1
Add tests for publication and managing entries
bdhoine Dec 12, 2024
77d5af3
Update translations for dutch
bdhoine Dec 12, 2024
770aca9
use vanity for tool urls and create helper url object
bdhoine Dec 12, 2024
78d73f8
Exclude generated sources for linting
bdhoine Dec 12, 2024
aee6c29
Remove tracking attributes
bdhoine Dec 12, 2024
b35d870
Use non admin user for UI tests
bdhoine Dec 12, 2024
071f785
Update screenshots
bdhoine Dec 12, 2024
843fd9c
Retry queue check
bdhoine Dec 12, 2024
1e50bfc
Increase timeout to avoid flaky tests
bdhoine Dec 12, 2024
e9aa26e
Add tests for editing entries
bdhoine Dec 12, 2024
a92ebc8
Add report with github action
bdhoine Dec 12, 2024
4357e81
Only run on pull requests and merges to main branch
bdhoine Dec 12, 2024
47b091a
Also comment to pull request and annotate failed tests
bdhoine Dec 12, 2024
9f682d7
Wait on POST on key creation
bdhoine Dec 13, 2024
86ce2c5
Update docs
bdhoine Dec 13, 2024
86399bf
Update IT test content
bdhoine Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/" # Location of package manifests
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
ignore:
- dependency-name: "io.wcm.maven:io.wcm.maven.aem-dependencies"
versions: [ "[6.5.17,)" ]
- dependency-name: "biz.aQute.bnd:bnd-maven-plugin"
update-types: [ "version-update:semver-major" ]
- package-ecosystem: "npm"
directory: "/ui.tests"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
43 changes: 41 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,46 @@ name: Build
on: [ push, pull_request ]

jobs:
call-workflow:
aem-maven-build:
name: Call workflow
uses: orbinson/workflows/.github/workflows/aem-maven-build.yml@main
with:
java-version: 11
java-version: 11

ui-tests:
Comment thread
bdhoine marked this conversation as resolved.
name: Run UI tests
runs-on: ubuntu-latest
needs: aem-maven-build
services:
aem-author:
image: ghcr.io/orbinson/aem-sdk:author-2024.10.18459.20241031T210302Z-241000
ports:
- 4502:4502
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
cache: maven
- name: Get Playwright version from package-lock.json
run: echo "PLAYWRIGHT_VERSION=$(jq -r '.packages["node_modules/playwright-core"].version' ui.tests/package-lock.json)" >> $GITHUB_ENV
- name: Cache Playwright binaries
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install all package
run: mvn install -B -U -PautoInstallSinglePackage
- name: Install it.content package
run: mvn install -B -U -PautoInstallPackage -pl it.content
- name: Run ui.tests
run: mvn test -B -pl ui.tests -DskipTests=false
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: ui.tests/playwright-report
34 changes: 34 additions & 0 deletions .run/[author] aemsync it.content.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[author] aemsync it.content" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="verify" />
</list>
</option>
<option name="multimoduleDir" />
<option name="pomFileName" value="pom.xml" />
<option name="profilesMap">
<map>
<entry key="aemsync" value="true" />
</map>
</option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/it.content" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
34 changes: 34 additions & 0 deletions .run/[author] aemsync ui.apps.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[author] aemsync ui.apps" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="verify" />
</list>
</option>
<option name="multimoduleDir" />
<option name="pomFileName" value="pom.xml" />
<option name="profilesMap">
<map>
<entry key="aemsync" value="true" />
</map>
</option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/ui.apps" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
35 changes: 35 additions & 0 deletions .run/[author] install it.content.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[author] install it.content" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="install" />
</list>
</option>
<option name="multimoduleDir" />
<option name="pomFileName" value="pom.xml" />
<option name="profilesMap">
<map>
<entry key="autoInstallPackage" value="true" />
</map>
</option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/it.content" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
34 changes: 34 additions & 0 deletions .run/[author] run ui.tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[author] run ui.tests" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="test" />
<option value="-DskipTests=false" />
</list>
</option>
<option name="multimoduleDir" />
<option name="pomFileName" value="pom.xml" />
<option name="profilesMap">
<map />
</option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/ui.tests" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ The [AEM Dictionary Translator](http://localhost:4502/tools/translation/dictiona

## Installation

### System requirements
### Compatibility matrix

The minimal required AEM versions are:
The minimal required AEM and AEM Dictionary Translator versions are:

| type | version |
|---------|-------------------------------|
| AEM 6.5 | 6.5.17 |
| AEMaaCS | 2023.1.10912.20230130T173736Z |
| AEM Type | AEM version | AEM Dictionary Translator |
|----------|---------------------------------|----------------------|
| AEM 6.5 | `6.5.17` | `1.3.0` |
| AEMaaCS | `2023.1.10912.20230130T173736Z` | `1.0.0` |

The minimal required Java version is `11`.

Expand Down Expand Up @@ -61,7 +61,7 @@ To deploy the AEM Dictionary Translator as an embedded package you need to updat
To mitigate this, update the `org.apache.sling.i18n.impl.JcrResourceBundleProvider` OSGi config to allow dictionaries in
other folders, for example by using `/content/dictionaries` for all your editable dictionaries.

Example `org.apache.sling.i18n.impl.JcrResourceBundleProvider` OSGi config:
Example `org.apache.sling.i18n.impl.JcrResourceBundleProvider` OSGi config

```json
{
Expand Down Expand Up @@ -95,3 +95,17 @@ mvn clean install -PautoInstallSinglePackage

This project follows the [AEM Archetype](https://github.com/adobe/aem-project-archetype) conventions so for further
guidelines consult the available documentation.

### UI Tests

First install the `it.content` module to your local AEM instance

```shell
mvn clean install -pl it.content -PautoInstallPackage
```

Afterward run the UI tests with the following command

```shell
mvn clean test -pl ui.tests -DskipTests=false
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
import junit.framework.Assert;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.models.factory.ModelFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;
Expand Down
65 changes: 65 additions & 0 deletions it.content/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>be.orbinson.aem</groupId>
<artifactId>aem-dictionary-translator</artifactId>
<version>1.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>aem-dictionary-translator.it.content</artifactId>
<packaging>content-package</packaging>
<name>IT Content</name>
<description>IT Content package for the Dictionary Translator</description>

<profiles>
<profile>
<id>autoInstallPackage</id>

<build>
<plugins>
<plugin>
<groupId>io.wcm.maven.plugins</groupId>
<artifactId>wcmio-content-package-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<sourceDirectory>src/main/content/jcr_root</sourceDirectory>

<plugins>
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<configuration>
<properties>
<cloudManagerTarget>none</cloudManagerTarget>
</properties>
<packageType>mixed</packageType>
<showImportPackageReport>false</showImportPackageReport>
<repositoryStructurePackages>
<repositoryStructurePackage>
<groupId>be.orbinson.aem</groupId>
<artifactId>aem-dictionary-translator.ui.apps.structure</artifactId>
</repositoryStructurePackage>
</repositoryStructurePackages>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>be.orbinson.aem</groupId>
<artifactId>aem-dictionary-translator.ui.apps.structure</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
</dependencies>
</project>
8 changes: 8 additions & 0 deletions it.content/src/main/content/META-INF/vault/filter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/apps/aem-dictionary-translator/osgiconfig/config/org.apache.sling.jcr.repoinit.RepositoryInitializer~dictionary-translator-it-content.config"/>
Comment thread
bdhoine marked this conversation as resolved.
Outdated
<filter root="/apps/wcm/core/resources/languages"/>
<filter root="/content/dictionaries"/>
<filter root="/etc/replication/agents.author/publish"/>
<filter root="/etc/replication/agents.author/preview"/>
</workspaceFilter>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
scripts=["
create group dictionary-user
add dictionary-user to group contributor

create user test-user-dictionary-user with password test-password-dictionary-user
add test-user-dictionary-user to group dictionary-user

set ACL for dictionary-user
allow jcr:read,jcr:nodeTypeManagement,jcr:write,crx:replicate on /content/dictionaries
allow jcr:read on /libs/cq/i18n/translator
allow jcr:read on /libs/cq/i18n/gui/translator
end
"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:Folder"/>
Loading