package com.codeborne.selenide.impl;

import org.junit.Test;
import org.openqa.selenium.By;

import static org.junit.Assert.assertEquals;

public class DescribeTest {

  @Test
  public void selectorIsReportedAsIs() {
    assertEquals("#firstName", Describe.selector(By.cssSelector("#firstName")));
    assertEquals("By.id: firstName", Describe.selector(By.id("firstName")));
    assertEquals("By.className: firstName", Describe.selector(By.className("firstName")));
    assertEquals("By.name: firstName", Describe.selector(By.name("firstName")));
  }
}
@@ -42,506 +42,1468 @@
 ort 
-org.junit.Test;%0Aimport org.openqa.selenium.By;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Apublic class DescribeTest %7B%0A%0A  @Test%0A  public void selectorIsReportedAsIs() %7B%0A    assertEquals(%22#firstName%22, Describe.selector(By.cssSelector(%22#firstName%22)));%0A    assertEquals(%22By.id: firstName%22, Describe.selector(By.id(%22firstName%22)));%0A    assertEquals(%22By.className: firstName%22, Describe.selector(By.className(%22firstName%22)));%0A    assertEquals(%22By.name: firstName%22, Describe.selector(By.name(%22firstName%22)
+com.codeborne.selenide.SelenideElement;%0Aimport com.codeborne.selenide.ex.ElementShould;%0Aimport org.junit.Test;%0Aimport org.openqa.selenium.By;%0Aimport org.openqa.selenium.StaleElementReferenceException;%0Aimport org.openqa.selenium.WebElement;%0A%0Aimport static com.codeborne.selenide.Condition.visible;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Mockito.doThrow;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class DescribeTest %7B%0A%0A  @Test%0A  public void selectorIsReportedAsIs() %7B%0A    assertEquals(%22#firstName%22, Describe.selector(By.cssSelector(%22#firstName%22)));%0A    assertEquals(%22By.id: firstName%22, Describe.selector(By.id(%22firstName%22)));%0A    assertEquals(%22By.className: firstName%22, Describe.selector(By.className(%22firstName%22)));%0A    assertEquals(%22By.name: firstName%22, Describe.selector(By.name(%22firstName%22)));%0A  %7D%0A%0A  @Test%0A  public void shortlyForSelenideElementShouldDelegateToOriginalWebElement() %7B%0A    WebElement webElement = mock(WebElement.class);%0A    when(webElement.getTagName()).thenThrow(new StaleElementReferenceException(%22disappeared%22));%0A    %0A    SelenideElement selenideElement = mock(SelenideElement.class);%0A    when(selenideElement.toWebElement()).thenReturn(webElement);%0A    doThrow(new ElementShould(null, null, visible, webElement, null, 0)).when(selenideElement).getTagName();%0A    %0A    assertEquals(%22StaleElementReferenceException: disappeared%22, Describe.shortly(selenideElement
 ));%0A

fix Describe.shortly for SelenideElement: let it delegate to the original WebElement