react-native-navigation的迁移库

OverlayTest.test.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536
  1. const Utils = require('./Utils');
  2. const testIDs = require('../playground/src/testIDs');
  3. const { elementByLabel, elementById } = Utils;
  4. describe('Overlay', () => {
  5. beforeEach(async () => {
  6. await device.relaunchApp();
  7. });
  8. it('show and dismiss overlay', async () => {
  9. await elementById(testIDs.PUSH_OPTIONS_BUTTON).tap();
  10. await elementById(testIDs.SHOW_OVERLAY_BUTTON).tap();
  11. await expect(elementById(testIDs.DIALOG_HEADER)).toBeVisible();
  12. await elementById(testIDs.OK_BUTTON).tap();
  13. await expect(elementById(testIDs.DIALOG_HEADER)).toBeNotVisible();
  14. });
  15. it('overlay pass touches - true', async () => {
  16. await elementById(testIDs.PUSH_OPTIONS_BUTTON).tap();
  17. await elementById(testIDs.SHOW_TOUCH_THROUGH_OVERLAY_BUTTON).tap();
  18. await expect(elementById(testIDs.DIALOG_HEADER)).toBeVisible();
  19. await expect(elementById(testIDs.TOP_BAR_ELEMENT)).toBeVisible();
  20. await elementById(testIDs.HIDE_TOP_BAR_BUTTON).tap();
  21. await expect(elementById(testIDs.TOP_BAR_ELEMENT)).toBeNotVisible();
  22. });
  23. it('overlay pass touches - false', async () => {
  24. await elementById(testIDs.PUSH_OPTIONS_BUTTON).tap();
  25. await elementById(testIDs.SHOW_OVERLAY_BUTTON).tap();
  26. await expect(elementById(testIDs.DIALOG_HEADER)).toBeVisible();
  27. await expect(elementById(testIDs.TOP_BAR_ELEMENT)).toBeVisible();
  28. await elementById(testIDs.HIDE_TOP_BAR_BUTTON).tap();
  29. await expect(elementById(testIDs.TOP_BAR_ELEMENT)).toBeVisible();
  30. });
  31. });