|
| 1 | +import path from 'node:path'; |
| 2 | +import { CloudinarySDK } from '../src/sdks/cloudinarySDK.js'; |
1 | 3 | import { activityBarUtils } from '../src/utils/ActivityBarUtils.js' |
2 | 4 | import { sideBarViewUtils } from '../src/utils/SideBarViewUtils.js' |
| 5 | +import crypto from 'node:crypto'; |
| 6 | +import { pathUtils } from '../src/utils/pathUtils.js'; |
3 | 7 |
|
4 | | -/** |
5 | | - * Asset Explorer: |
6 | | - * Validates that the title and content of the Cloudinary media library are loaded correctly. |
7 | | - */ |
8 | | -it('should load cloudinary media library', async () => { |
9 | | - const expectedTitle = 'CLOUDINARY'; |
10 | | - const expectedItems = ['samples', 'sample']; |
11 | | - |
12 | | - await activityBarUtils.openView('Cloudinary'); |
13 | 8 |
|
14 | | - await sideBarViewUtils.validateSideBarViewTitle(expectedTitle); |
| 9 | +describe('Asset Explorer Tetsts', () => { |
15 | 10 |
|
16 | | - await sideBarViewUtils.validateContentItemsExist(expectedItems); |
| 11 | + let cloudinarySDK = new CloudinarySDK(); |
| 12 | + let assetPublicID = `e2e-test-ae-${crypto.randomUUID().substring(0, 8)}`; |
| 13 | + |
| 14 | + beforeEach(async () => { |
| 15 | + await cloudinarySDK.V2.uploader.upload(path.join(pathUtils.getTestAssetsPath(), 'sample_png.png'), { public_id: assetPublicID }); |
| 16 | + }); |
| 17 | + |
| 18 | + afterEach(async () => { |
| 19 | + await cloudinarySDK.V2.api.delete_resources([assetPublicID]); |
| 20 | + }); |
| 21 | + |
| 22 | + /** |
| 23 | + * Asset Explorer: |
| 24 | + * Validates that the title and content of the Cloudinary media library are loaded correctly. |
| 25 | + */ |
| 26 | + it('should load cloudinary media library', async () => { |
| 27 | + const expectedTitle = 'CLOUDINARY'; |
| 28 | + const expectedItems = [assetPublicID]; |
| 29 | + |
| 30 | + await activityBarUtils.openView('Cloudinary'); |
| 31 | + |
| 32 | + await sideBarViewUtils.validateSideBarViewTitle(expectedTitle); |
| 33 | + |
| 34 | + await sideBarViewUtils.validateContentItemsExist(expectedItems); |
| 35 | + }); |
17 | 36 | }); |
18 | 37 |
|
0 commit comments