get-image-info.test.js 892 B

12345678910111213141516171819202122232425262728293031323334353637
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isIOS = platformInfo.startsWith('ios')
  3. const isWeb = platformInfo.startsWith('web')
  4. describe('API-getImageInfo', () => {
  5. if (isIOS) {
  6. it('pass', async () => {
  7. expect(1).toBe(1);
  8. });
  9. return;
  10. }
  11. let page;
  12. beforeAll(async () => {
  13. page = await program.reLaunch('/pages/API/get-image-info/get-image-info');
  14. await page.waitFor(500);
  15. });
  16. it('test getImageInfo', async () => {
  17. await page.waitFor(500);
  18. if (isWeb) {
  19. expect(await page.data('imageInfoForTest')).toEqual({
  20. width: 192,
  21. height: 192,
  22. path: 'test-image/logo.png'
  23. });
  24. return;
  25. }
  26. expect(await page.data('imageInfoForTest')).toEqual({
  27. width: 192,
  28. height: 192,
  29. path: 'test-image/logo.png',
  30. orientation: 'up',
  31. type: 'png'
  32. });
  33. });
  34. });