summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/AbstractTestApplication.java
blob: 406158e8e1f98ebc40953c9c13d27e33785eab0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.vaadin.tests.components;

import com.vaadin.Application;
import com.vaadin.server.AbstractWebApplicationContext;
import com.vaadin.server.WebBrowser;
import com.vaadin.service.ApplicationContext;

public abstract class AbstractTestApplication extends Application {
    protected abstract String getTestDescription();

    protected abstract Integer getTicketNumber();

    protected WebBrowser getBrowser() {
        ApplicationContext context = getContext();
        if (context instanceof AbstractWebApplicationContext) {
            WebBrowser webBrowser = ((AbstractWebApplicationContext) context)
                    .getBrowser();
            return webBrowser;
        }

        return null;
    }
}