provider.test.js 1.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
const PAGE_PATH =
  "/pages/API/provider/provider";

describe("provider", () => {
  if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW === 'true') {
    it('web', () => {
      expect(1).toBe(1)
    })
    return
  }
  beforeAll(async () => {
    page = await program.reLaunch(PAGE_PATH)
    await page.waitFor(600)
  });
  it("test getprovider", async () => {
    await page.callMethod('getProvider');
    await page.waitFor(1000);
    let providerIds = await page.data('providerIds')

    expect(providerIds[0]).toEqual('wxpay')
    expect(providerIds[1]).toEqual('alipay')
    expect(providerIds[2]).toEqual('system')
    expect(providerIds[3]).toEqual('tencent')
M
mahaifeng 已提交
24 25 26 27 28 29 30

    let providerObjects = await page.data('providerObjects')
    expect(providerObjects[0].description).toEqual('微信支付')
    expect(providerObjects[1].description).toEqual('支付宝')
    expect(providerObjects[2].description).toEqual('系统定位')
    expect(providerObjects[3].description).toEqual('腾讯定位')
    expect(providerObjects.length).toEqual(4)
31 32
  });
});