get-element-by-id-multiple-root-node.test.js 876 B

1234567891011121314151617181920212223242526
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isMP = platformInfo.startsWith('mp')
  3. const PAGE_PATH = "/pages/API/get-element-by-id/get-element-by-id-multiple-root-node";
  4. let page;
  5. describe("getElementByIdForMultipleRootNode", () => {
  6. beforeAll(async () => {
  7. page = await program.reLaunch(PAGE_PATH);
  8. await page.waitFor('view');
  9. });
  10. it("getElementByNotExistId", async () => {
  11. const res = await page.callMethod("getElementByNotExistId");
  12. expect(res).toBe(null);
  13. });
  14. it("changeStyle", async () => {
  15. if (!isMP) {
  16. await page.callMethod("changePageHeadBackgroundColor");
  17. }
  18. await page.callMethod("changeTextColor");
  19. await page.callMethod("changeViewStyle");
  20. await page.waitFor(500);
  21. const image = await program.screenshot({fullPage: true});
  22. expect(image).toSaveImageSnapshot();
  23. });
  24. });