File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
java/test/org/openqa/selenium/virtualauthenticator Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 23
23
import static org .assertj .core .api .InstanceOfAssertFactories .MAP ;
24
24
import static org .junit .jupiter .api .Assertions .assertThrows ;
25
25
26
+ import java .net .MalformedURLException ;
27
+ import java .net .URI ;
28
+ import java .net .URL ;
26
29
import java .security .spec .PKCS8EncodedKeySpec ;
27
30
import java .util .Arrays ;
28
31
import java .util .Base64 ;
@@ -66,10 +69,24 @@ class VirtualAuthenticatorTest extends JupiterTestBase {
66
69
private VirtualAuthenticator authenticator ;
67
70
68
71
@ BeforeEach
69
- public void setup () {
72
+ public void setup () throws MalformedURLException {
70
73
assumeThat (driver ).isInstanceOf (HasVirtualAuthenticator .class );
71
74
jsAwareDriver = (JavascriptExecutor ) driver ;
72
- driver .get (appServer .whereIs ("virtual-authenticator.html" ));
75
+
76
+ // According to the spec, the only way we can use the virtual
77
+ // authenticator is if we are using HTTPS or contacting
78
+ // `localhost` directly. When we try and access the `NettyAppServer`
79
+ // over HTTPS, the `registerCredential` method is missing. Let's
80
+ // make the assumption that the server being used is running on
81
+ // `localhost` and rewrite URLs from there.
82
+ URL url = new URL (appServer .whereIs ("virtual-authenticator.html" ));
83
+ String localUrl = new URL (
84
+ url .getProtocol (),
85
+ "localhost" ,
86
+ url .getPort (),
87
+ url .getFile ()).toString ();
88
+
89
+ driver .get (localUrl );
73
90
}
74
91
75
92
private void createRKEnabledU2FAuthenticator () {
You can’t perform that action at this time.
0 commit comments