-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...leniumtests/it/core/TestReplayAction.java → ...sts/it/core/aspects/TestReplayAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
core/src/test/java/com/seleniumtests/ut/uipage/htmlelements/TestSeleniumElement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.seleniumtests.ut.uipage.htmlelements; | ||
|
||
import static org.mockito.Mockito.when; | ||
|
||
import com.seleniumtests.MockitoTest; | ||
import com.seleniumtests.uipage.htmlelements.SeleniumElement; | ||
import org.mockito.Mock; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.remote.RemoteWebElement; | ||
import org.openqa.selenium.support.ui.Select; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
public class TestSeleniumElement extends MockitoTest { | ||
|
||
@Mock | ||
private RemoteWebElement element; | ||
|
||
|
||
|
||
@Test(groups="ut") | ||
public void testGetNameWebElement() { | ||
when(element.toString()).thenReturn("Decorated {[[ChromeDriver: chrome on windows (83c6e18cbc09be7060ef3f92feda6877)] -> id: button2]}"); | ||
Assert.assertEquals(new SeleniumElement(element).getName(), "id: button2"); | ||
} | ||
|
||
@Test(groups="ut") | ||
public void testGetNameSelect() { | ||
when(element.getTagName()).thenReturn("select"); | ||
when(element.toString()).thenReturn("Decorated {[[ChromeDriver: chrome on windows (83c6e18cbc09be7060ef3f92feda6877)] -> id: button2]}"); | ||
Assert.assertEquals(new SeleniumElement(new Select(element)).getName(), "Select id: button2"); | ||
} | ||
|
||
@Test(groups="ut") | ||
public void testGetNameHtmlUnitElement() { | ||
when(element.toString()).thenReturn("Decorated {<button id=\"button2\" name=\"resetButton\" onclick=\"javascript:addText('text2', '');javascript:resetState();\">}"); | ||
Assert.assertEquals(new SeleniumElement(element).getName(), "Decorated {<button id=\"button2\" name=\"resetButton\" onclick=\"javascript:addText('text2', '');javascript:resetState();\">}"); | ||
} | ||
|
||
@Test(groups="ut") | ||
public void testGetNameWebElementNull() { | ||
Assert.assertNull(new SeleniumElement((WebElement) null).getName()); | ||
} | ||
|
||
} |