<commit_before>package insynctive.pages.insynctive;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

import insynctive.pages.Page;
import insynctive.pages.PageInterface;
import insynctive.utils.MailManager;
import insynctive.utils.Sleeper;
import insynctive.utils.TwilioUtil;

public class TwoFAPage extends Page implements PageInterface {

	@FindBy(id = "SendOneTimeCodeViaEmail")
	WebElement sendViaPrimaryEmailBox;
	@FindBy(id = "SendOneTimeCodeViaText")
	WebElement sendViaPhone;

	@FindBy(id = "txtVerificationCode")
	WebElement verificationCodeInput;
	
	@FindBy(id = "btnSendVerificationCode")
	WebElement sendVerificationBtn;
	@FindBy(id = "btnCheckVerificationCode")
	WebElement checkVerificationCode;
	
	public TwoFAPage(WebDriver driver, String enviroment) {
		super(driver);
		this.enviroment = enviroment;
		this.PAGE_URL = "http://" + enviroment + ".insynctiveapps.com/Insynctive.Hub/TwoFA/ChannelSelect?mode=c&SkipGuide=True";
		this.PAGE_TITLE = "Authentication";
		PageFactory.initElements(driver, this);
	}
	
	@Override
	public boolean isPageLoad() {
		// TODO Auto-generated method stub
		return false;
	}

	public void sendViaPrimaryEmail(String gmailEmail, String gmailPassword) throws Exception {
		clickAButton(sendViaPrimaryEmailBox);
		clickAButton(sendVerificationBtn);

		String verificationCode = MailManager.getVerificationCode(gmailEmail, gmailPassword);
		
		setTextInField(verificationCodeInput, verificationCode);
		clickAButton(checkVerificationCode);
	}

	public void sendViaPhone() throws Exception {
		clickAButton(sendViaPhone);
		clickAButton(sendVerificationBtn);

		Sleeper.sleep(5000, driver);
		String verificationCode = TwilioUtil.getVerificationCode();
		
		setTextInField(verificationCodeInput, verificationCode);
		clickAButton(checkVerificationCode);<commit_msg>more time to wait phone verification<commit_after>package insynctive.pages.insynctive;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

import insynctive.pages.Page;
import insynctive.pages.PageInterface;
import insynctive.utils.MailManager;
import insynctive.utils.Sleeper;
import insynctive.utils.TwilioUtil;

public class TwoFAPage extends Page implements PageInterface {

	@FindBy(id = "SendOneTimeCodeViaEmail")
	WebElement sendViaPrimaryEmailBox;
	@FindBy(id = "SendOneTimeCodeViaText")
	WebElement sendViaPhone;

	@FindBy(id = "txtVerificationCode")
	WebElement verificationCodeInput;
	
	@FindBy(id = "btnSendVerificationCode")
	WebElement sendVerificationBtn;
	@FindBy(id = "btnCheckVerificationCode")
	WebElement checkVerificationCode;
	
	public TwoFAPage(WebDriver driver, String enviroment) {
		super(driver);
		this.enviroment = enviroment;
		this.PAGE_URL = "http://" + enviroment + ".insynctiveapps.com/Insynctive.Hub/TwoFA/ChannelSelect?mode=c&SkipGuide=True";
		this.PAGE_TITLE = "Authentication";
		PageFactory.initElements(driver, this);
	}
	
	@Override
	public boolean isPageLoad() {
		// TODO Auto-generated method stub
		return false;
	}

	public void sendViaPrimaryEmail(String gmailEmail, String gmailPassword) throws Exception {
		clickAButton(sendViaPrimaryEmailBox);
		clickAButton(sendVerificationBtn);

		String verificationCode = MailManager.getVerificationCode(gmailEmail, gmailPassword);
		
		setTextInField(verificationCodeInput, verificationCode);
		clickAButton(checkVerificationCode);
	}

	public void sendViaPhone() throws Exception {
		clickAButton(sendViaPhone);
		clickAButton(sendVerificationBtn);

		Sleeper.sleep(9000, driver);
		String verificationCode = TwilioUtil.getVerificationCode();
		
		setTextInField(verificationCodeInput, verificationCode);
		clickAButton(checkVerificationCode);
{'fraction_non_alphanumeric': 0.09116662374452743, 'fraction_numerical': 0.0020602626834921455, 'mean_word_length': 6.862348178137652, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5625607', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1198, 'n_words': 214}