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

GZ/cleanup code and add test suites #103

Merged
merged 7 commits into from
Sep 7, 2018
Merged

Conversation

gigiyy
Copy link
Contributor

@gigiyy gigiyy commented Sep 3, 2018

updated the android gradle plugin version.
add test suite for sdk androidTest classes(some how not able to run all test at once under package using AndroidStudio).

@guillaumedebavelaere
Copy link
Contributor

It is working for me to run all the tests under the package. However the exampleApp tests are not working anymore...

@gigiyy
Copy link
Contributor Author

gigiyy commented Sep 4, 2018

it seems the waiting time adjusted before merge has lost. adding those back and now it's passing.

@guillaumedebavelaere
Copy link
Contributor

How do you run your tests? I right click on the class to test.
For exampleAppKotlin, I got empty test suite error.
For exampleApp Java, the last 2 tests fail, I got:

android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with text: a string containing "oAuthFlow Success:"' doesn't match the selected view.
Expected: with text: a string containing "oAuthFlow Success:"
Got: "AppCompatTextView{id=2131165284, res-name=oAuthTextViewResult, visibility=VISIBLE, width=1028, height=1278, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@cbd3bd1, tag=null, root-is-layout-requested=false, has-input-connection=false, x=26.0, y=280.0, text=Brokers available: [Broker{shortName='Dummy', longName='Dummy Broker', brokerInstruments=[BrokerInstrument{instrument='EQUITIES', supportsAccountOverview=true, supportsOrderCanceling=true, isFeatured=false, supportsOrderStatus=true, supportsPositions=true, supportsFxRates=false, supportsTrading=true, supportsTransactionHistory=true}, BrokerInstrument{instrument='OPTIONS', supportsAccountOverview=true, supportsOrderCanceling=true, isFeatured=false, supportsOrderStatus=true, supportsPositions=true, supportsFxRates=false, supportsTrading=true, supportsTransactionHistory=true}]}, Broker{shortName='DummyFx', longName='Dummy FX Broker', brokerInstruments=[BrokerInstrument{instrument='FX', supportsAccountOverview=true, supportsOrderCanceling=true, isFeatured=false, supportsOrderStatus=true, supportsPositions=true, supportsFxRates=true, supportsTrading=true, supportsTransactionHistory=true}]}]\n, input-type=0, ime-target=false, has-links=false}"

android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with text: a string containing "1 PARCELED LINKED BROKERS"' doesn't match the selected view.
Expected: with text: a string containing "1 PARCELED LINKED BROKERS"
Got: "AppCompatTextView{id=2131165272, res-name=linked_brokers_textview, visibility=VISIBLE, width=976, height=966, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@fdb90a3, tag=null, root-is-layout-requested=false, has-input-connection=false, x=52.0, y=152.0, text==== 2 PARCELED LINKED BROKERS ===\n\nLINKED BROKER: TradeItLinkedBrokerParcelable{TradeItLinkedLogin=TradeItLinkedLogin{userToken='U2S9CCOKmAJvhyCB17LPrUyrBpDj%2FeGktji6lHhEJoO3juVUIgas6Yf%2BiEsNkUuZQ1kGLmyCoXVK21X312xD6Th7uUlopm6bkDEFBZ%2F6Yx6Mt6CKG6HfDDOQslY2Pml3yYRcttWCq1M2TcJevCTs3Q%3D%3D', userId='6df15361333775509e63', broker='Dummy', label='MyAccountLabel'}, accounts=[], accountsLastUpdated=Thu Jan 01 01:59:59 GMT+03:00 1970, error=TradeItErrorResult{errorCode=SESSION_EXPIRED, shortMessage='Authentication required', longMessages=[Linked broker was not authenticated after initializing.], systemMessage='null', httpCode=200}}\n\n===\n\nLINKED BROKER: TradeItLinkedBrokerParcelable{TradeItLinkedLogin=TradeItLinkedLogin{userToken='xeu7%2Ff76bm39hOXAf7hMVoWxvc7LWs6k1u4dCv3BkpUVEiIGr%2BfC91tgpSDm8Lirj%2BdB%2BiwobVlfxZtGT3utkAV%2Bss6blxpUKc1BUwcrO8EDfmh6HP5tmxpqYRsV4vh%2Bbxr%2F7hgTWvct%2FXCnmsArGQ%3D%3D', userId='8b715361333932330f72', broker='Dummy', label='MyAccountLabel'}, accounts=[], accountsLastUpdated=Thu Jan 01 01:59:59 GMT+03:00 1970, error=TradeItErrorResult{errorCode=SESSION_EXPIRED, shortMessage='Authentication required', longMessages=[Linked broker was not authenticated after initializing.], systemMessage='null', httpCode=200}}\n\n===\n\n, input-type=0, ime-target=false, has-links=false}"

@gigiyy
Copy link
Contributor Author

gigiyy commented Sep 6, 2018

for both MainActivityTest, I started the tests by right clicking the class and choose run MainActivityTest.

@guillaumedebavelaere
Copy link
Contributor

It is working now... I think I need to do nothing when running the tests, otherwise it fails.

@guillaumedebavelaere guillaumedebavelaere merged commit df55535 into develop Sep 7, 2018
@guillaumedebavelaere guillaumedebavelaere deleted the gd/clean_up_code branch September 7, 2018 11:53
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