summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/AbstractTestCase.java
blob: 4e2ec1d935dda208a75da1aa6d150b04837371de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 AbstractTestCase extends Application.LegacyApplication {

    protected abstract String getDescription();

    protected abstract Integer getTicketNumber();

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

        return null;
    }
}