Automated Selenium UI Tests
Clone or download
Latest commit 1134c6a Jan 15, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/test Merge pull request #382 from mattermost/DKH-SeSetup Jan 11, 2019
.gitignore Initial checkin Jan 30, 2017
Makefile Disable firefox Apr 21, 2017 add docker-compose for selenium server Feb 10, 2017
docker-compose.yml add docker-compose for selenium server Feb 10, 2017
pom.xml Fixing tests Apr 21, 2017 Locking to RC6 Jan 15, 2019 Fixing tests Apr 21, 2017

Mattermost Selenium

Setup for Mac:

  1. Make sure you have the latest versions of Firefox and Chrome installed.
  2. Install the Selenium IDE from
  3. Install java JDK 1.8 from
  4. Set export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home in your .bash_profile
  5. Install Maven from
  6. Verify Maven in installed correctly with mvn -version
  7. Start a local Mattermost server
  8. Run make

Selenium IDE Setup:

Options > Options ... > Format

Select Java / JUnit 4 / WebDriver

Set the following properties

Variable for Selenium instance:





package ${packageName};

import com.mattermost.selenium.DriverBase;

import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

import org.openqa.selenium.*;

import org.testng.annotations.Test;

import java.util.regex.Pattern;

public class ${className} extends DriverBase {

    public void ${methodName}() throws Exception {




4 spaces

Teams and Users created by the setup script

Team Name: ui-automation

Test Account 1 (System Admin): Email: | Password: passwd

Test Account 2 (Team Admin): Email: | Password: passwd

Test Account 3 (Normal): Email: | Password: passwd

Test Account 4 (Normal): Email: | Password: passwd

Also all the accounts are set to bypass the tutorial.

Build machine

  1. Run the script to configure the machine
  2. Our jenkins job runs
# setup the server for the run
bash -ex ./

export DISPLAY=:99

# run both chrome and firefox automated UI tests

Selenium Server

To use Selenium Server you can use the docker-compose file and this will spin up the Selenium Server and two nodes (one Chrome and one Firefox). With that you dont need to install Chrome or Firefox in your local development.

To run (assuming you have docker installed):

$ docker-compose up