Search in sources :

Example 36 with App

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

the class ActionGetIT method getSelectedValuesNotExistTest.

@Test(groups = { "integration", "actions", "get" }, description = "An integration test to check the getSelectedValues method")
public void getSelectedValuesNotExistTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    String[] value = app.newElement(Locator.ID, "non-existent-name", 0).get().selectedValues();
    Assert.assertNull(value);
    // verify no issues
    finish();
}
Also used : App(com.coveros.selenified.application.App) Test(org.testng.annotations.Test)

Example 37 with App

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

the class ActionGetIT method getCookieTest.

@Test(groups = { "integration", "actions", "get", "cookie" }, description = "An integration test to check the getCookie method")
public void getCookieTest() throws IOException, ParseException {
    // the cookie date
    String dateval = "2019-12-18T12:00:00";
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    df.setTimeZone(TimeZone.getTimeZone("UTC"));
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    Cookie cookie = app.get().cookie("cookie");
    Assert.assertEquals(cookie, new Cookie("cookie", "cookietest", "/", df.parse(dateval)));
    // verify no issues
    finish();
}
Also used : App(com.coveros.selenified.application.App) Cookie(org.openqa.selenium.Cookie) SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) Test(org.testng.annotations.Test)

Example 38 with App

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

the class ActionGetIT method getCssNotExistTest.

@Test(groups = { "integration", "actions", "get" }, description = "An integration test to check the getCss method")
public void getCssNotExistTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    String css = app.newElement(Locator.ID, "non-existent-name").get().css("display");
    Assert.assertNull(css);
    // verify no issues
    finish();
}
Also used : App(com.coveros.selenified.application.App) Test(org.testng.annotations.Test)

Example 39 with App

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

the class ActionGetIT method getTableColumnsTest.

@Test(groups = { "integration", "actions", "get" }, description = "An integration test to check the getTableColumn method")
public void getTableColumnsTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    List<List<WebElement>> columns = app.newElement(Locator.ID, "table", 1).get().tableColumns();
    Assert.assertEquals(columns.size(), 4);
    Assert.assertEquals(columns.get(1).get(0).getText(), "Company");
    Assert.assertEquals(columns.get(1).get(1).getText(), "Alfreds Futterkiste");
    Assert.assertEquals(columns.get(1).get(2).getText(), "Centro comercial Moctezuma");
    Assert.assertEquals(columns.get(1).get(3).getText(), "Ernst Handel");
    Assert.assertEquals(columns.get(1).get(4).getText(), "Island Trading");
    Assert.assertEquals(columns.get(1).get(5).getText(), "Laughing Bacchus Winecellars");
    Assert.assertEquals(columns.get(1).get(6).getText(), "Magazzini Alimentari Riuniti");
    // verify no issues
    finish();
}
Also used : App(com.coveros.selenified.application.App) Test(org.testng.annotations.Test)

Example 40 with App

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

the class ActionGetIT method getSelectValuesTest.

@Test(groups = { "integration", "actions", "get" }, description = "An integration test to check the getSelectOptions method")
public void getSelectValuesTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    String[] options = app.newElement(Locator.NAME, "car_list").get().selectValues();
    Assert.assertEquals(options, new String[] { "volvo", "saab", "mercedes", "audi" });
    // 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