liferay-dummy-factory / integration-test
AGENTS.md48 starsChanged 53 days agoMITView on GitHub
Scope: integration-test/. Also obey the root AGENTS.md. The What to test section is the test-design rule set for every suite, including the JUnit tests in modules/liferay-dummy-factory/src/test/. How to run: docs/guides/testing.md. Harness internals: docs/reference/test-harness.md. Browser patterns: docs/reference/playwright.md.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,040 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- configs/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- configs/CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- .github/CLAUDE.mdCLAUDE.md
- integration-test/CLAUDE.mdCLAUDE.md
- contract-reviewSkill
- liferay-debugSkill
- parallel-orchestrationSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Before using a JSONWS endpoint for verification or cleanup, check it is a remote *Service and not blacklisted (JSONWS exposure).
- Distinctive: line 23
Cleanup: if an entity has no working delete path, skip cleanup with a one-line comment saying why.
- Very specific: line 25
Verify compilation with ./gradlew :integration-test:compileTestGroovy (not compileGroovy).
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Integration tests (Spock + Playwright) and test design
Scope: integration-test/. Also obey the root AGENTS.md. The What to test section is the test-design rule set for every suite, including the JUnit tests in modules/liferay-dummy-factory/src/test/.
How to run: docs/guides/testing.md. Harness internals: docs/reference/test-harness.md. Browser patterns: docs/reference/playwright.md.
What to test
- Pure logic gets a host-JVM JUnit test first (seconds, no container). Integration specs prove the integration — that the branch is wired, JSON flows end to end, and Liferay accepts the result — not the inner logic.
- Every branch of a new
if/elsegets its own feature method, happy and sad path (e.g. bothfakerEnable=trueandfalse, plus a dirty-input rejection such asbaseName: "O'Brien"). - RNG/faker output gets deterministic locks: a regex every item must match (
==~ /^[a-z0-9._-]+$/), and for per-item random values an all-distinct lock ((items*.body as Set).size() == count). - Lock the response shape, not just values: assert presence (
containsKey) ofsuccess,count,requested,skipped,itemson success and failure paths.erroris absent on success — never require it there. - Wire-format renames: sweep both dotted access (
\.users\b) and string literals ("users") acrossintegration-test/.
Spock specs
- Live in
integration-test/src/test/groovy/com/liferay/support/tools/it/spec/, extendBaseLiferaySpec, callensureBundleActive()insetupSpec().@Stepwisewhen order matters. - Verify database state through JSONWS (
jsonwsGet/Postwith path suffixes only). Use Playwright only when the DOM, client-side validation or navigation is the subject. - Before using a JSONWS endpoint for verification or cleanup, check it is a remote
*Serviceand not blacklisted (JSONWS exposure). - Identity lock first: prove the JSONWS response is the entity you asked for (e.g.
emailAddress.equalsIgnoreCase(email)) before asserting other fields. - Diagnostic asserts first in
then:blocks:assert response.error == null : "creator failed: ${response}"before bare boolean conditions on the same data. @Stepwiseshared fields: guard before use (assert !apiResponseBody.isEmpty() : 'prior feature method did not run…').- Cleanup: if an entity has no working delete path, skip cleanup with a one-line comment saying why. No best-effort cleanup that swallows errors.
- Spock style:
def 'describes behaviour'(),given/when/then/expect,?., numeric literals with underscores (30_000). - Verify compilation with
./gradlew :integration-test:compileTestGroovy(notcompileGroovy).
Playwright
- Selectors:
getByRole→ non-localizedaria-label→data-testid(contract). Never visible text. - Success waits AND the state class:
[data-testid="org-result"].alert-success. - Async-gated buttons: wait for
:not([disabled]); neversetForce(true). - Text assertions use the resolved English value from
Language.properties, never the key; usetextContent()under CSStext-transform. - Explicit timeouts on every wait;
pw?.close()incleanupSpec().
Gradle wiring (integration-test/build.gradle)
- Docker
hostConfig.bindsare set at configuration time; port 6300 needsexposePortsplus a binding without host-IP prefix. integrationTestkeepsjacoco { enabled = false }, andevaluationDependsOn(':modules:liferay-dummy-factory')stays at the top.- The suite needs Docker and
LIFERAY_DXP_LICENSE_FILE. If you cannot run it, say so; never imply it passed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

