@@ -27,6 +27,32 @@ exports.ICON_FILE = "test/.resources/favicon.ico";
2727exports . VIDEO_URL = "http://res.cloudinary.com/demo/video/upload/dog.mp4" ;
2828exports . IMAGE_URL = "http://res.cloudinary.com/demo/image/upload/sample" ;
2929
30+ exports . ADDON_ALL = 'all' ; // Test all addons.
31+ exports . ADDON_ASPOSE = 'aspose' ; // Aspose document conversion.
32+ exports . ADDON_AZURE = 'azure' ; // Microsoft azure video indexer.
33+ exports . ADDON_BG_REMOVAL = 'bgremoval' ; // Cloudinary AI background removal.
34+ exports . ADDON_FACIAL_ATTRIBUTES_DETECTION = 'facialattributesdetection' ; // Advanced facial attributes detection.
35+ exports . ADDON_GOOGLE = 'google' ; /* Google AI video moderation, google AI
36+ video transcription, google auto tagging,
37+ google automatic video tagging,
38+ google translation.
39+ */
40+ exports . ADDON_IMAGGA = 'imagga' ; // Imagga auto tagging, crop and scale.
41+ exports . ADDON_JPEGMINI = 'jpegmini' ; // JPEGmini image optimization.
42+ exports . ADDON_LIGHTROOM = 'lightroom' ; // Adobe photoshop lightroom (BETA).
43+ exports . ADDON_METADEFENDER = 'metadefender' ; // MetaDefender anti-malware protection.
44+ exports . ADDON_NEURAL_ARTWORK = 'neuralartwork' ; // Neural artwork style transfer.
45+ exports . ADDON_OBJECT_AWARE_CROPPING = 'objectawarecropping' ; // Cloudinary object-aware cropping.
46+ exports . ADDON_OCR = 'ocr' ; // OCR text detection and extraction.
47+ exports . ADDON_PIXELZ = 'pixelz' ; // Remove the background.
48+ exports . ADDON_REKOGNITION = 'rekognition' ; /* Amazon rekognition AI moderation,
49+ amazon rekognition auto tagging,
50+ amazon rekognition celebrity detection.
51+ */
52+ exports . ADDON_URL2PNG = 'url2png' ; // URL2PNG website screenshots.
53+ exports . ADDON_VIESUS = 'viesus' ; // VIESUS automatic image enhancement.
54+ exports . ADDON_WEBPURIFY = 'webpurify' ; // WebPurify image moderation.
55+
3056const { TEST_TAG } = require ( './testUtils/testConstants' ) . TAGS ;
3157
3258exports . SAMPLE_VIDEO_SOURCES = [
@@ -259,4 +285,18 @@ exports.toISO8601DateOnly = function (timestamp) {
259285 return date . toISOString ( ) . split ( 'T' ) [ 0 ] ;
260286} ;
261287
288+ /**
289+ * Checks if tests for an addon should be executed.
290+ *
291+ * @param {string } addOn
292+ * @returns {boolean }
293+ */
294+ exports . shouldTestAddOn = function ( addOn ) {
295+ const cldTestAddons = ( process . env . CLD_TEST_ADDONS || '' ) . toLowerCase ( ) ;
296+ if ( cldTestAddons === this . ADDON_ALL ) {
297+ return true ;
298+ }
299+ return cldTestAddons . trim ( ) . split ( ',' ) . includes ( addOn . toLowerCase ( ) )
300+ }
301+
262302
0 commit comments