From 6b0da609e7098e0712a6932455dcb22a83fe02cd Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Fri, 18 Oct 2019 10:26:28 +0200 Subject: [PATCH] TT#68016 selenium: more little cleanups remove unneeded comments, duplicate checks and add a missing refresh Change-Id: I0cc0e35084f3c1d2af6bed997dbdd5eb679799f6 --- t/lib/Selenium/Collection/Common.pm | 2 +- t/lib/Selenium/Remote/Driver/FirefoxExtensions.pm | 4 ---- t/selenium/admin_login.t | 4 ++-- t/selenium/controller_other.t | 1 + t/selenium/controller_reseller.t | 1 - 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/t/lib/Selenium/Collection/Common.pm b/t/lib/Selenium/Collection/Common.pm index 3680c50660..e6b2b34b82 100644 --- a/t/lib/Selenium/Collection/Common.pm +++ b/t/lib/Selenium/Collection/Common.pm @@ -17,7 +17,7 @@ sub login_ok { diag("Load login page (logout first)"); my $uri = $ENV{CATALYST_SERVER} || 'http://localhost:3000'; - $self->driver->get("$uri/logout"); # make sure we are logged out + $self->driver->get("$uri/logout"); $self->driver->get("$uri/login"); diag("Do Admin Login"); diff --git a/t/lib/Selenium/Remote/Driver/FirefoxExtensions.pm b/t/lib/Selenium/Remote/Driver/FirefoxExtensions.pm index 06e36b74ee..d36ae2cbf2 100644 --- a/t/lib/Selenium/Remote/Driver/FirefoxExtensions.pm +++ b/t/lib/Selenium/Remote/Driver/FirefoxExtensions.pm @@ -28,9 +28,6 @@ sub BUILD { my ($window_h,$window_w) = ($ENV{WINDOW_SIZE} || '1024x1280') =~ /([0-9]+)x([0-9]+)/i; my $browsername = $self->browser_name; - # $self->set_window_position(0, 50) if ($browsername ne "htmlunit"); - # $self->set_window_size($window_h,$window_w) if ($browsername ne "htmlunit"); - # diag("Window size: $window_h x $window_w"); $self->set_timeout("implicit", 10_000); } @@ -43,7 +40,6 @@ sub find_text { catch { return; }; - } sub select_if_unselected { diff --git a/t/selenium/admin_login.t b/t/selenium/admin_login.t index 14530c5f37..cffdf6f465 100644 --- a/t/selenium/admin_login.t +++ b/t/selenium/admin_login.t @@ -24,7 +24,7 @@ sub admin_login { my $login = 'administrator'; my $pwd = 'administrator'; my $uri = $ENV{CATALYST_SERVER} || 'http://localhost:3000'; - $d->get("$uri/logout"); # make sure we are logged out + $d->get("$uri/logout"); $d->get("$uri/login"); $d->find_element('#username', 'css')->send_keys($login); $d->find_element('#password', 'css')->send_keys($pwd); @@ -44,4 +44,4 @@ if(! caller) { } 1; -# vim: filetype=perl + diff --git a/t/selenium/controller_other.t b/t/selenium/controller_other.t index d747d315cc..8be2ecf3cc 100644 --- a/t/selenium/controller_other.t +++ b/t/selenium/controller_other.t @@ -247,6 +247,7 @@ ok($d->find_element_by_xpath('//*[@id="contact_table"]//tr[1]/td[contains(text() diag("Try to NOT delete Contact"); $d->move_and_click('//*[@id="contact_table"]//tr[1]//td//a[contains(text(), "Delete")]', 'xpath', '//*[@id="contact_table_filter"]//input'); $d->find_element('//*[@id="dataConfirmCancel"]')->click(); +$d->refresh(); diag("Check if Contact is still here"); $d->fill_element('//*[@id="contact_table_filter"]/label/input', 'xpath', 'thisshouldnotexist'); diff --git a/t/selenium/controller_reseller.t b/t/selenium/controller_reseller.t index fb22fdce92..acda4c51fd 100644 --- a/t/selenium/controller_reseller.t +++ b/t/selenium/controller_reseller.t @@ -39,7 +39,6 @@ $d->find_element('#mod_close', 'css')->click(); $c->create_reseller($resellername, $contractid); diag("Search Reseller"); -is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Reseller successfully created.', 'Correct Alert was shown'); $d->fill_element('#Resellers_table_filter label input', 'css', 'thisshouldnotexist'); ok($d->find_element_by_css('#Resellers_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); $d->fill_element('#Resellers_table_filter label input', 'css', $resellername);