123456789101112131415161718192021 |
- const exec = require('shell-utils').exec;
-
- module.exports = {
- elementByLabel: (label) => {
- return element(by.text(label));
- },
- elementById: (id) => {
- return element(by.id(id));
- },
- tapBackIos: () => {
- try {
- return element(by.traits(['button']).and(by.label('Back'))).atIndex(0).tap();
- } catch (err) {
- return element(by.type('_UIModernBarButton').and(by.label('Back'))).tap();
- }
- },
- tapDeviceBackAndroid: () => {
- exec.execSync('adb shell input keyevent 4');
- }
- };
|