<commit_before>/*
 * This program is part of the OpenLMIS logistics management information system platform software.
 * Copyright © 2013 VillageReach
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 *  
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
 * You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses.  For additional information contact <EMAIL>. 
 */

package org.openlmis.functional;


import cucumber.api.java.After;
import cucumber.api.java.Before;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.openlmis.UiUtils.CaptureScreenshotOnFailureListener;
import org.openlmis.UiUtils.TestCaseHelper;
import org.openlmis.pageobjects.ConfigureEDIPage;
import org.openlmis.pageobjects.ConfigureBudgetPage;
import org.openlmis.pageobjects.HomePage;
import org.openlmis.pageobjects.LoginPage;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;
import org.testng.annotations.*;

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


@TransactionConfiguration(defaultRollback = true)
@Transactional

@Listeners(CaptureScreenshotOnFailureListener.class)

public class ConfigureBudgetTemplate extends TestCaseHelper {


    @BeforeMethod(groups = "admin")
    @Before
    public void setUp() throws Exception {
        super.setup();
        dbWrapper.setupBudgetFileConfiguration("false");
        dbWrapper.defaultSetupBudgetFileColumns();
    }

    @And("^I access configure budget page$")
    public void accessOrderScreen() throws Exception {
        HomePage homePage = new HomePage(testWebDriver);
        ConfigureEDIPage configureEDIPage = homePage.navigateEdiScreen();
        configureEDIPage.navigateConfigureBudgetPage();
    }

    @And("^I should see default include column headers as \"([^\"]*)\"$")
    public void verifyIncludeColumnHeader(String status) throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        assertEquals(String.valueOf(configureBudgetPage.getIncludeHeader()), status);
    }

    @And("^I verify default checkbox for all data fields$")
    public void verifyDefaultDataFieldsCheckBox() throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        configureBudgetPage.verifyDefaultIncludeCheckboxForAllDataFields();
    }

    @And("^I verify default value of positions$")
    public void verifyDefaultPositionValues() throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        configureBudgetPage.verifyDefaultPositionValues();
    }

    @When("^I save budget file format$")
    public void clickSave() throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        configureBudgetPage.clickSaveButton();
    }

    @Then("^I should see budget successfull saved message as \"([^\"]*)\"$")
    public void verifySaveSuccessfullyMessage(String message) throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        configureBudgetPage.verifyMessage(message);
    }

    @Test(groups = {"admin"}, dataProvider = "Data-Provider-Function")
    public void testVerifyDefaultSelectionOfPackedDropdown(String user, String password) throws Exception {<commit_msg>Raman - Fixed requisition smoke for missing step<commit_after>/*
 * This program is part of the OpenLMIS logistics management information system platform software.
 * Copyright © 2013 VillageReach
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 *  
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
 * You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses.  For additional information contact <EMAIL>. 
 */

package org.openlmis.functional;


import cucumber.api.java.After;
import cucumber.api.java.Before;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.openlmis.UiUtils.CaptureScreenshotOnFailureListener;
import org.openlmis.UiUtils.TestCaseHelper;
import org.openlmis.pageobjects.ConfigureEDIPage;
import org.openlmis.pageobjects.ConfigureBudgetPage;
import org.openlmis.pageobjects.HomePage;
import org.openlmis.pageobjects.LoginPage;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;
import org.testng.annotations.*;

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


@TransactionConfiguration(defaultRollback = true)
@Transactional

@Listeners(CaptureScreenshotOnFailureListener.class)

public class ConfigureBudgetTemplate extends TestCaseHelper {


    @BeforeMethod(groups = "admin")
    @Before
    public void setUp() throws Exception {
        super.setup();
        dbWrapper.setupBudgetFileConfiguration("false");
        dbWrapper.defaultSetupBudgetFileColumns();
    }

    @And("^I access configure budget page$")
    public void accessOrderScreen() throws Exception {
        HomePage homePage = new HomePage(testWebDriver);
        ConfigureEDIPage configureEDIPage = homePage.navigateEdiScreen();
        configureEDIPage.navigateConfigureBudgetPage();
    }

    @And("^I should see default include column headers as \"([^\"]*)\"$")
    public void verifyIncludeColumnHeader(String status) throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        assertEquals(String.valueOf(configureBudgetPage.getIncludeHeader()), status);
    }

    @And("^I verify default checkbox for all data fields$")
    public void verifyDefaultDataFieldsCheckBox() throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        configureBudgetPage.verifyDefaultIncludeCheckboxForAllDataFields();
    }

    @And("^I verify default value of positions$")
    public void verifyDefaultPositionValues() throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        configureBudgetPage.verifyDefaultPositionValues();
    }

    @When("^I save budget file format$")
    public void clickSave() throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        configureBudgetPage.clickSaveButton();
    }

    @Then("^I should see budget successful saved message as \"([^\"]*)\"$")
    public void verifySaveSuccessfullyMessage(String message) throws Exception {
        ConfigureBudgetPage configureBudgetPage = new ConfigureBudgetPage(testWebDriver);
        configureBudgetPage.verifyMessage(message);
    }

    @Test(groups = {"admin"}, dataProvider = "Data-Provider-Function")
    public void testVerifyDefaultSelectionOfPackedDropdown(String user, String password) throws Exception {
{'fraction_non_alphanumeric': 0.07929782082324455, 'fraction_numerical': 0.0012106537530266344, 'mean_word_length': 4.89650249821556, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5532894', 'n_tokens_mistral': 2229, 'n_tokens_neox': 2114, 'n_words': 614}