Package com.codeborne.selenide.impl

Source Code of com.codeborne.selenide.impl.WaitingSelenideElementTest

package com.codeborne.selenide.impl;

import com.codeborne.selenide.SelenideElement;
import org.junit.Test;
import org.openqa.selenium.By;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
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());
  }
}
TOP

Related Classes of com.codeborne.selenide.impl.WaitingSelenideElementTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.