get-element-by-id-multiple-root-node.test.js 827 字节
Newer Older
1 2 3 4
const PAGE_PATH =
  "/pages/API/get-element-by-id/get-element-by-id-multiple-root-node";
let page;

5
describe("getElementByIdForMultipleRootNode", () => {
6 7
  beforeAll(async () => {
    page = await program.reLaunch(PAGE_PATH);
8
    await page.waitFor('view');
9 10 11 12 13
  });
  it("getElementByNotExistId", async () => {
    const res = await page.callMethod("getElementByNotExistId");
    expect(res).toBe(null);
  });
雪洛's avatar
雪洛 已提交
14 15 16 17
  it("changeStyle", async () => {
    if (!process.env.uniTestPlatformInfo.startsWith('mp')) {
      await page.callMethod("changePageHeadBackgroundColor");
    }
18 19 20
    await page.callMethod("changeTextColor");
    await page.callMethod("changeViewStyle");
    await page.waitFor(500);
21
    const image = await program.screenshot({fullPage: true});
22
    expect(image).toSaveImageSnapshot();
23
  });
24
});