AEM-Testautomatisierung - Erstellen Sie Seiten ĂĽber HTTP-Anforderungen

Wenn Sie bereits mit AEM vertraut sind, können Sie diesen Teil überspringen. Wenn nicht, sollten Sie verstehen, was dieses AEM ist und warum es schwierig ist, es zu testen.





AEM - content management system Adobe ( - WordPress ). ? , (AEM-author), (Editors) , . ( publish ) (AEM-publish). , , . 





. , user interface, , . , , . , , Google , - .





, — AEM version 6.4.4.0.  , . :





  1. Screenshots tests — AEM — content management system => , , ( ).





  2. Web-component tests — UI Cypress . , .





  3. Web Performance tests — Web- ( Sitespeed)





— ( ). . , , , .





? , . . , , . , , - . 





, — . ? . — , . . .





, . . 5 , , 10+ .





?









, , , .





Long story short

, API. - , . - — ( ? — ). 





— reverse engineering (AEM-author) .





, — , - - :





  1. (page template)

















  2. , , :










...





dev-tools Network. 





1.

  1. AEM-author





  2. Sites









  3. Create





  4. template









  5. Network dev-tools





  6. 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



( , ).





[Anforderungsbeispiel] URL-codierte FormData
[Request Example] URL encoded FormData
[Anforderungsbeispiel] Analysierte FormData
[Request Example] Parsed FormData

:





  • 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).





Implementierung des Sendens einer POST-Anfrage mit FormData
POST FormData

key takeaways: `${aem-author-URL}/libs/wcm/core/content/sites/createpagewizard/_jcr_content



`, parentPath



template



.






2.

  1. AEM author





  2. Edit





  3. ()  





  4. +







  5. Network dev-tools









`${aem-author-URL}/content/${page-path}/jcr:content/par/${some-url-part}/par/



`.





[Beispiel anfordern] Komponente zur Seite hinzufĂĽgen
[Request Example] Add Component to the page

:





  • ./@CopyFrom



    — (default) (button )





  • ./sling:resourceType



    — ,





  • parentResourceType



    — , ,






3.





  1. “ ”









  2. Network dev-tools





  3. Done





`${aem-author-URL}/content/${page-path}/_jcr_content/par/${component-name}



`.





[Anforderungsbeispiel] Komponente konfigurieren
[Request Example] Configure Component

:





  • ./sling:resourceType



    — ,





  • :cq_csrf_token



    — , auth






4.





  1. Network dev-tools





  2. Quick Publish -> Publish





4.1.

2 .





4.1.1.

reference.json… — `${aem-author-URL}/libs/wcm/core/content/reference.json?${url-params}



` — (assets), c .





[Beispiel anfordern] Aktivieren Sie Assets, die sich auf die veröffentlichte Seite beziehen
[Request Example] Check Assets related to the published page

— query string params



. path



.





. path`s



, published



false



.





[Antwortbeispiel] Aktivieren Sie die Assets
[Responce Example] Check Assets

4.1.2.

replicate — `${aem-author-URL}/bin/replicate



` — .





[Beispiel anfordern] Seite und verwandte Assets veröffentlichen
[Request Example] Publish Page and Related Assets

, :





  • 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.









  1. Network dev-tools





  2. Delete-> Delete





`${aem-author-URL}/bin/wcmcommand



`.





[Anforderungsbeispiel] Seite löschen
[Request Example] Delete Page

:





  • 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



    . .








All Articles