Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .circleci/ci/it-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ try {
// TODO: Remove when https://jira.corp.adobe.com/browse/ARTFY-6646 is resolved
let aemCifSdkApiVersion = "2025.09.02.1-SNAPSHOT";

// Build it/site with the appropriate profile
ci.dir('it/site', () => {
const profile = (AEM === 'classic' || AEM === 'lts') ? ' -Pclassic' : '';
ci.sh(`mvn -B clean install${profile}`);
});

let itSitePackage = (AEM === 'classic' || AEM === 'lts')
? ci.addQpFileDependency(config.modules['cif-components-it-site.all-classic'])
: ci.addQpFileDependency(config.modules['cif-components-it-site.all']);

ci.dir(qpPath, () => {
// Connect to QP
Expand Down Expand Up @@ -77,6 +86,7 @@ try {
${ci.addQpFileDependency(config.modules['core-cif-components-examples-config'])} \
${ci.addQpFileDependency(config.modules['core-cif-components-examples-content'])} \
${ci.addQpFileDependency(config.modules['core-cif-components-it-tests-content'])} \
${itSitePackage} \
--vm-options \\\"-Xmx1536m ${maxMetaspace} -Djava.awt.headless=true -javaagent:${process.env.JACOCO_AGENT}=destfile=crx-quickstart/jacoco-it.exec\\\"`);
});

Expand Down
2 changes: 1 addition & 1 deletion it/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This folder contains integration tests that test all the components based on the

To execute the tests, simply run `mvn clean verify -Ptest-all`

You can also execute the tests in your favorite IDE.
You can also execute the tests in your favorite IDE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2025 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
package com.adobe.cq.commerce.it.http;

import org.apache.sling.testing.clients.ClientException;
import org.apache.sling.testing.clients.SlingHttpResponse;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;

import com.adobe.cq.testing.client.CQClient;
import com.adobe.cq.testing.junit.rules.CQAuthorClassRule;
import com.adobe.cq.testing.junit.rules.CQRule;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
* Smoke tests for the CIF IT Site — verifies the site loads and the commerce navigation is configured.
*/
public class ItSiteSmokeIT {

private static final String IT_SITE_HOME = "/content/cif-components-it-site/us/en";
private static final String HEADER_XF_MODEL = "/content/experience-fragments/cif-components-it-site/us/en/site/header/master.model.json";
private static final ObjectMapper MAPPER = new ObjectMapper();

@ClassRule
public static final CQAuthorClassRule cqBaseClassRule = new CQAuthorClassRule();

@Rule
public CQRule cqBaseRule = new CQRule(cqBaseClassRule.authorRule);

private static CQClient adminAuthor;

@BeforeClass
public static void init() throws ClientException {
adminAuthor = cqBaseClassRule.authorRule.getAdminClient(CQClient.class);
}

@Test
public void testHomePageLoads() throws ClientException {
SlingHttpResponse response = adminAuthor.doGet(IT_SITE_HOME + ".html", 200);
Document doc = Jsoup.parse(response.getContent());
Assert.assertTrue("Page h1 should contain 'CIF IT Site'",
doc.select("h1.cmp-title__text").first().text().contains("CIF IT Site"));
}

@Test
public void testNavigationRendered() throws ClientException {
SlingHttpResponse response = adminAuthor.doGet(IT_SITE_HOME + ".html", 200);
Document doc = Jsoup.parse(response.getContent());
Elements navContainer = doc.select("div.navigation");
Assert.assertTrue("Navigation container should be present in the page", navContainer.size() > 0);
}

@Test
public void testCommerceNavigationConfigured() throws Exception {
SlingHttpResponse response = adminAuthor.doGet(HEADER_XF_MODEL, 200);
JsonNode json = MAPPER.readTree(response.getContent());
JsonNode navigation = json.at("/:items/root/:items/navigation");

Assert.assertFalse("Navigation component should exist at the expected model path",
navigation.isMissingNode());
Assert.assertEquals("Navigation should be the CIF commerce navigation component",
"cif-components-it-site/components/commerce/navigation", navigation.get(":type").asText());
}
}
89 changes: 89 additions & 0 deletions it/site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# CIF IT Site (`it/site`)

Integration-test site for **AEM CIF Core Components**, living inside the `aem-core-cif-components` monorepo under `it/site/`. It is a **FileVault + frontend** layout (no local OSGi `core` bundle, no `it.tests` / `ui.tests`). See **`generate.md`** for how this site was originally created and how to recreate it for a different project.

## Modules

* **ui.apps** — `/apps` code: components, clientlibs, HTL, etc.
* **ui.apps.structure** — repository root filters for package validation (declared in `pom.xml`, no `src/main/content`).
* **ui.content** — mutable content, templates under `/conf`, sample pages.
* **ui.config** — OSGi configurations (cloud). GraphQL endpoint uses `${COMMERCE_ENDPOINT}`.
* **ui.frontend** — Webpack build; output is emitted into `ui.apps` clientlibs.
* **all** — container package embedding site packages and CIF vendor packages (AEM as a Cloud Service).
* **classic/all** (reactor profile **`classic`**) — 6.5 / AMS mixed package embedding site + classic overlays + CIF Core + WCM Core.

## How to build

### From `it/site/` directly

```bash
# Cloud only
mvn clean install

# Cloud + classic (AEM 6.5 / AMS)
mvn clean install -Pclassic
```

### From the monorepo root

The `it/site` reactor is part of the `integration-tests` profile (active by default unless `-Dskip-it` is set):

```bash
# Build only it/site and its dependencies from the monorepo root
mvn clean install -pl it/site -am

# Or build all integration-test modules together
mvn clean install -Pintegration-tests
```

### Deploy to a local AEM instance

```bash
# AEM as a Cloud Service SDK (author)
mvn clean install -PautoInstallSinglePackage

# AEM as a Cloud Service SDK (publish)
mvn clean install -PautoInstallSinglePackagePublish

# AEM 6.5 / AMS — build first, then upload the classic all zip via Package Manager UI
mvn clean install -Pclassic
# Upload: classic/all/target/cif-components-it-site.all-classic-*.zip
```

> **Do not** combine `-PautoInstallSinglePackage,classic` on AEM 6.5 — it deploys the cloud `all` container before the classic overlay can correct it.

Or to deploy a single content package from its sub-module directory (e.g. `ui.apps`):

```bash
mvn clean install -PautoInstallPackage
```

## Testing

HTTP integration tests for commerce components live in `../http` (`it/http`). Run them against a running AEM author:

```bash
# from the monorepo root
mvn clean verify -pl it/http -am -Dit
```

See `it/http/README.md` for override properties (`aem.host`, `aem.port`, `it.commerce.library.path`).

## GraphQL endpoint

The cloud `ui.config` OSGi config uses `${COMMERCE_ENDPOINT}`. Set this:

* **Cloud Manager / AMS** — define the environment variable `COMMERCE_ENDPOINT` pointing to your `https://…/graphql` URL.
* **Local AEM SDK** — set it in the OSGi console or add a dev-specific config override with a concrete URL.

The classic `classic/ui.config` ships with a placeholder URL (`https://hostname.com/graphql`); replace it via OSGi or an AMS environment variable once the instance is up.

## ClientLibs

The `ui.frontend` Webpack build produces output consumed by the [`aem-clientlib-generator`](https://github.com/wcm-io-frontend/aem-clientlib-generator), which packages it as an AEM ClientLib under `ui.apps`. After cloning or first checkout:

```bash
cd ui.frontend && npm ci
```

If `webpack` is missing from PATH during a Maven build, the npm dependencies were not installed.
Loading