react-native-navigation的迁移库

ComplexLayout.test.js 1.4KB

12345678910111213141516171819202122232425262728293031323334
  1. const Utils = require('./Utils');
  2. const testIDs = require('../playground/src/testIDs');
  3. const { elementByLabel, elementById } = Utils;
  4. describe('complex layout', () => {
  5. beforeEach(async () => {
  6. await device.relaunchApp();
  7. });
  8. test('shows external component in stack in modal', async () => {
  9. await elementById(testIDs.COMPLEX_LAYOUT_BUTTON).tap();
  10. await elementById(testIDs.EXTERNAL_COMPONENT_IN_STACK).tap();
  11. await expect(elementByLabel('External component in stack')).toBeVisible();
  12. });
  13. test('shows external component in deep stack in modal', async () => {
  14. await elementById(testIDs.COMPLEX_LAYOUT_BUTTON).tap();
  15. await elementById(testIDs.EXTERNAL_COMPONENT_IN_DEEP_STACK).tap();
  16. await expect(elementByLabel('External component in deep stack')).toBeVisible();
  17. });
  18. test('merge options correctly in SideMenu inside BottomTabs layout', async () => {
  19. await elementById(testIDs.COMPLEX_LAYOUT_BUTTON).tap();
  20. await elementById(testIDs.SIDE_MENU_LAYOUT_INSIDE_BOTTOM_TAB).tap();
  21. await elementById(testIDs.SECOND_TAB_BAR_BUTTON).tap();
  22. await elementById(testIDs.OPEN_SIDE_MENU).tap();
  23. await expect(elementByLabel('This is a left side menu screen')).toBeVisible();
  24. await elementById(testIDs.HIDE_LEFT_SIDE_MENU_BUTTON).tap();
  25. await expect(elementByLabel('This is a left side menu screen')).toBeNotVisible();
  26. });
  27. });