match-media.test.js 765 B

123456789101112131415161718192021222324252627
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isMP = platformInfo.startsWith('mp')
  3. const isAndroid = platformInfo.startsWith('android')
  4. const isHarmony = platformInfo.startsWith('harmony')
  5. describe("match-media", () => {
  6. const isSupportted = isMP || isAndroid || isHarmony;
  7. if (!isSupportted) {
  8. it("not support", () => {
  9. expect(1).toBe(1);
  10. });
  11. return;
  12. }
  13. let page;
  14. beforeAll(async () => {
  15. page = await program.reLaunch('/pages/component/match-media/match-media')
  16. await page.waitFor(2000);
  17. });
  18. it("match-media screenshot", async () => {
  19. const image = await program.screenshot({
  20. fullPage: true,
  21. });
  22. expect(image).toSaveImageSnapshot();
  23. });
  24. });