Here is my JUnit test class: package com.bynarystudio.tests.storefront;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import com.bynarystudio.tests.BaseWebTest;
public class SmokeTests extends BaseWebTest {
@Test
public void StoreFrontMegaNavTest(){
webDriver.get(default_homepage);
String source = webDriver.getPageSource();
Assert.assertTrue(source.contains("some text"));
}
}
How do I run this test from the command line? When I try to run it from inside its directory using
java -cp junit.textui.TestRunner SmokeTests.java
I get the following error
Could not find the main class: SmokeTests.java. Program will exit.
I think this has to do with the fact that my classpath is not setup properly. But I have no idea because I'm brand new to Java. Coming from .NET, C#, and Visual Studio, the whole classpath thing makes no sense. Even though I have all my files correctly added to a project in Eclipse (I know because the test runs fine from inside Eclipse), it will absolutely not run or compile from the command line.