react-native-navigation的迁移库

Utils.js 383B

12345678910111213141516
  1. module.exports = {
  2. elementByLabel: (label) => {
  3. return element(by.label(label));
  4. },
  5. elementById: (id) => {
  6. return element(by.id(id));
  7. },
  8. tapBackIos: () => {
  9. try {
  10. return element(by.traits(['button']).and(by.label('Back'))).atIndex(0).tap();
  11. } catch (err) {
  12. return element(by.type('_UIModernBarButton').and(by.label('Back'))).tap();
  13. }
  14. }
  15. };