Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/org/labkey/test/components/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.labkey.test.components;

import org.apache.commons.lang3.NotImplementedException;
import org.jetbrains.annotations.NotNull;
import org.labkey.test.Locator;
import org.labkey.test.selenium.RefindingWebElement;
import org.labkey.test.util.TestLogger;
Expand All @@ -27,6 +28,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;

Expand All @@ -43,13 +45,13 @@ public String toString()
}

@Override
public WebElement findElement(By by)
public @NotNull WebElement findElement(@NotNull By by)
{
return getComponentElement().findElement(by);
}

@Override
public List<WebElement> findElements(By by)
public @NotNull List<WebElement> findElements(@NotNull By by)
{
return getComponentElement().findElements(by);
}
Expand All @@ -69,8 +71,9 @@ protected EC elementCache()
// Pass if element doesn't exist. Might be checking if component is visible.
}

_elementCache = newElementCache();
_elementCache = Objects.requireNonNull(newElementCache());
waitForReady();
Objects.requireNonNull(_elementCache, "waitForReady() cleared the element cache");
}
return _elementCache;
}
Expand Down Expand Up @@ -103,13 +106,13 @@ protected ElementCache()
}

@Override
public List<WebElement> findElements(By by)
public @NotNull List<WebElement> findElements(@NotNull By by)
{
return getComponentElement().findElements(by);
}

@Override
public WebElement findElement(By by)
public @NotNull WebElement findElement(@NotNull By by)
{
return getComponentElement().findElement(by);
}
Expand Down