set-page-backgroundColorContent.test.js 826 B

123456789101112131415161718192021222324252627282930
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isMP = platformInfo.startsWith('mp')
  3. const isHarmony = platformInfo.startsWith('harmony')
  4. describe('set-page-backgroundColorContent', () => {
  5. if (isMP) {
  6. it('not support', () => {
  7. expect(1).toBe(1)
  8. })
  9. return
  10. }
  11. let page
  12. beforeAll(async () => {
  13. page = await program.reLaunch('/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent')
  14. await page.waitFor(600);
  15. })
  16. it('check_backgroundColorContent_red', async () => {
  17. await page.callMethod('changeColor', "")
  18. page.waitFor(200)
  19. const color = (await page.data()).currentBackgroundColorContent
  20. expect(color).toBe("red")
  21. const image = await program.screenshot({fullPage: true});
  22. expect(image).toSaveImageSnapshot();
  23. })
  24. })