<commit_before>/*
 * Copyright © 2013 VillageReach.  All Rights Reserved.  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 *
 * If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package org.openlmis.pageobjects;


import com.thoughtworks.selenium.SeleneseTestNgHelper;
import org.openlmis.UiUtils.TestWebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
import org.openqa.selenium.support.ui.Select;

import java.io.IOException;

import static com.thoughtworks.selenium.SeleneseTestBase.assertTrue;
import static com.thoughtworks.selenium.SeleneseTestNgHelper.assertEquals;


public class TemplateConfigPage extends Page {


  @FindBy(how = How.LINK_TEXT, using = "Logout")
  private static WebElement logoutLink;

  @FindBy(how = How.XPATH, using = "//input[@value='Save']")
  private static WebElement SaveButton;

  @FindBy(how = How.XPATH, using = "//div[@id='saveSuccessMsgDiv' and @ng-show='message']")
  private static WebElement saveSuccessMsg;

  @FindBy(how = How.XPATH, using = "//div[@id='saveSuccessMsgDiv' and @ng-show='error']")
  private static WebElement saveErrorMsgDiv;

  @FindBy(how = How.XPATH, using = "//li[@id='E']/span[@class='tpl-source']/span/select")
  private static WebElement stockInHandDropDown;

  @FindBy(how = How.XPATH, using = "//li[@id='A']/span/span/span/span/input[@type='checkbox']")
  private static WebElement checkboxBeginningBalance;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span[@class='tpl-source']/span/select")
  private static WebElement dropDownTotalConsumedQuantity;

  @FindBy(how = How.XPATH, using = "//li[@id='W']/span[@class='tpl-error']/div")
  private static WebElement requestedQtyExplanationErrorMessage;

  @FindBy(how = How.XPATH, using = "//li[@id='J']/span[@class='tpl-error']/div")
  private static WebElement requestedQtyErrorMessage;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span[@class='tpl-error']/div")
  private static WebElement totalConsumedQtyErrorMessage;

  @FindBy(how = How.XPATH, using = "//li[@id='E']/span[@class='tpl-error']/div")
  private static WebElement stockOnHandQtyErrorMessage;

  @FindBy(how = How.XPATH, using = "//li[@id='O']/span[@class='tpl-label']/input")
  private static WebElement productCode;

  @FindBy(how = How.XPATH, using = "//li[@id='O']/span[@class='tpl-source']/span[2]")
  private static WebElement productCodeSource;

  @FindBy(how = How.XPATH, using = "//li[@id='R']/span[@class='tpl-label']/input")
  private static WebElement productName;

  @FindBy(how = How.XPATH, using = "//li[@id='R']/span[@class='tpl-source']/span[2]")
  private static WebElement productNameSource;

  @FindBy(how = How.XPATH, using = "//li[@id='U']/span[@class='tpl-label']/input")
  private static WebElement unitOfIssue;

  @FindBy(how = How.XPATH, using = "//li[@id='U']/span[@class='tpl-source']/span[2]")
  private static WebElement unitOfIssueSource;

  @FindBy(how = How.XPATH, using = "//li[@id='A']/span[@class='tpl-label']/input")
  private static WebElement beginningBalance;

  @FindBy(how = How.XPATH, using = "//li[@id='A']/span[@class='tpl-source']/span[2]")
  private static WebElement beginningBalanceSource;

  @FindBy(how = How.XPATH, using = "//li[@id='B']/span[@class='tpl-label']/input")
  private static WebElement totalReceivedQuantity;

  @FindBy(how = How.XPATH, using = "//li[@id='B']/span[@class='tpl-source']/span[2]")
  private static WebElement totalReceivedQuantitySource;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span[@class='tpl-label']/input")
  private static WebElement totalConsumedQuantity;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span[@class='tpl-source']/span/select/option[@selected='selected']")
  private static WebElement totalConsumedQuantitySource;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span/input")
  private static WebElement totalConsumedQuantityCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='W']/span/input")
  private static WebElement requestedQuantityCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='G']/span/input")
  private static WebElement expirationDateCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='G']/span[@class='tpl-label']/input")
  private static WebElement expirationDateTextBox;

  @FindBy(how = How.XPATH, using = "//li[@id='G']/span[@class='tpl-source']/span[2]")
  private static WebElement expirationDateSource;

  @FindBy(how = How.XPATH, using = "//li[@id='J']/span/input")
  private static WebElement requestedQuantityExplanationCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='M']/span/input")
  private static WebElement totalCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='M']/span[@class='tpl-label']/input")
  private static WebElement totalTextBox;

  @FindBy(how = How.XPATH, using = "//li[@id='M']/span[@class='tpl-source']/span[2]")
  private static WebElement totalSource;

  @FindBy(how = How.XPATH, using = "//li[@id='O']/span/input")
  private static WebElement productCodeCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='R']/span/input")
  private static WebElement productNameCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='L']/span[@class='tpl-visible']/input")
  private static WebElement remarksCheckBox;
<commit_msg>Fixing locator of Total field on program template screen<commit_after>/*
 * Copyright © 2013 VillageReach.  All Rights Reserved.  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 *
 * If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package org.openlmis.pageobjects;


import com.thoughtworks.selenium.SeleneseTestNgHelper;
import org.openlmis.UiUtils.TestWebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
import org.openqa.selenium.support.ui.Select;

import java.io.IOException;

import static com.thoughtworks.selenium.SeleneseTestBase.assertTrue;
import static com.thoughtworks.selenium.SeleneseTestNgHelper.assertEquals;


public class TemplateConfigPage extends Page {


  @FindBy(how = How.LINK_TEXT, using = "Logout")
  private static WebElement logoutLink;

  @FindBy(how = How.XPATH, using = "//input[@value='Save']")
  private static WebElement SaveButton;

  @FindBy(how = How.XPATH, using = "//div[@id='saveSuccessMsgDiv' and @ng-show='message']")
  private static WebElement saveSuccessMsg;

  @FindBy(how = How.XPATH, using = "//div[@id='saveSuccessMsgDiv' and @ng-show='error']")
  private static WebElement saveErrorMsgDiv;

  @FindBy(how = How.XPATH, using = "//li[@id='E']/span[@class='tpl-source']/span/select")
  private static WebElement stockInHandDropDown;

  @FindBy(how = How.XPATH, using = "//li[@id='A']/span/span/span/span/input[@type='checkbox']")
  private static WebElement checkboxBeginningBalance;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span[@class='tpl-source']/span/select")
  private static WebElement dropDownTotalConsumedQuantity;

  @FindBy(how = How.XPATH, using = "//li[@id='W']/span[@class='tpl-error']/div")
  private static WebElement requestedQtyExplanationErrorMessage;

  @FindBy(how = How.XPATH, using = "//li[@id='J']/span[@class='tpl-error']/div")
  private static WebElement requestedQtyErrorMessage;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span[@class='tpl-error']/div")
  private static WebElement totalConsumedQtyErrorMessage;

  @FindBy(how = How.XPATH, using = "//li[@id='E']/span[@class='tpl-error']/div")
  private static WebElement stockOnHandQtyErrorMessage;

  @FindBy(how = How.XPATH, using = "//li[@id='O']/span[@class='tpl-label']/input")
  private static WebElement productCode;

  @FindBy(how = How.XPATH, using = "//li[@id='O']/span[@class='tpl-source']/span[2]")
  private static WebElement productCodeSource;

  @FindBy(how = How.XPATH, using = "//li[@id='R']/span[@class='tpl-label']/input")
  private static WebElement productName;

  @FindBy(how = How.XPATH, using = "//li[@id='R']/span[@class='tpl-source']/span[2]")
  private static WebElement productNameSource;

  @FindBy(how = How.XPATH, using = "//li[@id='U']/span[@class='tpl-label']/input")
  private static WebElement unitOfIssue;

  @FindBy(how = How.XPATH, using = "//li[@id='U']/span[@class='tpl-source']/span[2]")
  private static WebElement unitOfIssueSource;

  @FindBy(how = How.XPATH, using = "//li[@id='A']/span[@class='tpl-label']/input")
  private static WebElement beginningBalance;

  @FindBy(how = How.XPATH, using = "//li[@id='A']/span[@class='tpl-source']/span[2]")
  private static WebElement beginningBalanceSource;

  @FindBy(how = How.XPATH, using = "//li[@id='B']/span[@class='tpl-label']/input")
  private static WebElement totalReceivedQuantity;

  @FindBy(how = How.XPATH, using = "//li[@id='B']/span[@class='tpl-source']/span[2]")
  private static WebElement totalReceivedQuantitySource;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span[@class='tpl-label']/input")
  private static WebElement totalConsumedQuantity;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span[@class='tpl-source']/span/select/option[@selected='selected']")
  private static WebElement totalConsumedQuantitySource;

  @FindBy(how = How.XPATH, using = "//li[@id='C']/span/input")
  private static WebElement totalConsumedQuantityCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='W']/span/input")
  private static WebElement requestedQuantityCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='G']/span/input")
  private static WebElement expirationDateCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='G']/span[@class='tpl-label']/input")
  private static WebElement expirationDateTextBox;

  @FindBy(how = How.XPATH, using = "//li[@id='G']/span[@class='tpl-source']/span[2]")
  private static WebElement expirationDateSource;

  @FindBy(how = How.XPATH, using = "//li[@id='J']/span/input")
  private static WebElement requestedQuantityExplanationCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='Y']/span/input")
  private static WebElement totalCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='Y']/span[@class='tpl-label']/input")
  private static WebElement totalTextBox;

  @FindBy(how = How.XPATH, using = "//li[@id='Y']/span[@class='tpl-source']/span[2]")
  private static WebElement totalSource;

  @FindBy(how = How.XPATH, using = "//li[@id='O']/span/input")
  private static WebElement productCodeCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='R']/span/input")
  private static WebElement productNameCheckBox;

  @FindBy(how = How.XPATH, using = "//li[@id='L']/span[@class='tpl-visible']/input")
  private static WebElement remarksCheckBox;

{'fraction_non_alphanumeric': 0.175191700496166, 'fraction_numerical': 0.0027063599458728013, 'mean_word_length': 5.295286768881318, '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': '2897979', 'n_tokens_mistral': 3863, 'n_tokens_neox': 3768, 'n_words': 722}