File tree 1 file changed +3
-12
lines changed
examples/selenium-container/src/test/java 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change 6
6
import org .testcontainers .containers .BrowserWebDriverContainer ;
7
7
8
8
import java .io .File ;
9
+ import java .util .List ;
9
10
10
11
import static org .rnorth .visibleassertions .VisibleAssertions .assertTrue ;
11
12
import static org .testcontainers .containers .BrowserWebDriverContainer .VncRecordingMode .RECORD_ALL ;
@@ -25,18 +26,8 @@ public void simplePlainSeleniumTest() {
25
26
RemoteWebDriver driver = chrome .getWebDriver ();
26
27
27
28
driver .get ("https://wikipedia.org" );
28
- WebElement searchInput = driver .findElementByName ("search" );
29
+ List < WebElement > searchInput = driver .findElementsByName ("search" );
29
30
30
- searchInput .sendKeys ("Rick Astley" );
31
- searchInput .submit ();
32
-
33
- WebElement otherPage = driver .findElementByPartialLinkText ("Rickrolling" );
34
- otherPage .click ();
35
-
36
- boolean expectedTextFound = driver .findElementsByCssSelector ("p" )
37
- .stream ()
38
- .anyMatch (element -> element .getText ().contains ("meme" ));
39
-
40
- assertTrue ("The word 'meme' is found on a page about rickrolling" , expectedTextFound );
31
+ assertTrue ("The search input box is found" , searchInput != null && searchInput .size () > 0 );
41
32
}
42
33
}
You can’t perform that action at this time.
0 commit comments