import static org.mockito.Mockito.when;
public class WaitingSelenideElementTest {
@Test
public void testToString() {
SelenideElement parent = mock(SelenideElement.class);
when(parent.toString()).thenReturn("table");
when(parent.getTagName()).thenReturn("table");
assertEquals("{By.id: app}", new WaitingSelenideElement(null, By.id("app"), 0).toString());
assertEquals("{By.id: app[3]}", new WaitingSelenideElement(null, By.id("app"), 3).toString());
assertEquals("{By.id: app}", new WaitingSelenideElement(parent, By.id("app"), 0).toString());
assertEquals("{By.id: app[3]}", new WaitingSelenideElement(parent, By.id("app"), 3).toString());