|
@@ -17,6 +17,9 @@ use Data::Dumper;
|
|
|
|
|
|
|
|
use Selenium::Client;
|
|
use Selenium::Client;
|
|
|
|
|
|
|
|
|
|
+# SHUT UP WITH THE WARNINGS
|
|
|
|
|
+local $Test::Builder::Level = 0;
|
|
|
|
|
+
|
|
|
my $extra = '';
|
|
my $extra = '';
|
|
|
$extra = '/' if grep { $^O eq $_ } qw{msys MSWin32};
|
|
$extra = '/' if grep { $^O eq $_ } qw{msys MSWin32};
|
|
|
|
|
|
|
@@ -24,29 +27,30 @@ my $sut = 'file://' . $extra . abs_path("$FindBin::Bin/test.html");
|
|
|
my $sut2 = 'file://' . $extra . abs_path("$FindBin::Bin/other.html");
|
|
my $sut2 = 'file://' . $extra . abs_path("$FindBin::Bin/other.html");
|
|
|
|
|
|
|
|
#Do WinAppDriver testing if we are on windows and have it installed at all
|
|
#Do WinAppDriver testing if we are on windows and have it installed at all
|
|
|
|
|
+SKIP: {
|
|
|
|
|
+ skip("Need JSONWire support before we can test winappdriver",1);
|
|
|
|
|
+ my $winapp = eval { Selenium::Client->new( driver => 'WinApp', debug => $ENV{DEBUG} ) };
|
|
|
|
|
+ if ($winapp) {
|
|
|
|
|
+ my $caps = {
|
|
|
|
|
+ app => 'C:\\Windows\\System32\\notepad.exe',
|
|
|
|
|
+ platformName => "WINDOWS",
|
|
|
|
|
+ platform => "WINDOWS",
|
|
|
|
|
+ deviceName => "WindowsPC",
|
|
|
|
|
+ appArguments => "zippy.txt",
|
|
|
|
|
+ appWorkingDir => '.',
|
|
|
|
|
+ "ms:experimental-webdriver" => JSON::true,
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
-my $winapp = eval { Selenium::Client->new( driver => 'WinApp', debug => $ENV{DEBUG} ) };
|
|
|
|
|
-if ($winapp) {
|
|
|
|
|
- my $caps = {
|
|
|
|
|
- app => 'C:\\Windows\\System32\\notepad.exe',
|
|
|
|
|
- platformName => "WINDOWS",
|
|
|
|
|
- platform => "WINDOWS",
|
|
|
|
|
- deviceName => "WindowsPC",
|
|
|
|
|
- appArguments => "zippy.txt",
|
|
|
|
|
- appWorkingDir => '.',
|
|
|
|
|
- "ms:experimental-webdriver" => JSON::true,
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- #XXX the WC3 support is only "sorta" in that they don't support modern caps
|
|
|
|
|
- my @ret = $winapp->NewSession( desiredCapabilities => $caps );
|
|
|
|
|
- use Data::Dumper;
|
|
|
|
|
- print Dumper(\@ret);
|
|
|
|
|
- my $notepad;
|
|
|
|
|
- my $input = $notepad->FindElement( using => 'css selector', value => 'Edit' );
|
|
|
|
|
- $input->ElementSendKeys( text => 'tickle');
|
|
|
|
|
- is($input->GetElementProperty( name => 'value' ), 'tickle', "Can clear and send keys to a text input");
|
|
|
|
|
|
|
+ #XXX the WC3 support is only "sorta" in that they don't support modern caps
|
|
|
|
|
+ my @ret = $winapp->NewSession( desiredCapabilities => $caps );
|
|
|
|
|
+ use Data::Dumper;
|
|
|
|
|
+ print Dumper(\@ret);
|
|
|
|
|
+ my $notepad;
|
|
|
|
|
+ my $input = $notepad->FindElement( using => 'css selector', value => 'Edit' );
|
|
|
|
|
+ $input->ElementSendKeys( text => 'tickle');
|
|
|
|
|
+ is($input->GetElementProperty( name => 'value' ), 'tickle', "Can clear and send keys to a text input");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-die;
|
|
|
|
|
|
|
|
|
|
my @browsers = qw{firefox chrome};
|
|
my @browsers = qw{firefox chrome};
|
|
|
push(@browsers, 'MicrosoftEdge') if grep { $^O eq $_ } qw{MSWin32 msys};
|
|
push(@browsers, 'MicrosoftEdge') if grep { $^O eq $_ } qw{MSWin32 msys};
|
|
@@ -161,9 +165,7 @@ foreach my $browser (@browsers) {
|
|
|
|
|
|
|
|
my $finder = $session->FindElement( using => 'css selector', value => 'form' );
|
|
my $finder = $session->FindElement( using => 'css selector', value => 'form' );
|
|
|
my $found = $finder->FindElementFromElement( using => 'css selector', 'value' => 'label' );
|
|
my $found = $finder->FindElementFromElement( using => 'css selector', 'value' => 'label' );
|
|
|
- todo "Property/Attribute get is broken in Selenium" => sub {
|
|
|
|
|
- is($found->GetElementAttribute( name => 'for' ), 'text', "Can find child properly");
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ is($found->GetElementAttribute( name => 'for' ), 'text', "Can find child properly");
|
|
|
|
|
|
|
|
my @radios = $finder->FindElementsFromElement( using => 'css selector', 'value' => 'input[type=radio]' );
|
|
my @radios = $finder->FindElementsFromElement( using => 'css selector', 'value' => 'input[type=radio]' );
|
|
|
is(scalar(@radios), 2, "Can find child elements properly");
|
|
is(scalar(@radios), 2, "Can find child elements properly");
|