<commit_before>package org.jtalks.tests.jcommune;

import org.jtalks.tests.jcommune.common.JCommuneSeleniumTest;
import org.openqa.selenium.By;
import org.testng.Assert;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

/**
 * This functional test covers Creating topic test case TC-JC4
 * http://jtalks.org/display/jcommune/TC-JC4+Sign+In
 *
 * @author erik
 */
public class TCJC4SignIn extends JCommuneSeleniumTest {
	String wrongUser = "wrongUser";
	String wrongPassword = "<PASSWORD>";

	@Test(priority = 1)
	@Parameters({"app-url"})
	public void signInWithEmptyDataTest(String appURL) {
		driver.get(appURL);
		signIn("", "", appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());
	}

	@Test(priority = 2)
	@Parameters({"app-url", "uUsername"})
	public void signInWithoutPasswordTest(String appURL, String username) {
		driver.get(appURL);
		signIn(username, "", appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());
	}

	@Test(priority = 3)
	@Parameters({"app-url", "uUsername"})
	public void signInWithWrongPasswordTest(String appURL, String username) {
		driver.get(appURL);
		signIn(username, wrongPassword, appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());
	}

	@Test(priority = 4)
	@Parameters({"app-url", "uUsername", "uPassword"})
	public void signInWithCorrectDataTest(String appURL, String username,
										  String password) {
		driver.get(appURL);
		signIn(username, password, appURL);
		Assert.assertEquals(driver.getCurrentUrl(),
				appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//a[@class='currentusername']"))
				.getText().equals(username));
		logOut(appURL);
	}

	@Test(priority = 5)
	@Parameters({"app-url", "uPassword"})
	public void signInWithWrongUserTest(String appURL, String password) {
		driver.get(appURL);
		signIn(wrongUser, password, appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());
	}

	@Test(priority = 6)
	@Parameters({"app-url", "uUsername", "uPassword"})
	public void signInUsernameInWrongRegisterTest(String appURL, String username,
												  String password) {
		driver.get(appURL);
		signIn(username.toUpperCase(), password, appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());
	}

	@Test(priority = 7)
	@Parameters({"app-url", "uUsername", "uPassword"})
	public void signInPasswordInWrongRegisterTest(String appURL, String username,
												  String password) {
		driver.get(appURL);
		signIn(username, password.toUpperCase(), appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());

	}

}
<commit_msg>TCJC4 fixed<commit_after>package org.jtalks.tests.jcommune;

import org.jtalks.tests.jcommune.common.JCommuneSeleniumTest;
import org.openqa.selenium.By;
import org.testng.Assert;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

/**
 * This functional test covers Creating topic test case TC-JC4
 * http://jtalks.org/display/jcommune/TC-JC4+Sign+In
 *
 * @author erik
 */
public class TCJC4SignIn extends JCommuneSeleniumTest {
	String wrongUser = "wrongUser";
	String wrongPassword = "<PASSWORD>";

	@Test(priority = 1)
	@Parameters({"app-url"})
	public void signInWithEmptyDataTest(String appURL) {
		driver.get(appURL);
		signIn("", "", appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());
	}

	@Test(priority = 2)
	@Parameters({"app-url", "uUsername"})
	public void signInWithoutPasswordTest(String appURL, String username) {
		driver.get(appURL);
		signIn(username, "", appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());
	}

	@Test(priority = 3)
	@Parameters({"app-url", "uUsername"})
	public void signInWithWrongPasswordTest(String appURL, String username) {
		driver.get(appURL);
		signIn(username, wrongPassword, appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());
	}

	@Test(priority = 4)
	@Parameters({"app-url", "uUsername", "uPassword"})
	public void signInWithCorrectDataTest(String appURL, String username,
										  String password) {
		driver.get(appURL);
		signIn(username, password, appURL);
		Assert.assertEquals(driver.getCurrentUrl(),
				appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//a[@class='currentusername']"))
				.getText().equals(username));
		logOut(appURL);
	}

	@Test(priority = 5)
	@Parameters({"app-url", "uPassword"})
	public void signInWithWrongUserTest(String appURL, String password) {
		driver.get(appURL);
		signIn(wrongUser, password, appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());
	}


	@Test(priority = 6)
	@Parameters({"app-url", "uUsername", "uPassword"})
	public void signInPasswordInWrongRegisterTest(String appURL, String username,
												  String password) {
		driver.get(appURL);
		signIn(username, password.toUpperCase(), appURL);
		Assert.assertTrue(driver
				.findElement(By.xpath("//span[@class='error']")).isDisplayed());

	}

}

{'fraction_non_alphanumeric': 0.16281273692191053, 'fraction_numerical': 0.0037907505686125853, 'mean_word_length': 5.319760479041916, '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': '2280606', 'n_tokens_mistral': 1947, 'n_tokens_neox': 1753, 'n_words': 292}