This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import wd from 'wd'; | |
| jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000; | |
| const PORT = 4723; | |
| const config = { | |
| platformName: 'Android', | |
| deviceName: 'Android Emulator', | |
| app: './android/app/build/outputs/apk/app-debug.apk' // relative to root of project | |
| }; | |
| const driver = wd.promiseChainRemote('localhost', PORT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| render() { | |
| return ( | |
| <View style={styles.container} accessibilityLabel="testview"> | |
| <Text style={styles.welcome}> | |
| Welcome to React Native! | |
| </Text> | |
| ... | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test('appium text input', async () => { | |
| const TEXT = 'hello this is appium'; | |
| await driver.elementByAccessibilityId('textinput') | |
| .type(TEXT); | |
| const resultText = await driver.elementByAccessibilityId('text').text(); | |
| expect(resultText).toBe(TEXT) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class appiumTutorial extends Component { | |
| state = { | |
| counter: 0, | |
| text: '', | |
| } | |
| onPress = () => this.setState({ counter: this.state.counter + 1 }) | |
| onChangeText = text => this.setState({ text }) | |
| render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pytest | |
| import os | |
| from appium import webdriver | |
| @pytest.fixture(scope="function") | |
| def driver(): | |
| driver = webdriver.Remote( | |
| command_executor='http://127.0.0.1:4723/wd/hub', | |
| desired_capabilities={ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def test_basic(driver): | |
| WAIT_SEC = 10 | |
| driver.implicitly_wait(WAIT_SEC) | |
| elem = driver.find_element_by_accessibility_id('testview') | |
| assert elem is not None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pytest | |
| import os | |
| from appium import webdriver | |
| AWS = 'aws' | |
| LOCAL = 'local' | |
| def get_desired_capabilities(location=AWS): | |
| if location == LOCAL: |