<commit_before>package com.qaprosoft.carina.demo.mobile.gui.pages.android;

import com.qaprosoft.carina.core.foundation.utils.factory.DeviceType;
import com.qaprosoft.carina.core.foundation.utils.mobile.MobileUtils;
import com.qaprosoft.carina.core.foundation.webdriver.decorator.ExtendedWebElement;
import com.qaprosoft.carina.demo.mobile.gui.pages.common.UIElementsPageBase;
import io.appium.java_client.TouchAction;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.events.EventFiringWebDriver;

import static io.appium.java_client.touch.offset.PointOption.point;

@DeviceType(pageType = DeviceType.Type.ANDROID_PHONE, parentClass = UIElementsPageBase.class)
public class UIElementsPage extends UIElementsPageBase {
    @FindBy(id = "editText")
    private ExtendedWebElement textField;

    @FindBy(id = "editText2")
    private ExtendedWebElement emailField;

    @FindBy(id = "editText3")
    private ExtendedWebElement dateField;

    @FindBy(id = "checkBox2")
    private ExtendedWebElement checkBoxButton;

    @FindBy(id = "radioButton")
    private ExtendedWebElement maleRadioButton;

    @FindBy(id = "radioButton3")
    private ExtendedWebElement femaleRadioButton;

    @FindBy(id = "radioButton5")
    private ExtendedWebElement otherRadioButton;

    @FindBy(id = "radioButton5")
    private ExtendedWebElement seekBarButton;

    public void typeText(String text) {
        textField.type(text);
    }

    public void typeEmail(String email) {
        emailField.type(email);
    }

    public void typeDate(String date) {
        dateField.type(date);
    }

    public void clickOnMaleRadioButton() {
        maleRadioButton.click();
    }

    public void clickOnFemaleRadioButton() {
        femaleRadioButton.click();
    }

    public void clickOnOtherRadioButton() {
        otherRadioButton.click();
    }

    @Override
    public void checkCopy() {
        MobileUtils.swipe(checkBoxButton, MobileUtils.Direction.DOWN);
        checkBoxButton.click();
    }

    public UIElementsPage(WebDriver driver) {
        super(driver);
    }

    private AndroidElement scrollToElement(ExtendedWebElement element) {
        AndroidDriver driver = (AndroidDriver) (((EventFiringWebDriver) getDriver()).getWrappedDriver());
        AndroidElement output = null;
        int numberOfTimes = 10;
        Dimension size = driver.manage().window().getSize();
        int anchor = size.width / 2;
        int startPoint = size.height - 10;
        int endPoint = size.height / 2;

        for (int i = 0; i < numberOfTimes; i++) {
            try {
                new TouchAction(driver)
                        .longPress(point(anchor, startPoint))
                        .moveTo(point(anchor, endPoint))
                        .release()
                        .perform();
                output = (AndroidElement) driver.findElement(element.getBy());
                i = numberOfTimes;
            } catch (NoSuchElementException ex) {
                System.out.println(String.format("Element not available. Scrolling (%s) times...", i + 1));
            }
        }
        return output;
    }
}<commit_msg>replace and remove scroll method.<commit_after>package com.qaprosoft.carina.demo.mobile.gui.pages.android;

import com.qaprosoft.carina.core.foundation.utils.factory.DeviceType;
import com.qaprosoft.carina.core.foundation.utils.mobile.MobileUtils;
import com.qaprosoft.carina.core.foundation.webdriver.decorator.ExtendedWebElement;
import com.qaprosoft.carina.demo.mobile.gui.pages.common.UIElementsPageBase;
import io.appium.java_client.TouchAction;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.events.EventFiringWebDriver;

import static io.appium.java_client.touch.offset.PointOption.point;

@DeviceType(pageType = DeviceType.Type.ANDROID_PHONE, parentClass = UIElementsPageBase.class)
public class UIElementsPage extends UIElementsPageBase {
    @FindBy(id = "editText")
    private ExtendedWebElement textField;

    @FindBy(id = "editText2")
    private ExtendedWebElement emailField;

    @FindBy(id = "editText3")
    private ExtendedWebElement dateField;

    @FindBy(id = "checkBox2")
    private ExtendedWebElement checkBoxButton;

    @FindBy(id = "radioButton")
    private ExtendedWebElement maleRadioButton;

    @FindBy(id = "radioButton3")
    private ExtendedWebElement femaleRadioButton;

    @FindBy(id = "radioButton5")
    private ExtendedWebElement otherRadioButton;

    @FindBy(id = "radioButton5")
    private ExtendedWebElement seekBarButton;

    @FindBy(className = "android.widget.ScrollView")
    private ExtendedWebElement container;

    public void typeText(String text) {
        textField.type(text);
    }

    public void typeEmail(String email) {
        emailField.type(email);
    }

    public void typeDate(String date) {
        dateField.type(date);
    }

    public void clickOnMaleRadioButton() {
        maleRadioButton.click();
    }

    public void clickOnFemaleRadioButton() {
        femaleRadioButton.click();
    }

    public void clickOnOtherRadioButton() {
        otherRadioButton.click();
    }

    @Override
    public void checkCopy() {
        MobileUtils.swipe(femaleRadioButton, container, 10);
        checkBoxButton.click();
    }

    public UIElementsPage(WebDriver driver) {
        super(driver);
    }

}
{'fraction_non_alphanumeric': 0.09873157353445321, 'fraction_numerical': 0.0037709976002742542, 'mean_word_length': 3.430523917995444, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5047663', 'n_tokens_mistral': 1763, 'n_tokens_neox': 1684, 'n_words': 306}