diff --git a/neon/needles/kickoff/kickoff-alternatives-popup-corrupted.json b/neon/needles/kickoff/kickoff-alternatives-popup-corrupted.json new file mode 100644 index 0000000..2cac4c5 --- /dev/null +++ b/neon/needles/kickoff/kickoff-alternatives-popup-corrupted.json @@ -0,0 +1,20 @@ +{ + "area": [ + { + "height": 151, + "match": 95, + "type": "match", + "width": 190, + "xpos": 0, + "ypos": 602 + } + ], + "properties": [ + "workaround" + ], + "tags": [ + "kickoff-alternatives-popup-corrupted", + "kickoff-alternatives-popup" + ] +} + diff --git a/neon/needles/kickoff/kickoff-alternatives-popup-corrupted.png b/neon/needles/kickoff/kickoff-alternatives-popup-corrupted.png new file mode 100644 index 0000000..610d6a1 Binary files /dev/null and b/neon/needles/kickoff/kickoff-alternatives-popup-corrupted.png differ diff --git a/neon/tests/plasma/plasma_alternatives.pm b/neon/tests/plasma/plasma_alternatives.pm index 6638fe6..d1ad835 100644 --- a/neon/tests/plasma/plasma_alternatives.pm +++ b/neon/tests/plasma/plasma_alternatives.pm @@ -1,72 +1,78 @@ # Copyright (C) 2018 Bhavisha Dhruve # Copyright (C) 2016-2018 Harald Sitter # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License or (at your option) version 3 or any later version # accepted by the membership of KDE e.V. (or its successor approved # by the membership of KDE e.V.), which shall act as a proxy # defined in Section 14 of version 3 of the license. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . use base "basetest_neon"; use strict; use testapi; sub run { assert_screen 'folder-desktop'; - # Starts the Alternative Menu - assert_and_click 'plasma-launcher', 'right'; + do { + # Close open popup if there is any. + send_key 'esc'; + + # Starts the Alternative Menu + assert_and_click 'plasma-launcher', 'right'; + + # Selects the Application Menu + assert_and_click 'kickoff-alternatives'; + assert_screen 'kickoff-alternatives-popup'; + + # Repeat this entire dance if the popup has corrupted graphics. + # This happens every so often and renders the popup incorrectly. If + # we were to click at this point we'd be selecting an off-by-one item. + # instead of the intended one. + # Cause unknown. + } while (match_has_tag 'kickoff-alternatives-popup-corrupted'); - # Selects the Application Menu - assert_and_click 'kickoff-alternatives'; assert_and_click 'kickoff-alternatives-popup'; # Switches to Application Menu - # FIXME: temporary hack. there is a rendering bug appearing every so often - # where the popup is corrupted and the entries are off-set by 1, so we'd - # click the wrong entry. a wait may fix this if the corruption is - # transient. if not, we'll need to assert that the screen is not corrupted - # and only then do the click. if it is corrupted we'll need to reopen - # the popup until it is not. - wait_still_screen; assert_and_click 'plasma-alternatives-switch'; assert_screen 'folder-desktop'; # Check if kicker opens instead of kickoff assert_and_click 'plasma-launcher'; assert_screen 'plasma-kicker'; send_key 'esc'; # Roll back to kickoff assert_and_click 'plasma-launcher', 'right'; assert_and_click 'kickoff-alternatives'; assert_and_click 'kickoff-alternatives-launcher'; assert_and_click 'plasma-alternatives-switch'; assert_screen 'folder-desktop'; assert_and_click 'plasma-launcher'; assert_screen 'kickoff-popup'; wait_still_screen; send_key 'esc'; wait_still_screen; assert_screen 'folder-desktop'; } sub test_flags { # without anything - rollback to 'lastgood' snapshot if failed # 'fatal' - whole test suite is in danger if this fails # 'milestone' - after this test succeeds, update 'lastgood' # 'important' - if this fails, set the overall state to 'fail' return { important => 1 }; } 1;