I have converted my maven appium automation to gradle recently. When i try to build using gradle it throws compileTestJava error. But it was working fine while running from Maven. Attached my import, code and error logs as follows. Can somebody please help me on this?
import com.TCS.nlapp.model.Customer;
import com.TCS.nlapp.model.Card;
import com.TCS.nlapp.model.Product;
import com.TCS.nlapp.utils.CsvFileReader;
import com.google.common.base.Predicate;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileBy;
import static java.util.stream.Collectors.toList;
import io.appium.java_client.PerformsTouchActions;
import io.appium.java_client.TouchAction;
import io.appium.java_client.android.AndroidTouchAction;
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
import io.appium.java_client.touch.TapOptions;
import io.appium.java_client.touch.offset.ElementOption;
import io.appium.java_client.touch.offset.PointOption;
import io.cucumber.java.Scenario;
import net.serenitybdd.core.Serenity;
import net.serenitybdd.core.environment.EnvironmentSpecificConfiguration;
import net.serenitybdd.core.pages.PageObject;
import net.thucydides.core.steps.StepEventBus;
import net.thucydides.core.util.EnvironmentVariables;
import net.thucydides.core.util.SystemEnvironmentVariables;
import net.thucydides.core.webdriver.WebDriverFacade;
import org.apache.commons.lang3.RandomStringUtils;
import org.openqa.selenium.*;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.util.stream.Collectors;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Optional;
import java.util.Properties;
public static Customer getCustomer(String userType) {
Optional customer =
CsvFileReader.getCustomerDataFromCsv().stream()
.filter(c -> c.getCustomerType().equals(userType))
.findFirst();
if (customer.isPresent()) {
return customer.get();
} else {
throw new RuntimeException(String.format("Customer %s not found!", userType));
}
}
**
- Error it shows:
**
/src/test/java/com//pages/AppiumPageObject.java:502: error: cannot find symbol
.filter(c -> c.getCustomerType().equals(userType))
^
symbol: method getCustomerType()
location: variable c of type com.TCS.app.model.Customer