In the beginning, you created a folder.

>mkdir potassium

Then you made it a git repo.

>git init –bare

… wait, I don’t want to deal with github later. I’d rather create a new project on github ‘potassium’ then clone it.

>git clone

>cd potassium

It feels home here. Let’s make it a maven project so we won’t need to worry about java library dependencies.


mvn -B archetype:generate -DgroupId=com.myorg.potassium -DartifactId=potassium -DarchetypeArtifactId=maven-archetype-potassium -DarchetypeVersion=1.4

wait .. I made a mistake of creating the maven project ‘potassium’ under the folder I created as ‘potassium’ and I’m too lazy to fix the issue. I will take those out of the folder.

>mv potassium/* .
>rm -rf potassium

I test it by running a maven command.

>mvn clean install


Add TestNG dependency and create a base test class.

Google ‘maven testng’ to get

Copied block goes to pom.xml but let’s open the project in IntelliJ first to handle this.

Open IntelliJ > Imort a new project > (select potassium folder) > maven

Any dependency will go under <dependencies> block per

IntelliJ’s .iml file is better staying local to individual developers. I’d leave it out of git repo. Creating .gitignore file to add *.iml pattern might be useful.

>vi .gitignore
>git add .gitignore
>git add pom.xml

Now we’re ready to add a Base class and BaseTest class.

public class Base
    private static Properties properties; // this should exist as a singleton
    Logger logger;

    Base() {
        try {
            properties = new Properties();
            InputStream stream = getClass().getClassLoader().getResourceAsStream("");
        } catch (IOException e) {
        logger = Logger.getLogger(getClass().getName());

    Properties getProperties() {
        return properties;

    void info(String str) {
        logger.log(Level.INFO, str);
public class BaseTest extends Base
BaseTest() {

@BeforeSuite(alwaysRun = true)
public void beforeSuite(@Optional("test-env") String envName) {
loadTestProperties(envName + ".properties");

void loadTestProperties(String envFile) {
try {
info("loading properties: " + envFile);
InputStream stream = getClass().getClassLoader().getResourceAsStream(envFile);
} catch (IOException e) {
public class PropertiesTest extends BaseTest {
    public void defaultPropertiesTest()
        Assert.assertEquals(getPropStr("frameworkName"), getPropStr("expectedName"));

>mvn test