Comments (2)
Hi, Thanks for your information about appium.
I want to ask you something. Lets say I have 2 screens, Login Screen and Home Screen. Login Screen will loaded first then Home Screen
In Login screen I have accessibilityLabel fieldEmail and buttonLogin. In Home Screen I have accessibilityLabel buttonHome.
How to tell appium, we need access buttonHome when Home Screen loaded?This is my code
/* eslint-disable no-undef */ import wd from 'wd' jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000 const PORT = 4723 const config = { platformName: 'Android', deviceName: 'Pixel 3a XL API 29', app: '/Users/gandahalojasa/Documents/Project/Learn/Appium_React_Native/android/app/build/outputs/apk/debug/app-debug.apk' } const driver = wd.promiseChainRemote('localhost', PORT) beforeAll(async () => { await driver.init(config) await driver.sleep(4000) }) // Sometime for the app to load test('login screen test', async () => { expect(await driver.hasElementByAccessibilityId('fieldEmail')).toBe(true) await driver.elementByAccessibilityId('fieldEmail').type('[email protected]') expect(await driver.hasElementByAccessibilityId('buttonLogin')).toBe(true) const element = await driver.elementByAccessibilityId('buttonLogin') await element.click() expect(await driver.hasElementByAccessibilityId('notHere')).toBe(false) }) test('home screen test', async () => { expect(await driver.hasElementByAccessibilityId('buttonHome')).toBe(true) const element = await driver.elementByAccessibilityId('buttonHome') await element.click() })
Did you run this code in ios?
from react-native-e2etest.
Hi, Thanks for your information about appium.
I want to ask you something. Lets say I have 2 screens, Login Screen and Home Screen. Login Screen will loaded first then Home Screen
In Login screen I have accessibilityLabel fieldEmail and buttonLogin. In Home Screen I have accessibilityLabel buttonHome.
How to tell appium, we need access buttonHome when Home Screen loaded?
This is my code/* eslint-disable no-undef */ import wd from 'wd' jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000 const PORT = 4723 const config = { platformName: 'Android', deviceName: 'Pixel 3a XL API 29', app: '/Users/gandahalojasa/Documents/Project/Learn/Appium_React_Native/android/app/build/outputs/apk/debug/app-debug.apk' } const driver = wd.promiseChainRemote('localhost', PORT) beforeAll(async () => { await driver.init(config) await driver.sleep(4000) }) // Sometime for the app to load test('login screen test', async () => { expect(await driver.hasElementByAccessibilityId('fieldEmail')).toBe(true) await driver.elementByAccessibilityId('fieldEmail').type('[email protected]') expect(await driver.hasElementByAccessibilityId('buttonLogin')).toBe(true) const element = await driver.elementByAccessibilityId('buttonLogin') await element.click() expect(await driver.hasElementByAccessibilityId('notHere')).toBe(false) }) test('home screen test', async () => { expect(await driver.hasElementByAccessibilityId('buttonHome')).toBe(true) const element = await driver.elementByAccessibilityId('buttonHome') await element.click() })
Did you run this code in ios?
in run this code on android emulator
from react-native-e2etest.
Related Issues (7)
- Docs don't mention npm install HOT 1
- Scroll Action HOT 3
- node_modules/vargs/lib/vargs.js: arguments is a reserved word in strict mode (24:37 HOT 2
- How to disable the send notification pop up HOT 3
- can't find UI element using hasElementByAccessibilityId
- Error: 'E2E_DEVICE' is not recognized as an internal or external command HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-e2etest.