react-native-navigation的迁移库

StaticLifecycleEvents.test.js 836B

12345678910111213141516171819
  1. const Utils = require('./Utils');
  2. const testIDs = require('../playground/src/testIDs');
  3. const { elementByLabel, elementById } = Utils;
  4. describe('static lifecycle events', () => {
  5. beforeEach(async () => {
  6. await device.relaunchApp();
  7. });
  8. it('didAppear didDisappear', async () => {
  9. await elementById(testIDs.PUSH_STATIC_LIFECYCLE_BUTTON).tap();
  10. await expect(elementByLabel('Static Lifecycle Events Overlay')).toBeVisible();
  11. await expect(elementByLabel('componentDidAppear | navigation.playground.StaticLifecycleOverlay')).toBeVisible();
  12. await elementById(testIDs.PUSH_BUTTON).tap();
  13. await expect(elementByLabel('componentDidAppear | navigation.playground.PushedScreen')).toBeVisible();
  14. await expect(elementByLabel('componentDidDisappear | navigation.playground.WelcomeScreen')).toBeVisible();
  15. });
  16. });