Search in sources :

Example 26 with App

use of com.coveros.selenified.application.App in project selenified by Coveros.

the class ActionGetIT method getElementEvalTest.

@Test(groups = { "integration", "actions", "get" }, description = "An integration test to check the getEval method")
public void getElementEvalTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    String location = (String) app.newElement(Locator.ID, "disable_click", 0).get().eval("document.location");
    Assert.assertNull(location);
    // verify no issues
    finish();
}
Also used : App(com.coveros.selenified.application.App) Test(org.testng.annotations.Test)

Example 27 with App

use of com.coveros.selenified.application.App in project selenified by Coveros.

the class ActionGetIT method getPromptTest.

@Test(groups = { "integration", "actions", "get" }, description = "An integration test to check the getPrompt method")
public void getPromptTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    app.newElement(Locator.ID, "prompt_button").click();
    String prompt = app.get().prompt();
    Assert.assertEquals(prompt, "What do you think?");
    // verify no issues
    finish();
}
Also used : App(com.coveros.selenified.application.App) Test(org.testng.annotations.Test)

Example 28 with App

use of com.coveros.selenified.application.App in project selenified by Coveros.

the class ActionGetIT method getAllAttributeNotExistTest.

@Test(groups = { "integration", "actions", "get" }, description = "A negative integration test to check the getAllAttribute method")
public void getAllAttributeNotExistTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    Map<String, String> attributes = app.newElement(Locator.ID, "non-existent-name").get().allAttributes();
    Assert.assertEquals(attributes, new HashMap<>());
    // verify 0 issue
    finish();
}
Also used : App(com.coveros.selenified.application.App) Test(org.testng.annotations.Test)

Example 29 with App

use of com.coveros.selenified.application.App in project selenified by Coveros.

the class ActionGetIT method getTableRowTest.

@Test(groups = { "integration", "actions", "get" }, description = "An integration test to check the getTableRow method")
public void getTableRowTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    List<WebElement> row = app.newElement(Locator.ID, "table").get().tableRow(1);
    Assert.assertEquals(row.size(), 4);
    Assert.assertEquals(row.get(0).getText(), "President");
    Assert.assertEquals(row.get(1).getText(), "Alfreds Futterkiste");
    Assert.assertEquals(row.get(2).getText(), "Maria Anders");
    Assert.assertEquals(row.get(3).getText(), "Germany");
    // verify no issues
    finish();
}
Also used : App(com.coveros.selenified.application.App) WebElement(org.openqa.selenium.WebElement) Test(org.testng.annotations.Test)

Example 30 with App

use of com.coveros.selenified.application.App in project selenified by Coveros.

the class ActionGetIT method getNumOfSelectOptionsTest.

@Test(groups = { "integration", "actions", "get" }, description = "An integration test to check the getNumOfSelectOptions method")
public void getNumOfSelectOptionsTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    int options = app.newElement(Locator.NAME, "car_list").get().numOfSelectOptions();
    Assert.assertEquals(options, 4);
    // verify no issues
    finish();
}
Also used : App(com.coveros.selenified.application.App) Test(org.testng.annotations.Test)

Aggregations

App (com.coveros.selenified.application.App)501 Test (org.testng.annotations.Test)500 WebElement (org.openqa.selenium.WebElement)15 Cookie (org.openqa.selenium.Cookie)7 Element (com.coveros.selenified.element.Element)6 DateFormat (java.text.DateFormat)4 SimpleDateFormat (java.text.SimpleDateFormat)4 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)4 File (java.io.File)2 InvalidBrowserException (com.coveros.selenified.exceptions.InvalidBrowserException)1 Call (com.coveros.selenified.services.Call)1 HTTP (com.coveros.selenified.services.HTTP)1 MalformedURLException (java.net.MalformedURLException)1