Professional Documents
Culture Documents
checkbox;
import java.io.UnsupportedEncodingException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.twx.base.BaseTest;
import com.twx.common.requirements.Requirements;
import com.twx.common.utilities.ScreenCapture;
import com.twx.common.utilities.ThingworxRESTUtils;
/***
* This is the visual test for Checkbox widget. It includes testing scenarios like
hoverOver Test, disabled attribute test and check
* un-check, focus tests.
*
* @author pbiswas
*
*/
@BeforeClass(alwaysRun = true)
public void beforeClass() throws UnsupportedEncodingException {
// Import Test specific entity
getThingworxRESTUtils().importXmlEntities(TEST_SPECIFIC_ENTITY, true,
ThingworxRESTUtils.HTTP_OK);
navigateToMashupInRuntime(TEST_MASHUP_NAME);
}
@AfterClass(alwaysRun = true)
public void afterClass() throws Exception {
getThingworxRESTUtils()
.deleteEntitiesByModelTags("{\"tags\":
[{\"vocabulary\": \"Applications\", \"vocabularyTerm\": \"VisualTest_Checkbox\"}]}"
);
}
getPages().mashupRuntimePage().pointerToCheckbox(DISABLED_CHECKBOX_WIDGET_ID_NUMBER
).click();
}
@Requirements(reqs = { "TW-23059" })
@Test(
description = "Takes snapshot of a Mashup containing checkbox to test
following scenarios 1) Prompt attribute display 2) Prompt attribute display - with
really long text 3) State attribute 5)Disable Attribute",
groups = { "VISUAL_TESTING", "CHECKBOX" })
public void asIsTest() throws Exception {
@Requirements(reqs = { "TW-23059" })
@Test(
description = "Takes snapshot of a Mashup containing checkbox to test
following scenarios 1)Hover Display with ToolTip",
groups = { "VISUAL_TESTING", "CHECKBOX" })
public void hoverOverTest() throws Exception {
getPages().mashupRuntimePage().pointerToCheckbox(HOVEROVER_CHECKBOX_WIDGET_ID_NUMBE
R).mouseOver();
@Requirements(reqs = { "TW-23059" })
@Test(
description = "Takes snapshot of a Mashup containing checkbox to test
following scenarios 1)Hover Display with ToolTip",
groups = { "VISUAL_TESTING", "CHECKBOX" })
public void disableCheckboxTest() throws Exception {
getPages().mashupRuntimePage().pointerToCheckbox(DISABLED_CHECKBOX_WIDGET_ID_NUMBER
).mouseOver();
getPages().mashupRuntimePage().pointerToCheckbox(DISABLED_CHECKBOX_WIDGET_ID_NUMBER
).click();
@Requirements(reqs = { "TW-23059" })
@Test(
description = "Takes snapshot of a Mashup containing checkbox to test
following scenarios 1)Click checkbox to enable i. Checkmark should be displayed
ii.Focus should now be on checkbox iii.Click out of the checkbox and the focus
should be lost",
groups = { "VISUAL_TESTING", "CHECKBOX" })
public void clickCheckboxToEnableDisableFocusTest() throws Exception {
getPages().mashupRuntimePage().pointerToCheckbox(CHECKBOX_WIDGET_ID_NUMBER).click()
;
getPages().mashupRuntimePage().pointerToCheckbox(DISABLED_CHECKBOX_WIDGET_ID_NUMBER
).click();
getPages().mashupRuntimePage().pointerToCheckbox(CHECKBOX_WIDGET_ID_NUMBER).click()
;
getPages().mashupRuntimePage().pointerToCheckbox(DISABLED_CHECKBOX_WIDGET_ID_NUMBER
).click();