DukeScript Selenium Webdriver

A library for Integration Testing DukeScript applications with Selenium

License

License

GroupId

GroupId

com.dukescript.api
ArtifactId

ArtifactId

dukescript-selenium
Last Version

Last Version

0.5.9
Release Date

Release Date

Type

Type

bundle
Description

Description

DukeScript Selenium Webdriver
A library for Integration Testing DukeScript applications with Selenium
Project URL

Project URL

https://github.com/dukescript/selenium-webdriver
Source Code Management

Source Code Management

https://github.com/dukescript/selenium-webdriver.git

Download dukescript-selenium

Dependencies

compile (8)

Group / Artifact Type Version
org.seleniumhq.selenium : selenium-api jar 2.48.2
org.netbeans.html : net.java.html.boot jar 1.2.3
org.netbeans.html : net.java.html.json jar 1.2.3
org.codehaus.mojo : rmic-maven-plugin jar 1.2.1
junit : junit jar 4.11
org.netbeans.html : ko4j jar 1.2.3
org.netbeans.html : net.java.html.boot.fx jar 1.2.3
org.netbeans.api : org-openide-util-lookup jar RELEASE81

test (1)

Group / Artifact Type Version
org.seleniumhq.selenium : selenium-support jar 2.47.2

Project Modules

There are no modules declared in this project.

selenium-webdriver

A Selenium Webdriver for running DukeScript Integration tests. Test methods are integrated with BrwsrCtx to be executed on the correct thread. This isn't a full implementation of the WebDriver API yet, but it already supports some useful features. Use like this:

public class SimpleTest {

    private static WebDriverFX driver;

    @BeforeClass
    public static void test() throws InterruptedException, Exception {
        driver = new WebDriverFX(SimpleTest.class.getResource("testWithModel.html"));
        driver.executeAndWait(new Runnable() {
            @Override
            public void run() {
                TestModel testModel = new TestModel("Hello", "World");
                testModel.applyBindings();
            }
        });
    }

    @Test
    public void withModel() {
        WebElement element = driver.findElement(By.id("target"));
        Assert.assertEquals("Hello", element.getText());
        WebElement button = driver.findElement(By.id("button"));
        button.click();
        Assert.assertEquals("World", element.getText());
        WebElement input = driver.findElement(By.id("input"));
        input.clear();
        input.sendKeys("DukeScript");
        button.click();
        Assert.assertEquals("DukeScript", element.getText());
        try {
            Thread.sleep(1000); // not needed, just to give you enough time to see the updates in the browser 
        } catch (InterruptedException ex) {
            Logger.getLogger(SimpleTest.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
  }

Versions

Version
0.5.9