Skip to main content

Cloudinary E2E Tests

Overview

This documentation tries to cover the basic E2E test cases, as well as how to access other more advanced checks for the Cloudinary --> AWS --> Hybris integration.

Prerequirements

To do E2E tests and understand the test cases and following sections of the documentation, you first need to read the Cloudinary Assets Ingestion Documentation to understand how to create/rename/delete images in Cloudinary and check the integration with Hybris.

Check the Assets upload presets doc to set the correct name convention.

Check the asset Approval status workflow do

In case of failure to check the corresponding logs it's necessary to access the corresponding AWS resources, please check Advance Checks section.

Test Cases

Basic Test cases description to validate that the functionality it's working as expected. Note: the refresh of PDP page could take several minutes, because the data is cached.

Description: Upload a gallery asset following the corresponding GALLERY preset, naming convention and folder structure conventions detailed in the documentation. Edit the approved structured metadata field to Approved.

Expected behaviour: After less than one minute check the corresponding BASE SKU in the HMC (f.e: COR01XX), the asset must be added to the Normals Attribute for Staged and Online catalog versions. If the product is approved it must be displayed in the TOP carousel in the PDP.

Note: For the new Flat Folder structure it's necessary to add the SKU as a TAG, you can do it before or after approving the asset. If you do it before, the changes are not gonna reach hybris until the asset is approved. If the asset is approved the changes must reach hybris just after saving the tags.

Single asset approve MANNEQUIN

Description: Upload a mannequin asset following the corresponding MANNEQUIN preset, naming convention and folder structure conventions detailed in the documentation. Edit the approved structured metadata field to Approved.

Expected behaviour: After less than one minute check the corresponding STYLE VARIANT SKU in the HMC (f.e: COR01XXBLK), the asset must be added to the Normals Attribute for Staged and Online catalog versions. If the product is approved it must be displayed in the mannequin carousel section in the corresponding position ordered by the ORDINAL set at the end of the name of the file (Check Naming conventions).

Single image asset approve TRIPTYCH

Description: Upload a triptych asset following the corresponding TRIPTYCH preset, naming convention and folder structure conventions detailed in the documentation. Edit the approved structured metadata field to Approved.

Expected behaviour: After less than one minute check the corresponding BASE SKU in the HMC (f.e: COR01XX), the asset must be added to the Triptych Media Set Attribute for Staged and Online catalog versions. If the product is approved and there is at least three assets, the new asset must be displayed in the Triptych component in the PDP.

Single video asset approve TRIPTYCH

Description: Upload a triptych video asset following the corresponding TRIPTYCH preset, naming convention and folder structure conventions detailed in the documentation. Edit the approved structured metadata field to Approved.

Expected behaviour: After less than one minute check the corresponding BASE SKU in the HMC (f.e: COR01XX), the asset must be added to the Triptych Media Set Attribute for Staged and Online catalog versions. If the product is approved and there is at least three assets, the new asset must be displayed in the Triptych component in the PDP.

Single asset rename

Description: Rename an existing approved asset in clodinary and save the changes.

Expected behaviour: After less than one minute check the corresponding asset must be updated in both catalog versions in HMC, to check that edit the asset (in Normals attribute or Trypych Media Set attribute depending on the type of Asset and SKU) and check the URL attribute (or internal URL attribute in Administration Tab), the Cloudinary URL must have changed. Note: In case that the asset is a Mannequin asset, the asset must be displayed in the corresponding order based in the final ordinal number of the file name.

Single asset delete

Description: Select an existing approved asset and delete it.

Expected behaviour: After less then one minute the asset must be deleted from both catalogs (Staged/Online) in hybris, check the corresponding product in HMC.

Multiple asset approve

Description: Upload multiple assets of one type (GALLERY, MANNEQUIN or TRIPTYCH), follow the corresponding naming convention, presets and folder structure. Select all of them and approve them.

Expected behaviour: After less than one minute check the corresponding product in the HMC (Base or Style) and the assets must have been created in the corresponding attribute. If they are Mannequin assets they must be displayed in the corresponding order provided by the final ordinal number on the end of the filename.

Note: In the new Flat Folder structure, the Gallery assets (location/event) will be created using the SKUs that were added as tags.

Multiple asset approve where one asset has incorrect naming convention

Description: Upload multiple assets of one type (GALLERY, MANNEQUIN or TRIPTYCH), in this case the assets must not follow the naming convention. Select all of them and approve them.

Expected behaviour: The assets must NOT reach hybris, check the corresponding products in HMC.

Multiple asset delete

Description: Select multiple existing approved asset and delete it.

Expected behaviour: After less then one minute all the assets must be deleted from both catalogs (Staged/Online) in hybris, check the corresponding product in HMC.

Single asset approve where the asset has incorrect naming convention

Description: Upload an asset of one type (GALLERY, MANNEQUIN or TRIPTYCH), in this case the asset must not follow the naming convention. Select it and approve it.

Expected behaviour: The asset must NOT reach hybris, check the corresponding product in HMC.

Delete single asset where the asset has incorrect naming convention (should not reach Hybris)

Description: Delete an approved asset of one type (GALLERY, MANNEQUIN or TRIPTYCH) or any other type, in this case the asset must not follow the naming conventions.

Expected behaviour: The asset notification must NOT reach hybris, check the corresponding product in HMC or the Advanced Checks section depending on the name of the file.

Rename asset to a name that does not follow naming convention (should not reach Hybris)

Description: Rename an approved asset of one type (GALLERY, MANNEQUIN or TRIPTYCH), in this case the asset must not follow the naming conventions.

Expected behaviour: The asset notification must NOT reach hybris, check the corresponding product in HMC, edit the corresponding asset if it's necessary and check the URL of the asset in Hybris.

Description: For an approved asset uploaded to folders /event or /location, add one or more existing base product SKU tags, and save it.

Expected behaviour: The asset must be added to the gallery collections to the corresponding SKUs in Staged and Online catalogs. If the asset has "previously added tags", check that the old ones still have the asset assigned in Hybris.

Description: For an unapproved/awaiting for approval gallery asset uploaded to folders /event or /location, add one or more existing base product SKU tags, and save it. Then approved it

Expected behaviour: Before approve the asset check that the asset has not be added to the corresponding SKUs in Hybris Staged and Online catalogs. After approve it, the asset must be added to the gallery collections to the corresponding SKUs in Hybris Staged and Online catalogs.

Description: For an approved asset uploaded to folders /event or /location, remove one or more existing base product SKU tags, and save it.

Expected behaviour: The asset must be removed from the gallery collections to the corresponding SKU tags removed in Staged and Online catalogs (if it exist previously). The asset must not be deleted in Hybris (Staged/Online catalogs) for the rest of the SKUs that are still asset tags.

Advanced Checks

In case of a test failure, it's necessary to check why, and to do that we need to login in the corresponding AWS environment and check the logs of the relevant lambdas.

AWS Architecture

Cloudinary sends notifications to the AWS Middleware every time an asset is uploaded, approved, renamed or deleted. The notifications are managed by cloudinary-ENV-cloudinary-image-process lambda, when the notifications reaches this lambda, it filters, restructure and populate the corresponding info to resend if it's necessary the correct notifications to the event layer, in the event layer the notifications will reach cloudinary-ENV-hybris-image-post lambda, that will be the one that is gonna send the notifications to hybris finally.

cloudinary-image-process

hybris-image-post

To check the logs you must log in the corresponding AWS console:

Once in AWS console: 1- Search for the corresponding lambda in lambdas section 2- Click on it 3- Click on Monitor Tab 4- Click on Logs tab lambda-logs 5- Depending on the test date & time check the logs to see ERROR logs, the date & time of the logs is UTC timezone in the Logs Tab monitor and in Cloudwatch it's a mix between your timezone and UTC. If all the logs in are INFO logs the execution has been ok and the asset notifications they should have reached their corresponding destination (if cloudinary-ENV-cloudinary-image-process lambda is the one checked, then the expected destination is cloudinary-ENV-hybris-image-post; if the cloudinary-ENV-hybris-image-post lambda is the one checked, then Hybris is the expected destination). cloudwatch-logs

Api Gateway

The entry point of the Cloudinary Notifications into AWS Middleware is the Clodinary API Getaway. In case it's necessary to check the logs of the API Gateway:

1- Go to API Gateway console. 2- Search the cloudinary-ENV-rest-api and click on it. Api Search 3- Copy the ID. Api ID 4- Go to the Cloudwatch console and in log groups section search by the id copied. Api Log Search 5- Click on the log groups and check the logs and see if there is some kind of error. Api Log Search 2 Api Log Search 3

NOTE: ENV = dev or prod, depending on the enviroment.

POSTMAN Standalone Hybris Notification Tests

To test the Hybris notification endpoint, it's possible to send requests to the the corresponding notification endpoint of one of the Hybris enviroments to test single requests and the correct behaviour of the Hybris side.

To test the requests you must join the Rapha Team in POSTMAN. Postman Rapha

Under the Cloudinary Collection, you will find the three types of request examples for the different type of assets. Postman Collection

There are two folders with different examples of requests for every type of asset:

  • GoLive folder contains the request format for the initial notifications convention in the Go Live (September 2022). These requests are useful to test backwards compatibility. -FlatFolder contains the request format examples for the new Flat folder structure (November 2022).

Select the Hybris - UAT or Hybris - Production config to send notifications to the UAT Or Production Hybris Environment.

Postman Envs

To use any of the requests it's necessary to invoke the Hybris OAuth GetToken request, at least the first time.

Postman Token