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

Status is never undefined #181

Merged
merged 1 commit into from
Feb 13, 2013
Merged

Status is never undefined #181

merged 1 commit into from
Feb 13, 2013

Conversation

bootstraponline
Copy link
Member

I don't think status should ever be an object.

@jlipps
Copy link
Member

jlipps commented Feb 13, 2013

I think you're right. I'm wondering if there are any cases where we are currently accidentally returning a Status object instead of its code in result.status. Did you run the tests with this branch? If so, this looks like a good check. If not, we should run them and if they fail investigate whether we are returning something other than a status code somewhere on accident.

@bootstraponline
Copy link
Member Author

Did you run the tests with this branch?

Is there just one test?

$ grunt functional
Running "functional" task


  elementsByName
    ✓ should find multiple elements by valid name (931ms)


  1 test complete (24 seconds)

Appium server exited

Done, without errors.

@bootstraponline
Copy link
Member Author

It passes the 3 unit tests.

$ grunt unit
Running "mochaTest:unit" (mochaTest) task


  IOS
    #proxy()
      ✓ should execute one command at a time keeping the seq right (528ms)

  Appium
    #start
      ✓ should queue up subsequent calls and execute them sequentially (400ms)

  Appium
    #attachTo
      ✓ should get valid routes 


  ✔ 3 tests complete (946 ms)


Done, without errors.

It seems like that's a low amount of tests though.

@bootstraponline
Copy link
Member Author

I found grunt test. It fails on

◦ should get device details: error: Instruments did not launch successfully, failing session

The master branch of appium fails in the same way so I think it's unrelated to this pull request. The test never pass. It'd be nice if Sauce Labs setup a continuous integration server that automatically ran the tests on each pull request.

@jlipps
Copy link
Member

jlipps commented Feb 13, 2013

if you pull, you should be able to run all the functional tests again, someone checked in an it.only

@bootstraponline
Copy link
Member Author

if you pull, you should be able to run all the functional tests again, someone checked in an it.only

I pulled and I'm getting the same error.

Running "mochaTest:appiumutils" (mochaTest) task


  appiumutils
    ◦ should get device details: error: Instruments did not launch successfully, failing session

@jlipps
Copy link
Member

jlipps commented Feb 13, 2013

it could be that you need to update npm packages (i can't see why appium is crashing). to be sure, can you rm -rf node_modules/ and npm install and grunt buildApp:TestApp. meanwhile i'll try your change and see what happens over here.

@bootstraponline
Copy link
Member Author

One test fails when running grunt functional. It's not clear which test failed or if it's specific to this pull request.

  execute
    1) "before each" hook

  ✖ 1 of 70 tests failed:

  1) execute "before each" hook:
     Error: timeout of 60000ms exceeded
      at Object.<anonymous> (/usr/local/lib/node_modules/mocha/lib/runnable.js:167:14)
      at Timer.list.ontimeout (timers.js:101:19)

@jlipps
Copy link
Member

jlipps commented Feb 13, 2013

also you probably already know this but when running 'grunt functional' you can't be running any other appium processes.

@jlipps
Copy link
Member

jlipps commented Feb 13, 2013

these tests appear to be working for me.

@bootstraponline
Copy link
Member Author

it could be that you need to update npm packages (i can't see why appium is crashing). to be sure, can you rm -rf node_modules/ and npm install and grunt buildApp:TestApp. meanwhile i'll try your change and see what happens over here.

I ran these commands. I'll try again.

also you probably already know this but when running 'grunt functional' you can't be running any other appium processes.

I found that out when it failed the first time.

@bootstraponline
Copy link
Member Author

these tests appear to be working for me.

If it works for you then that's good enough to merge I think.

@bootstraponline
Copy link
Member Author

I ran the tests again and this is what it times out on.

execute
    ◦ should do UIAutomation commands if not in web frame: 

@jlipps
Copy link
Member

jlipps commented Feb 13, 2013

that timeout is some kind of flakey behavior; when I run the tests by hand, they all pass (except some that i'm just fixing in another thread). i'll go ahead and merge this and we'll revisit if there are any issues.

jlipps added a commit that referenced this pull request Feb 13, 2013
@jlipps jlipps merged commit 0a98f4e into appium:master Feb 13, 2013
@bootstraponline
Copy link
Member Author

Thanks.

@jlipps
Copy link
Member

jlipps commented Feb 13, 2013

by the way, if you're running grunt test or similar, you can run grunt log in another window to see the appium log. so maybe we can see why appium is crashing and causing the test to timeout if it keeps happening.

@bootstraponline
Copy link
Member Author

Node install is now throwing an error. I'll spend some more time tomorrow and see if I can figure it out. Thanks for the tip about grunt log.

$ node install .

module.js:340
    throw err;

@jlipps
Copy link
Member

jlipps commented Feb 14, 2013

that should be npm install

@bootstraponline
Copy link
Member Author

You're right. I mixed up node and npm. This is the error message from grunt log when running grunt test

info: [INST STDERR] 2013-02-13 21:42:50.952 instruments[554:1207] -[NSAlert alertWithError:] called with nil NSError. A generic error message will be displayed, but the user deserves better.

@jlipps
Copy link
Member

jlipps commented Feb 14, 2013

That error means the app can't be found or loaded in the sim.

  • which version of XCode are you using?
  • do you have the iOS 6.0 SDK installed as well as 6.1? Sometimes you need to do this. Go to preferences in XCode and you'll see how to download it
  • please pull and run the reset/rebuild again. the test app has changed a few times. If you're not running 6.1 you'll need to compile the apps for 6.0 by running e.g. grunt buildApp:TestApp:iphonesimulator6.0

@bootstraponline
Copy link
Member Author

I'm using Xcode 4.6. I installed the iOS 6.0 SDK in addition to 6.1. I ran git pull followed by these commands and still get the same error.

@jlipps
Copy link
Member

jlipps commented Feb 14, 2013

What happens if you try this:

grunt appium:TestApp

Or this:

grunt appium:UICatalog

These commands try to pre-launch the server with an app. Do you get the same error with both?

On Feb 13, 2013, at 8:00 PM, bootstraponline notifications@github.com wrote:

I'm using Xcode 4.6. I installed the iOS 6.0 SDK in addition to 6.1. I ran git pull followed by these commands and still get the same error.


Reply to this email directly or view it on GitHub.

@bootstraponline
Copy link
Member Author

  • grunt appium:TestApp works.
  • grunt appium:UICatalog fails with the same error.

@jlipps
Copy link
Member

jlipps commented Feb 14, 2013

Ok, what does the appium server output say? For instance, at the beginning mine says:

info: Starting Appium in pre-launch mode
info: Pre-launching app
info: Using app from command line: /Users/jlipps/Code/appium-jlipps/sample-code/apps/UICatalog/build/Release-iphonesimulator/UICatalog.app

Check that the path it's using for the app actually exists and is absolute?

On Feb 14, 2013, at 8:16 AM, bootstraponline notifications@github.com wrote:

grunt appium:TestApp works.
grunt appium:UICatalog fails with the same error.

Reply to this email directly or view it on GitHub.

@bootstraponline
Copy link
Member Author

The app builds however it doesn't exist. The path is absolute.

$ grunt buildApp:UICatalog
Running "buildApp:UICatalog" (buildApp) task
Building app...
Failed building app

Done, without errors
>  File.exists? '/Users/appium/Desktop/appium/appium/sample-code/apps/UICatalog/build/Release-iphonesimulator/UICatalog.app'
 => false 

@jlipps
Copy link
Member

jlipps commented Feb 14, 2013

Failed building app

It doesn't look like it builds! Wonder why it didn't throw an error though. Try running this

grunt downloadApp && grunt buildApp:UICatalog

Does that work? (Maybe you just didn't have the uicatalog app source--we don't keep it in our repo for licensing reasons)

On Feb 14, 2013, at 9:22 AM, bootstraponline notifications@github.com wrote:

The app builds however it doesn't exist. The path is absolute.

$ grunt buildApp:UICatalog
Running "buildApp:UICatalog" (buildApp) task
Building app...
Failed building app

Done, without errors

File.exists? '/Users/appium/Desktop/appium/appium/sample-code/apps/UICatalog/build/Release-iphonesimulator/UICatalog.app'
=> false

Reply to this email directly or view it on GitHub.

@bootstraponline
Copy link
Member Author

Done, without errors === Failed. Interesting.

$  grunt downloadApp && grunt buildApp:UICatalog
Running "downloadApp" task
Downloading UI catalog into /Users/appium/Desktop/appium/appium/sample-code/apps/UICatalog.zip
Download complete
Unzipped into /Users/appium/Desktop/appium/appium/sample-code/apps/UICatalog

Done, without errors.
Running "buildApp:UICatalog" (buildApp) task
Building app...

Done, without errors.

grunt appium:UICatalog works now.

@jlipps
Copy link
Member

jlipps commented Feb 14, 2013

fixed in #188

dpgraham pushed a commit to dpgraham/appium that referenced this pull request Oct 1, 2018
Add test for picker wheel interaction
dpgraham pushed a commit to dpgraham/appium that referenced this pull request Nov 7, 2018
Add test for picker wheel interaction
boneskull pushed a commit to boneskull/appium that referenced this pull request May 17, 2021
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.

None yet

2 participants