すでにAEMに精通している場合は、この部分をスキップしてください。そうでない場合は、このAEMとは何か、およびテストが難しい理由を理解する必要があります。
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
. .