Jika Anda sudah terbiasa dengan AEM, jangan ragu untuk melewati bagian ini. Jika tidak, Anda harus memahami apa itu AEM dan mengapa sulit untuk mengujinya.
AEM - content management system Adobe ( - WordPress ). ? , (AEM-author), (Editors) , . ( publish ) (AEM-publish). , , .
. , user interface, , . , , . , , Google , - .
, โ AEM version 6.4.4.0. , . :
Screenshots tests โ AEM โ content management system => , , ( ).
Web-component tests โ UI Cypress . , .
Web Performance tests โ Web- ( Sitespeed)
โ ( ). . , , , .
? , . . , , . , , - .
, โ . ? . โ , . . .
, . . 5 , , 10+ .
?
?
, , , .
Long story short
, API. - , . - โ ( ? โ ).
โ reverse engineering (AEM-author) .
, โ , - - :
(page template)
, , :
...
dev-tools Network.
1.
AEM-author
Sites
Create
template
Network dev-tools
Create
`${aem-author-URL}/libs/wcm/core/content/sites/createpagewizard/_jcr_content
` .
. POST FormData
. .. body JSON/XML
. Content-Type: application/x-www-form-urlencoded.
JS (-, url encoded key=value
&
). , , , (key
) . .. Form Data
tags=Tag1&tags=Tag2
( , ).
:
parentPath
โ / AEM-e,
template
โ ,
โฆ , โฆ
./jcr:title
โ / ( UI)
./cq:tags
โ , ( )
./articleDate
,./articleTimeToRead
:cq_csrf_token
, .
, . , token
. cypress.io , API auth
username
password
, , body. (For more info check Cypress: Request - arguments and http-authentication).
key takeaways: `${aem-author-URL}/libs/wcm/core/content/sites/createpagewizard/_jcr_content
`, parentPath
template
.
2.
AEM author
Edit
()
+
Network dev-tools
`${aem-author-URL}/content/${page-path}/jcr:content/par/${some-url-part}/par/
`.
:
./@CopyFrom
โ (default) (button )
./sling:resourceType
โ ,
parentResourceType
โ , ,
3.
โ โ
Network dev-tools
Done
`${aem-author-URL}/content/${page-path}/_jcr_content/par/${component-name}
`.
:
./sling:resourceType
โ ,
:cq_csrf_token
โ , auth
4.
Network dev-tools
Quick Publish -> Publish
4.1.
2 .
4.1.1.
reference.jsonโฆ โ `${aem-author-URL}/libs/wcm/core/content/reference.json?${url-params}
` โ (assets), c .
โ query string params
. path
.
. path`s
, published
false
.
4.1.2.
replicate โ `${aem-author-URL}/bin/replicate
` โ .
, :
cmd: Activate
โ
path
โ 2
4.2.
โ . , .
โ GET `${aem-author-URL}/etc/replication/agents.author/publish_publish/jcr:content.queue.json
`. . , , body.queue
. path
. , ( timeout 1 , ).
5.
Network dev-tools
Delete-> Delete
`${aem-author-URL}/bin/wcmcommand
`.
:
cmd
โ deletePage
path
โ
force: false
โtrue
( )
checkChildren: true
โ
, โฆ
- . โ .
FormData
. , ( ). FormData
( ).
, :
AEM `
-
`. `Bla 1 2 3 4
` ,โฆ/bla-1-2-3-4
lowerCase
( . )
`
_
` ( 18 ) `_
`.BlaBla123456789123456_blabla
,โฆ/blabla123456789123456_blabla
,โฆ/blabla123456789123456blabla
id
. .