Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix raise an error for launch app and close app since they do not need in espresso #485

Merged
merged 4 commits into from
Aug 16, 2019

Conversation

KazuCocoa
Copy link
Member

Current launchApp missed espresso session like below scenario since espresso-driver does not establish a new session with the launched app

@driver.close_app
assert(@@core.wait { @driver.app_state('io.appium.android.apis') != :running_in_foreground })

@driver.launch_app
e = @@core.wait { @driver.find_element :accessibility_id, 'App' }
assert_equal 'App', e.text

Then, below error raises in find_element.

Appium::Core::Wait::TimeoutError: timed out after 20 seconds (An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: Error: socket hang up)

https://dev.azure.com/kazucocoa/ruby_lib_core/_build/results?buildId=1265

@mykola-mokhnach
Copy link
Contributor

I don't think launchApp/closeApp have much sense in Espresso, since terminating the app means session termination

@KazuCocoa
Copy link
Member Author

Ah... yeah, sounds reasonable.
Let me raise an error since they do not work expectedly.
Will mark as not support in espresso driver in https://github.com/appium/appium/blob/master/commands-yml/commands/device/app/launch-app.yml and https://github.com/appium/appium/blob/master/commands-yml/commands/device/app/close-app.yml

@KazuCocoa KazuCocoa changed the title fix launch app so that it can establish a session fix raise an error for launch app and close app since they do not need in espresso Aug 15, 2019
@@ -21,6 +21,16 @@ function assertRequiredOptions (options, requiredOptionNames) {
`You have only provided: ${JSON.stringify(presentOptionNames)}`);
}

// eslint-disable-next-line require-await
commands.launchApp = async function launchApp () {
throw new errors.UnsupportedOperationError('Please re-create a new session to configure the app under test correctly');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a new session in order to launch the application under test


// eslint-disable-next-line require-await
commands.closeApp = async function closeApp () {
throw new errors.UnsupportedOperationError('Please quit the session instead of closeApp');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please quit the session in order to close the application under test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants