<commit_before>package org.jbehave.web.selenium;

import java.util.concurrent.TimeUnit;

import org.jbehave.scenario.annotations.AfterScenario;
import org.jbehave.scenario.annotations.BeforeScenario;
import org.jbehave.scenario.steps.Steps;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
import com.thoughtworks.selenium.condition.ConditionRunner;
import com.thoughtworks.selenium.condition.JUnitConditionRunner;

/**
 * Steps implementation that can be used in Selenium-based scenarios. It
 * provides annotated methods to start and stop Selenium before and after
 * scenarios. It also provides defaults for Selenium and ConditionRunner
 * dependencies, which may be overridden by user when providing the
 * implementation of scenario steps.
 * 
 * @author <NAME>
 */
public class SeleniumSteps extends Steps {

	protected final Selenium selenium;
	protected final ConditionRunner runner;

	public SeleniumSteps() {
		this.selenium = createSelenium();
		this.runner = createConditionRunner(selenium);
	}

	@BeforeScenario
	public void beforeScenario() throws Exception {
		selenium.start();
	}

	@AfterScenario
	public void afterScenario() throws Exception {
		selenium.close();
		selenium.stop();
	}

	/**
	 * Creates Selenium used by the Steps, by default {@link DefaultSelenium}
	 * using "*firefox" as browser on localhost.
	 * 
	 * Users may override this method to provide their own custom instance of
	 * Selenium.
	 * 
	 * @return A Selenium instance
	 */
	protected Selenium createSelenium() {
		return new DefaultSelenium("localhost", 4444, "*firefox",
				"http://localhost:8080");
	}<commit_msg>Added constructors from Steps.<commit_after>package org.jbehave.web.selenium;

import java.util.concurrent.TimeUnit;

import org.jbehave.scenario.annotations.AfterScenario;
import org.jbehave.scenario.annotations.BeforeScenario;
import org.jbehave.scenario.steps.Steps;
import org.jbehave.scenario.steps.StepsConfiguration;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
import com.thoughtworks.selenium.condition.ConditionRunner;
import com.thoughtworks.selenium.condition.JUnitConditionRunner;

/**
 * Steps implementation that can be used in Selenium-based scenarios. It
 * provides annotated methods to start and stop Selenium before and after
 * scenarios. It also provides defaults for Selenium and ConditionRunner
 * dependencies, which may be overridden by user when providing the
 * implementation of scenario steps.
 * 
 * @author <NAME>
 */
public class SeleniumSteps extends Steps {

	protected final Selenium selenium;
	protected final ConditionRunner runner;

	public SeleniumSteps() {
		this(new StepsConfiguration());
	}

	public SeleniumSteps(StepsConfiguration configuration){
		super(configuration);
		this.selenium = createSelenium();
		this.runner = createConditionRunner(selenium);
	}
	
	@BeforeScenario
	public void beforeScenario() throws Exception {
		selenium.start();
	}

	@AfterScenario
	public void afterScenario() throws Exception {
		selenium.close();
		selenium.stop();
	}

	/**
	 * Creates Selenium used by the Steps, by default {@link DefaultSelenium}
	 * using "*firefox" as browser on localhost.
	 * 
	 * Users may override this method to provide their own custom instance of
	 * Selenium.
	 * 
	 * @return A Selenium instance
	 */
	protected Selenium createSelenium() {
		return new DefaultSelenium("localhost", 4444, "*firefox",
				"http://localhost:8080");
	}
{'fraction_non_alphanumeric': 0.08854612967723507, 'fraction_numerical': 0.004570122822050843, 'mean_word_length': 4.935593220338983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3145562', 'n_tokens_mistral': 1099, 'n_tokens_neox': 962, 'n_words': 291}