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/preview kabu orders/160608393 #106

Merged
merged 2 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-rc02'
classpath 'com.android.tools.build:gradle:3.2.0-rc03'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import android.support.test.uiautomator.UiObjectNotFoundException;
import android.support.test.uiautomator.UiSelector;
import android.test.suitebuilder.annotation.LargeTest;
import android.widget.Button;
import android.widget.EditText;

import org.junit.Rule;
Expand Down Expand Up @@ -171,7 +172,7 @@ private void testOauthFlow(String dummyLogin) throws InterruptedException, UiObj
password.click();
password.setText("dummy");

UiObject button = device.findObject(selector.textContains("Sign In"));
UiObject button = device.findObject(selector.className(Button.class).instance(0));
button.click();

waitAwhile();
Expand All @@ -182,7 +183,7 @@ private void testOauthFlow(String dummyLogin) throws InterruptedException, UiObj
answer.click();
answer.setText("dummySecurity".equals(dummyLogin) ? "tradingticket" : "option 1");

UiObject submit = device.findObject(selector.textContains("Submit"));
UiObject submit = device.findObject(selector.className(Button.class).instance(0));
submit.click();

waitAwhile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,13 @@ private void previewTradeFirstLinkedBroker() {
} else if (linkedBrokers.get(0).getAccounts().isEmpty()) {
showAlert("previewTradeFirstLinkedBroker", "No linked broker accounts detected for first linked broker! Try authenticating.");
} else {
final TradeItOrderParcelable order = new TradeItOrderParcelable(linkedBrokers.get(0).getAccounts().get(0), "GE");
String symbol;
if (linkedBrokers.get(0).getBrokerName().equals("kabu")) {
symbol = "8703";
} else {
symbol = "GE";
}
final TradeItOrderParcelable order = new TradeItOrderParcelable(linkedBrokers.get(0).getAccounts().get(0), symbol);
order.setLimitPrice(20.0);
order.setExpiration(TradeItOrderExpirationType.GOOD_FOR_DAY);
order.setPriceType(TradeItOrderPriceType.LIMIT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,9 @@ class MainActivity : AppCompatActivity() {
linkedBrokers.isEmpty() -> showAlert("previewTradeFirstLinkedBroker", "No linked broker!")
linkedBrokers[0].accounts.isEmpty() -> showAlert("previewTradeFirstLinkedBroker", "No linked broker accounts detected for first linked broker! Try authenticating.")
else -> {
val order = TradeItOrderParcelable(linkedBrokers[0].accounts[0], "GE")
val broker = linkedBrokers.first()
val symbol = if (broker.brokerName == "kabu") "8703" else "GE"
val order = TradeItOrderParcelable(linkedBrokers[0].accounts[0], symbol)
order.limitPrice = 20.0
order.expiration = TradeItOrderExpirationType.GOOD_FOR_DAY
order.priceType = TradeItOrderPriceType.LIMIT
Expand Down