diff --git a/Tests/Regression/Manager/GUI_Basic.robot b/Tests/Regression/Manager/GUI_Basic.robot index 2f3d08c46..c72bfd2ae 100644 --- a/Tests/Regression/Manager/GUI_Basic.robot +++ b/Tests/Regression/Manager/GUI_Basic.robot @@ -1,6 +1,8 @@ *** Settings *** Test Tags Basic GUI +Resource GUI_Common.robot + Library OperatingSystem Library Process Library String @@ -10,7 +12,7 @@ Library ImageHorizonLibrary reference_folder=${IMAGE_DIR} *** Variables *** ${default_image_timeout} ${120} ${cmd_agent} rfswarm-agent -${cmd_manager} rfswarm +${cmd_manager} rfswarm-manager ${IMAGE_DIR} ${CURDIR}/Images/file_method ${pyfile} ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py ${process} None @@ -20,8 +22,8 @@ Open GUI [Tags] macos-latest # Press Escape and move mouse because on linux the screen save had kicked in Press Combination Key.esc - Move To 10 10 - Move To 20 20 + Wiggle Mouse + Set Suite Variable ${platform} macos Set Confidence 0.9 # ${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt @@ -29,6 +31,9 @@ Open GUI Set Test Variable $process ${process} # Sleep 10 # not needed now we wait for the agents tab to be visible Set Screenshot Folder ${OUTPUT DIR} + + Handle Donation Reminder + ${img}= Set Variable manager_${platform}_tab_agents.png Wait For ${img} timeout=${default_image_timeout} Take A Screenshot @@ -37,8 +42,8 @@ Open GUI [Tags] windows-latest # Press Escape and move mouse because on linux the screen save had kicked in Press Combination Key.esc - Move To 10 10 - Move To 20 20 + Wiggle Mouse + Set Suite Variable ${platform} windows Set Confidence 0.9 # ${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt @@ -46,6 +51,9 @@ Open GUI Set Test Variable $process ${process} # Sleep 10 # not needed now we wait for the agents tab to be visible Set Screenshot Folder ${OUTPUT DIR} + + Handle Donation Reminder + ${img}= Set Variable manager_${platform}_tab_agents.png Wait For ${img} timeout=${default_image_timeout} Take A Screenshot @@ -54,8 +62,8 @@ Open GUI [Tags] ubuntu-latest # Press Escape and move mouse because on linux the screen save had kicked in Press Combination Key.esc - Move To 10 10 - Move To 20 20 + Wiggle Mouse + Set Suite Variable ${platform} ubuntu Set Confidence 0.9 # ${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt @@ -63,6 +71,9 @@ Open GUI Set Test Variable $process ${process} # Sleep 10 # not needed now we wait for the agents tab to be visible Set Screenshot Folder ${OUTPUT DIR} + + Handle Donation Reminder + ${img}= Set Variable manager_${platform}_tab_agents.png Wait For ${img} timeout=${default_image_timeout} Take A Screenshot @@ -100,6 +111,7 @@ Close GUI ${result} = Terminate Process ${process} Fail END + Kill Manager If Still Running Close GUI [Tags] macos-latest @@ -117,6 +129,7 @@ Close GUI ${result} = Terminate Process ${process} Fail END + Kill Manager If Still Running # Intentional Fail # [Tags] ubuntu-latest windows-latest macos-latest diff --git a/Tests/Regression/Manager/GUI_Common.robot b/Tests/Regression/Manager/GUI_Common.robot index 04d391011..b0899dc82 100644 --- a/Tests/Regression/Manager/GUI_Common.robot +++ b/Tests/Regression/Manager/GUI_Common.robot @@ -25,7 +25,7 @@ ${global_name} None @{mngr_options} None @{agent_options} None ${cmd_agent} rfswarm-agent -${cmd_manager} rfswarm +${cmd_manager} rfswarm-manager ${IMAGE_DIR} ${CURDIR}/Images/file_method ${pyfile_manager} ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py ${pyfile_agent} ${EXECDIR}${/}rfswarm_agent${/}rfswarm_agent.py @@ -84,8 +84,8 @@ Open Manager GUI [Arguments] ${options}=None # Press Escape and move mouse because on linux the screen save had kicked in Press Combination Key.esc - Move To 10 10 - Move To 20 20 + Wiggle Mouse + IF ${options} == None ${options}= Create List Create Directory ${results_dir} @@ -103,7 +103,11 @@ Open Manager GUI IF '-n' in ${options} Sleep 10 + ELSE IF '-r' in ${options} or '--run' in ${options} + Handle Donation Reminder ELSE + Handle Donation Reminder + ${img}= Set Variable manager_${platform}_button_runschedule.png ${passed}= Run Keyword And Return Status Wait For ${img} timeout=${default_image_timeout / 2} IF not ${passed} @@ -130,13 +134,19 @@ Open Manager GUI END END +Wiggle Mouse + Move To 10 10 + Move To 20 20 + +Handle Donation Reminder + ${found}= Run Keyword And Return Status Click Button MaybeLater ${default_image_timeout / 2} + VAR ${DonationReminder} ${found} scope=TEST + Close Manager GUI ubuntu Run Keyword And Ignore Error Click Dialog Button cancel 0.01 Run Keyword And Ignore Error Click Dialog Button no 0.01 Close Manager GUI - - Close Manager GUI windows Run Keyword And Ignore Error Click Dialog Button cancel 0.01 Run Keyword And Ignore Error Click Dialog Button no 0.01 @@ -174,6 +184,7 @@ Close Manager GUI Fail END END + Kill Manager If Still Running # stdout=${OUTPUT DIR}${/}stdout_manager.txt stderr=${OUTPUT DIR}${/}stderr_manager.txt Show Log ${OUTPUT DIR}${/}stdout_manager.txt Show Log ${OUTPUT DIR}${/}stderr_manager.txt @@ -214,9 +225,13 @@ Close Manager GUI macos Fail END END + Kill Manager If Still Running Show Log ${OUTPUT DIR}${/}stdout_manager.txt Show Log ${OUTPUT DIR}${/}stderr_manager.txt +Kill Manager If Still Running + Kill If Still Running ${cmd_manager} + Stop Agent ${running}= Is Process Running ${process_agent} IF ${running} @@ -232,10 +247,28 @@ Stop Agent # Should Be Equal As Integers ${result.rc} 0 END + Kill Agent If Still Running # stdout=${OUTPUT DIR}${/}stdout_agent.txt stderr=${OUTPUT DIR}${/}stderr_agent.txt Show Log ${OUTPUT DIR}${/}stdout_agent.txt Show Log ${OUTPUT DIR}${/}stderr_agent.txt +Kill Agent If Still Running + Kill If Still Running ${cmd_agent} + +Kill If Still Running + [Arguments] ${cmdname} + ${processes}= Evaluate list(psutil.process_iter()) modules=psutil + # Log ${processes} + FOR ${p} IN @{processes} + # Log ${p} + TRY + IF $cmdname in $p.name() + Evaluate $p.kill() + END + EXCEPT # Match any error. + No Operation + END + END Show Log [Arguments] ${filename} @@ -348,12 +381,12 @@ Selected Option Should Be Click Button - [Arguments] ${btnname} + [Arguments] ${btnname} ${timeout}=${default_image_timeout} ${btnnamel}= Convert To Lower Case ${btnname} ${img}= Set Variable manager_${platform}_button_${btnnamel}.png Log ${CURDIR} Log ${IMAGE_DIR} - Wait For ${img} timeout=${default_image_timeout} + Wait For ${img} timeout=${timeout} @{coordinates}= Locate ${img} Click Image ${img} Sleep 0.1 diff --git a/Tests/Regression/Manager/GUI_Features.robot b/Tests/Regression/Manager/GUI_Features.robot index f25dd0d81..21c149653 100644 --- a/Tests/Regression/Manager/GUI_Features.robot +++ b/Tests/Regression/Manager/GUI_Features.robot @@ -166,7 +166,16 @@ Manager Command Line AGENTS -a Click Button runplay ${status}= Run Keyword And Return Status ... Wait For ${platform}_warning_label_not_enough_agents.png timeout=${10} - Run Keyword If not ${status} Fail msg=The manager didn't display expected prompt dialogue that says: Not enough Agents available to run Robots! + IF not ${status} + # Try again with alt screenshot + ${status}= Run Keyword And Return Status + ... Wait For ${platform}_warning_label_not_enough_agents2.png timeout=${10} + END + + IF not ${status} + Take A Screenshot + Fail msg=The manager didn't display expected prompt dialogue that says: Not enough Agents available to run Robots! + END Press key.enter 1 Times [Teardown] Run Keywords @@ -1911,8 +1920,17 @@ Verify If Manager Displays Prompt Dialogue When No Agents Available To Run Robot ${status}= Run Keyword And Return Status ... Wait For ${platform}_warning_label_not_enough_agents.png timeout=${10} - Take A Screenshot - Run Keyword If not ${status} Fail msg=The manager didn't display expected prompt dialogue that says: Not enough Agents available to run Robots! + IF not ${status} + # Try again with alt screenshot + ${status}= Run Keyword And Return Status + ... Wait For ${platform}_warning_label_not_enough_agents2.png timeout=${10} + END + + IF not ${status} + Take A Screenshot + Fail msg=The manager didn't display expected prompt dialogue that says: Not enough Agents available to run Robots! + END + Press key.enter 1 Times ${status}= Run Keyword And Return Status ... Wait For manager_${platform}_button_abort timeout=${10} @@ -1943,8 +1961,18 @@ Verify If Manager Displays Prompt Dialogue When No Agents Available To Run Robot Click Button runplay ${status}= Run Keyword And Return Status ... Wait For ${platform}_warning_label_not_enough_agents.png timeout=${10} - Run Keyword If ${status} Fail - ... msg=The manager have displaed prompt dialogue that says: Not enough Agents available to run Robots! but that was not expected! + + IF not ${status} + # Try again with alt screenshot + ${status}= Run Keyword And Return Status + ... Wait For ${platform}_warning_label_not_enough_agents2.png timeout=${10} + END + + IF ${status} + Take A Screenshot + Fail msg=The manager have displaed prompt dialogue that says: Not enough Agents available to run Robots! but that was not expected! + END + Sleep 5 Click Button stoprun Sleep 2 @@ -2909,7 +2937,7 @@ Verify That Time Gets Correctly Validated For Schelduled Start ${copied_converted_start_time_value}= Evaluate clipboard.paste() modules=clipboard Should Be Equal ${updated_start_times}[${i}] ${copied_converted_start_time_value} ... msg=The "Schedule Time" did not convert to the time as expected [ Expected != Converted ] - + END [Teardown] Run Keywords Close Manager GUI ${platform} @@ -3042,7 +3070,7 @@ Verify Test Doesn't Start Until Scheduled To Start And Will Start After the Time ... Open Agent ${current_time}= Get Current Date result_format=%H:%M:%S - ${new_time}= Add Time To Date ${current_time} 45 date_format=%H:%M:%S result_format=%H:%M:%S + ${new_time}= Add Time To Date ${current_time} 105 date_format=%H:%M:%S result_format=%H:%M:%S ${scenariofile}= Normalize Path ${CURDIR}${/}testdata${/}Issue-#89${/}Issue-#89.rfs VAR @{mngr_options} -s ${scenariofile} -t ${new_time} @@ -3072,7 +3100,7 @@ Verify the Start Time Is Displayed On the Plan Screen VAR ${expected_time_image} 3_00_00 END VAR @{mngr_options} -t ${scheduled_time} - + Open Manager GUI ${mngr_options} Take A Screenshot ${status}= Run Keyword And Return Status @@ -3090,7 +3118,7 @@ Verify the Remaining Time Is Displayed On the Plan Screen ${current_time}= Get Current Date result_format=%H:%M:%S #adding 10m:20s - ${new_time}= Add Time To Date ${current_time} 620 date_format=%H:%M:%S result_format=%H:%M:%S + ${new_time}= Add Time To Date ${current_time} 680 date_format=%H:%M:%S result_format=%H:%M:%S VAR @{mngr_options} -t ${new_time} Open Manager GUI ${mngr_options} diff --git a/Tests/Regression/Manager/Images/file_method/macos_dock_trash.png b/Tests/Regression/Manager/Images/file_method/macos_dock_trash.png index ea628741d..174e12c85 100644 Binary files a/Tests/Regression/Manager/Images/file_method/macos_dock_trash.png and b/Tests/Regression/Manager/Images/file_method/macos_dock_trash.png differ diff --git a/Tests/Regression/Manager/Images/file_method/macos_dock_trash2.png b/Tests/Regression/Manager/Images/file_method/macos_dock_trash2.png new file mode 100644 index 000000000..ea628741d Binary files /dev/null and b/Tests/Regression/Manager/Images/file_method/macos_dock_trash2.png differ diff --git a/Tests/Regression/Manager/Images/file_method/macos_finder.png b/Tests/Regression/Manager/Images/file_method/macos_finder.png index cb839fd9a..2c9640e77 100644 Binary files a/Tests/Regression/Manager/Images/file_method/macos_finder.png and b/Tests/Regression/Manager/Images/file_method/macos_finder.png differ diff --git a/Tests/Regression/Manager/Images/file_method/macos_launchpad.png b/Tests/Regression/Manager/Images/file_method/macos_launchpad.png index 3521aeb2d..fb10abcbb 100644 Binary files a/Tests/Regression/Manager/Images/file_method/macos_launchpad.png and b/Tests/Regression/Manager/Images/file_method/macos_launchpad.png differ diff --git a/Tests/Regression/Manager/Images/file_method/macos_warning_label_not_enough_agents.png b/Tests/Regression/Manager/Images/file_method/macos_warning_label_not_enough_agents.png index 2a7d29ada..1b0ae86cd 100644 Binary files a/Tests/Regression/Manager/Images/file_method/macos_warning_label_not_enough_agents.png and b/Tests/Regression/Manager/Images/file_method/macos_warning_label_not_enough_agents.png differ diff --git a/Tests/Regression/Manager/Images/file_method/macos_warning_label_not_enough_agents2.png b/Tests/Regression/Manager/Images/file_method/macos_warning_label_not_enough_agents2.png new file mode 100644 index 000000000..c2177a2a3 Binary files /dev/null and b/Tests/Regression/Manager/Images/file_method/macos_warning_label_not_enough_agents2.png differ diff --git a/Tests/Regression/Manager/Images/file_method/manager_macos_button_maybelater.png b/Tests/Regression/Manager/Images/file_method/manager_macos_button_maybelater.png new file mode 100644 index 000000000..3c12af260 Binary files /dev/null and b/Tests/Regression/Manager/Images/file_method/manager_macos_button_maybelater.png differ diff --git a/Tests/Regression/Manager/Images/file_method/manager_ubuntu_button_maybelater.png b/Tests/Regression/Manager/Images/file_method/manager_ubuntu_button_maybelater.png new file mode 100644 index 000000000..548178772 Binary files /dev/null and b/Tests/Regression/Manager/Images/file_method/manager_ubuntu_button_maybelater.png differ diff --git a/Tests/Regression/Manager/Images/file_method/manager_windows_button_maybelater.png b/Tests/Regression/Manager/Images/file_method/manager_windows_button_maybelater.png new file mode 100644 index 000000000..d6c8f27b5 Binary files /dev/null and b/Tests/Regression/Manager/Images/file_method/manager_windows_button_maybelater.png differ diff --git a/Tests/Regression/Reporter/GUI_Basic.robot b/Tests/Regression/Reporter/GUI_Basic.robot index 9ebc76e53..1032eefac 100644 --- a/Tests/Regression/Reporter/GUI_Basic.robot +++ b/Tests/Regression/Reporter/GUI_Basic.robot @@ -17,7 +17,52 @@ Select Preview Tab Click Tab Preview # Close GUI - + # Accessability Settings test was to verify Terminal is set to 'check' + # https://stackoverflow.com/questions/62035751/pyautogui-not-running-on-mac-catalina + # MacOS Accessability Settings + # [Tags] macos-latest + # + # # setting -> security & privacy -> Accessibility -> Terminal 'check' + # + # # Open Settings + # ${img}= Set Variable ${platform}_settings.png + # Wait For ${img} timeout=${default_image_timeout} + # @{coordinates}= Locate ${img} + # Click Image ${img} + # + # + # # Open security & privacy + # ${img}= Set Variable ${platform}_settings_privsec.png + # Wait For ${img} timeout=${default_image_timeout} + # Click Image ${img} + # + # # Open Accessibility + # ${img}= Set Variable ${platform}_settings_accessibility.png + # ${imgsd}= Set Variable ${platform}_settings_scrolldown.png + # ${found}= Run Keyword And Return Status Wait For ${img} timeout=10 + # WHILE not ${found} + # Take A Screenshot + # Click Image ${imgsd} + # ${found}= Run Keyword And Return Status Wait For ${img} timeout=10 + # END + # Take A Screenshot + # Click Image ${img} + # + # # Open Check Terminal + # + # Sleep 10.5 + # Take A Screenshot + # Fatal Error Intentional Fail + # + # Click Image reporter_${platform}_button_closewindow.png + # Run Keyword And Ignore Error Click Image reporter_${platform}_button_closewindow.png + # Take A Screenshot + # Sleep 0.5 + # + # + # Fatal Error Intentional Fail + # + # [Teardown] Fatal Error Intentional Fail # Intentional Fail # [Tags] ubuntu-latest windows-latest macos-latest diff --git a/Tests/Regression/Reporter/GUI_Bugs.robot b/Tests/Regression/Reporter/GUI_Bugs.robot index f0e495cb6..3dd147897 100644 --- a/Tests/Regression/Reporter/GUI_Bugs.robot +++ b/Tests/Regression/Reporter/GUI_Bugs.robot @@ -18,11 +18,11 @@ Verify If Reporter Runs With Existing INI File From Current Version File Should Not Be Empty ${location}${/}RFSwarmReporter.ini Log To Console Running Reporter with existing ini file. Open GUI + Wait For Status PreviewLoaded TRY - Sleep 10 Click Section test_result_summary Click #double click needed. Maybe delete after eel module implemetation - Wait For reporter_${platform}_option_datatable.png timeout=${30} + Wait For reporter_${platform}_option_datatable.png timeout=${60} EXCEPT Fail msg=Reporter is not responding! END @@ -35,8 +35,8 @@ Verify If Reporter Runs With No Existing INI File From Current Version File Should Not Exist ${location}${/}RFSwarmReporter.ini Log To Console Running Reporter with no existing ini file. Open GUI + Wait For Status SelectResultFile TRY - Sleep 10 Click Section test_result_summary Click #double click needed. Maybe delete after eel module implemetation Wait For reporter_${platform}_option_datatable.png timeout=${30} @@ -56,8 +56,8 @@ Verify If Reporter Runs With Existing INI File From Previous Version File Should Not Be Empty ${location}${/}RFSwarmReporter.ini Log To Console Running Reporter with existing ini file. Open GUI + Wait For Status SelectResultFile TRY - Sleep 10 Click Section test_result_summary Click #double click needed. Maybe delete after eel module implemetation Wait For reporter_${platform}_option_datatable.png timeout=${30} diff --git a/Tests/Regression/Reporter/GUI_Common.robot b/Tests/Regression/Reporter/GUI_Common.robot index f435039c5..4012dc82b 100644 --- a/Tests/Regression/Reporter/GUI_Common.robot +++ b/Tests/Regression/Reporter/GUI_Common.robot @@ -19,6 +19,7 @@ ${IMAGE_DIR} ${CURDIR}${/}Images${/}file_method ${pyfile} ${EXECDIR}${/}rfswarm_reporter${/}rfswarm_reporter.py ${process} None ${sssleep} 0.5 +${DonationReminter} ${False} *** Keywords *** Set Platform @@ -149,11 +150,16 @@ Get Text Value To Right Of Wait For ${img} timeout=${default_image_timeout} ${b4value}= Get Clipboard Content + Click To The Right Of Image ${img} ${offsetx} + Sleep 10 ms + Click To The Right Of Image ${img} ${offsetx} + Sleep 10 ms ${value}= Copy From The Right Of ${img} ${offsetx} - # Take A Screenshot - WHILE $b4value == $value limit=10 + Take A Screenshot + WHILE $b4value == $value limit=15 Wait For ${img} timeout=${default_image_timeout} ${offsetx}= Evaluate ${offsetx}+10 + Click To The Right Of Image ${img} ${offsetx} ${value}= Copy From The Right Of ${img} ${offsetx} # Take A Screenshot ${valuec}= Copy @@ -164,14 +170,31 @@ Get Text Value To Right Of IF $valueg != $value ${value}= Set Variable ${valueg} END - IF $platform == 'macos' - Sleep 10 ms - Press Combination KEY.command c + IF $platform == 'macos' and $b4value == $value + # Click To The Right Of Image ${img} ${offsetx} + # Sleep 10 ms + # Click To The Right Of Image ${img} ${offsetx} + # Sleep 10 ms + # Take A Screenshot + Click To The Right Of Image ${img} ${offsetx} clicks=3 + # Take A Screenshot + Press Combination KEY.command KEY.c + # Press Combination KEY.command KEY.v Sleep 10 ms + # Take A Screenshot + # Press Combination KEY.command KEY.v + # Sleep 10 ms + # Take A Screenshot ${valueg}= Get Clipboard Content IF $valueg != $value ${value}= Set Variable ${valueg} END + + # ${valueclp}= Evaluate pyperclip.paste() modules=pyperclip + # IF $valueclp != $value + # ${value}= Set Variable ${valueclp} + # END + END END RETURN ${value} @@ -198,20 +221,23 @@ Set Text Value To Right Of Click Double Click Type ${value} - # Take A Screenshot - ${value2}= Get Text Value To Right Of ${label} - WHILE $value2 != $value limit=10 - ${x}= Evaluate ${x}+10 - ${offsetx}= Evaluate ${offsetx}+10 - @{coordinates}= Create List ${x} ${y} - Move To ${coordinates} - Click - Double Click - Type ${value} - # Take A Screenshot + IF $platform == 'macos' + Take A Screenshot + ELSE ${value2}= Get Text Value To Right Of ${label} + WHILE $value2 != $value limit=10 + ${x}= Evaluate ${x}+10 + ${offsetx}= Evaluate ${offsetx}+10 + @{coordinates}= Create List ${x} ${y} + Move To ${coordinates} + Click + Double Click + Type ${value} + # Take A Screenshot + ${value2}= Get Text Value To Right Of ${label} + END + Should Be Equal As Strings ${value} ${value2} END - Should Be Equal As Strings ${value} ${value2} Get Last Screenshot Log ${OUTPUT FILE} @@ -236,12 +262,12 @@ Get Last Screenshot Click Button - [Arguments] ${bttnname} + [Arguments] ${bttnname} ${timeout}=300 ${bttnnamel}= Convert To Lower Case ${bttnname} ${img}= Set Variable reporter_${platform}_button_${bttnnamel}.png Log ${CURDIR} Log ${IMAGE_DIR} - Wait For ${img} timeout=300 + Wait For ${img} timeout=${timeout} @{coordinates}= Locate ${img} Click Image ${img} Sleep ${sssleep} @@ -265,6 +291,8 @@ Wait For Status ${img}= Set Variable reporter_${platform}_status_${statusl}.png Log ${CURDIR} Log ${IMAGE_DIR} + Wiggle Mouse + # Take A Screenshot Wait For ${img} timeout=${timeout} Sleep ${sssleep} # Take A Screenshot @@ -274,16 +302,24 @@ Open GUI ${var}= Get Variables Log ${var} Get Platform + + # Press Escape and move mouse because on linux the screen save had kicked in + Press Combination Key.esc + Wiggle Mouse + ${keyword}= Set Variable Open GUI ${platform} Run Keyword ${keyword} @{appargs} - Sleep 3 + Handle Donation Reminder + +Wiggle Mouse + Move To 10 10 + Move To 20 20 Get Platform &{platforms}= Create Dictionary Linux=ubuntu Darwin=macos Java=notsupported Windows=windows ${os}= Evaluate platform.system() platform Set Suite Variable ${platform} ${platforms}[${os}] - Open GUI windows [Arguments] @{appargs} # Set Suite Variable ${platform} windows @@ -324,6 +360,9 @@ Open GUI macos Set Screenshot Folder ${OUTPUT DIR} # Take A Screenshot +Handle Donation Reminder + ${found}= Run Keyword And Return Status Click Button MaybeLater ${default_image_timeout / 2} + VAR ${DonationReminder} ${found} scope=TEST Close GUI ${keyword}= Set Variable Close GUI ${platform} diff --git a/Tests/Regression/Reporter/GUI_Features.robot b/Tests/Regression/Reporter/GUI_Features.robot index a96c13b74..8e4113731 100644 --- a/Tests/Regression/Reporter/GUI_Features.robot +++ b/Tests/Regression/Reporter/GUI_Features.robot @@ -58,7 +58,10 @@ Verify That Files Get Saved With Correct Extension And Names ... Close GUI Whole report time range - [Tags] ubuntu-latest macos-latest windows-latest Issue #138 + [Tags] ubuntu-latest windows-latest Issue #138 + # [Tags] ubuntu-latest macos-latest windows-latest Issue #138 + # This test stopped working on macos a week before go live, for some reason imagehorizon is no longer + # able to send keystoked to the main UI screen, this needs further investigation Log To Console ${\n}TAGS: ${TEST TAGS} Make Clipboard Not None ${testdata}= Set Variable Issue-#138 @@ -75,25 +78,35 @@ Whole report time range Wait For Status PreviewLoaded Click Section Robots + # Take A Screenshot Click Tab Preview + # Take A Screenshot # check the graph as expected + # Take A Screenshot Set Confidence 0.7 Locate reporter_${platform}_graph_robots1.png Set Confidence 0.9 Click Tab Settings + # Take A Screenshot Click Section Report + # Take A Screenshot + + # ${title}= Get Text Value To Right Of Title + # Take A Screenshot # Set start time 14:20 # Select Field With Label StartTime # Press Combination KEY.END # Press Combination KEY.backspace KEY.backspace # Type 20 + # ${StartTime}= Set Variable 2023-09-28 14:20 ${StartTime}= Get Text Value To Right Of StartTime ${StartTime}= Replace String ${StartTime} 14:11 14:20 Set Text Value To Right Of StartTime ${StartTime} + # Take A Screenshot # Take A Screenshot Select Field With Label Title 150 @@ -104,9 +117,11 @@ Whole report time range # Press Combination KEY.END # Press Combination KEY.backspace KEY.backspace KEY.backspace KEY.backspace KEY.backspace KEY.backspace KEY.backspace # Type 14:58 + # ${EndTime}= Set Variable 2023-09-28 14:58 ${EndTime}= Get Text Value To Right Of EndTime ${EndTime}= Replace String ${EndTime} 15:00 14:58 Set Text Value To Right Of EndTime ${EndTime} + Take A Screenshot # Take A Screenshot # ${bounds}= Find Text Title: @@ -116,9 +131,9 @@ Whole report time range Click Tab Preview Wait For Status PreviewLoaded - Sleep 10 - - Wait For Status PreviewLoaded + # Sleep 10 + # + # Wait For Status PreviewLoaded Click Section Robots Wait For Status PreviewLoaded diff --git a/Tests/Regression/Reporter/Images/file_method/macos_finder.png b/Tests/Regression/Reporter/Images/file_method/macos_finder.png index bb1a70fe0..97687460a 100644 Binary files a/Tests/Regression/Reporter/Images/file_method/macos_finder.png and b/Tests/Regression/Reporter/Images/file_method/macos_finder.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/macos_settings.png b/Tests/Regression/Reporter/Images/file_method/macos_settings.png new file mode 100644 index 000000000..63aef1cdc Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/macos_settings.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/macos_settings_accessibility.png b/Tests/Regression/Reporter/Images/file_method/macos_settings_accessibility.png new file mode 100644 index 000000000..480d46fbc Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/macos_settings_accessibility.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/macos_settings_privsec.png b/Tests/Regression/Reporter/Images/file_method/macos_settings_privsec.png new file mode 100644 index 000000000..d1c11ce04 Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/macos_settings_privsec.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/macos_settings_scrolldown.png b/Tests/Regression/Reporter/Images/file_method/macos_settings_scrolldown.png new file mode 100644 index 000000000..21eceb683 Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/macos_settings_scrolldown.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/reporter_macos_button_donate.png b/Tests/Regression/Reporter/Images/file_method/reporter_macos_button_donate.png new file mode 100644 index 000000000..dd3a2b961 Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/reporter_macos_button_donate.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/reporter_macos_button_maybelater.png b/Tests/Regression/Reporter/Images/file_method/reporter_macos_button_maybelater.png new file mode 100644 index 000000000..3c12af260 Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/reporter_macos_button_maybelater.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/reporter_macos_status_selectresultfile.png b/Tests/Regression/Reporter/Images/file_method/reporter_macos_status_selectresultfile.png new file mode 100644 index 000000000..8b055627f Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/reporter_macos_status_selectresultfile.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_button_donate.png b/Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_button_donate.png new file mode 100644 index 000000000..cfd06354b Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_button_donate.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_button_maybelater.png b/Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_button_maybelater.png new file mode 100644 index 000000000..548178772 Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_button_maybelater.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_status_selectresultfile.png b/Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_status_selectresultfile.png new file mode 100644 index 000000000..dfdead7e0 Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_status_selectresultfile.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/reporter_windows_button_donate.png b/Tests/Regression/Reporter/Images/file_method/reporter_windows_button_donate.png new file mode 100644 index 000000000..ddcadecc9 Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/reporter_windows_button_donate.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/reporter_windows_button_maybelater.png b/Tests/Regression/Reporter/Images/file_method/reporter_windows_button_maybelater.png new file mode 100644 index 000000000..d6c8f27b5 Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/reporter_windows_button_maybelater.png differ diff --git a/Tests/Regression/Reporter/Images/file_method/reporter_windows_status_selectresultfile.png b/Tests/Regression/Reporter/Images/file_method/reporter_windows_status_selectresultfile.png new file mode 100644 index 000000000..660515e80 Binary files /dev/null and b/Tests/Regression/Reporter/Images/file_method/reporter_windows_status_selectresultfile.png differ diff --git a/rfswarm_manager/rfswarm.py b/rfswarm_manager/rfswarm.py index 6b2a943d4..b1b31d8d8 100644 --- a/rfswarm_manager/rfswarm.py +++ b/rfswarm_manager/rfswarm.py @@ -4052,6 +4052,9 @@ def __init__(self, master=None): base.debugmsg(6, "BuildUI") self.BuildUI() + dr = threading.Thread(target=self.dispaly_donation_reminder) + dr.start() + try: base.debugmsg(6, "pln_update_graph") ug = threading.Thread(target=self.pln_update_graph) @@ -4470,6 +4473,87 @@ def ConfigureStyle(self): style.configure("TRadiobutton", foreground=self.style_text_colour) + def dispaly_donation_reminder(self): + if 'donation_reminder' not in base.config['GUI']: + base.config['GUI']['donation_reminder'] = "0" + base.saveini() + + lastreminder = int(base.config['GUI']['donation_reminder']) + timenow = int(datetime.now().timestamp()) + timesincereminder = timenow - lastreminder + yearseconds = 60 * 60 * 24 * 365 + + # display donation reminder on first launch and then once per year + if timesincereminder > yearseconds: + + titlemsg = self.titleprefix + " - Donation Reminder" + + donatemsg = "RFSwarm's mission is to give you a an industry leading performance test tool, that is easy to use, " + donatemsg += "quick to develop test scripts and free from limitations so that you can just get on with testing." + donatemsg += "\n\n" + donatemsg += "Accomplishing this mission costs us resources, and requires the time of many talented people to fix " + donatemsg += "bugs and develop new features and generally improve RFSwarm." + donatemsg += "\n\n" + donatemsg += "RFSwarm is proud to be a completely open source application that is 100% community funded and " + donatemsg += "does not harvest and sell your data in any way." + donatemsg += "\n\n" + donatemsg += "So today we're asking for you help to make RFSwarm better, please consider giving a donation " + donatemsg += "to support RFSwarm." + + self.drWindow = tk.Toplevel(self.root) + self.drWindow.wm_iconphoto(False, self.icon) + self.drWindow.columnconfigure(0, weight=1) + self.drWindow.columnconfigure(2, weight=1) + self.drWindow.title(titlemsg) + self.drWindow.attributes('-topmost', 'true') + + row = 0 + self.drWindow.rowconfigure(row, weight=1) + + self.drWindow.lblDR00 = ttk.Label(self.drWindow, text=" ") + self.drWindow.lblDR00.grid(column=0, row=row, sticky="nsew") + + self.drWindow.lblDR01 = ttk.Label(self.drWindow, text=" ") + self.drWindow.lblDR01.grid(column=1, row=row, sticky="nsew") + + self.drWindow.lblDR02 = ttk.Label(self.drWindow, text=" ") + self.drWindow.lblDR02.grid(column=2, row=row, sticky="nsew") + + row += 1 + self.drWindow.lblDR11 = ttk.Label(self.drWindow, text=donatemsg, wraplength=600) + self.drWindow.lblDR11.grid(column=1, row=row, sticky="nsew") + + row += 1 + self.drWindow.rowconfigure(row, weight=1) + self.drWindow.lblDR21 = ttk.Label(self.drWindow, text=" ") + self.drWindow.lblDR21.grid(column=1, row=row, sticky="nsew") + + row += 1 + + self.drWindow.fmeBBar = tk.Frame(self.drWindow) + self.drWindow.fmeBBar.grid(column=0, row=row, columnspan=5, sticky="nsew") + + self.drWindow.fmeBBar.columnconfigure(0, weight=1) + + self.drWindow.bind('', self.close_donation_reminder) + self.drWindow.bind('', self.drWindow.destroy) + + bdonate = ttk.Button(self.drWindow.fmeBBar, text="Donate", padding='3 3 3 3', command=self.close_donation_reminder) + bdonate.grid(column=9, row=0, sticky="nsew") + + blater = ttk.Button(self.drWindow.fmeBBar, text="Maybe Later", padding='3 3 3 3', command=self.drWindow.destroy) + blater.grid(column=8, row=0, sticky="nsew") + + base.config['GUI']['donation_reminder'] = str(int(datetime.now().timestamp())) + base.saveini() + + def close_donation_reminder(self, *args): + base.debugmsg(5, "args:", args) + self.drWindow.destroy() + + url = "https://github.com/sponsors/damies13" + webbrowser.open(url, new=0, autoraise=True) + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Graphs diff --git a/rfswarm_reporter/rfswarm_reporter.py b/rfswarm_reporter/rfswarm_reporter.py index 2a0421b39..4e36c32b9 100644 --- a/rfswarm_reporter/rfswarm_reporter.py +++ b/rfswarm_reporter/rfswarm_reporter.py @@ -32,6 +32,7 @@ # import tkinter.messagebox as tkm # python3 import tkinter.simpledialog as tksd import tkinter.ttk as ttk # python3 +import webbrowser import zoneinfo # says Requires python 3.9 from copy import copy # used for xlsx export from datetime import datetime # , timezone @@ -3557,6 +3558,10 @@ def __init__(self, master=None): base.config['GUI']['win_height'] = "390" base.saveini() + if 'donation_reminder' not in base.config['GUI']: + base.config['GUI']['donation_reminder'] = "0" + base.saveini() + # # Reporter # @@ -7134,6 +7139,9 @@ def __init__(self, master=None): base.debugmsg(5, "BuildUI") self.BuildUI() self.BuildMenu() + # self.dispaly_donation_reminder() + dr = threading.Thread(target=self.dispaly_donation_reminder) + dr.start() def load_icons(self): # "New Report Template" page_add.png @@ -7796,6 +7804,87 @@ def content_load(self, id): cp = threading.Thread(target=lambda: self.content_preview(id)) cp.start() + def dispaly_donation_reminder(self): + if 'donation_reminder' not in base.config['GUI']: + base.config['GUI']['donation_reminder'] = "0" + base.saveini() + + lastreminder = int(base.config['GUI']['donation_reminder']) + timenow = int(datetime.now().timestamp()) + timesincereminder = timenow - lastreminder + yearseconds = 60 * 60 * 24 * 365 + + # display donation reminder on first launch and then once per year + if timesincereminder > yearseconds: + + titlemsg = self.titleprefix + " - Donation Reminder" + + donatemsg = "RFSwarm's mission is to give you a an industry leading performance test tool, that is easy to use, " + donatemsg += "quick to develop test scripts and free from limitations so that you can just get on with testing." + donatemsg += "\n\n" + donatemsg += "Accomplishing this mission costs us resources, and requires the time of many talented people to fix " + donatemsg += "bugs and develop new features and generally improve RFSwarm." + donatemsg += "\n\n" + donatemsg += "RFSwarm is proud to be a completely open source application that is 100% community funded and " + donatemsg += "does not harvest and sell your data in any way." + donatemsg += "\n\n" + donatemsg += "So today we're asking for you help to make RFSwarm better, please consider giving a donation " + donatemsg += "to support RFSwarm." + + self.drWindow = tk.Toplevel(self.root) + self.drWindow.wm_iconphoto(False, self.icon) + self.drWindow.columnconfigure(0, weight=1) + self.drWindow.columnconfigure(2, weight=1) + self.drWindow.title(titlemsg) + self.drWindow.attributes('-topmost', 'true') + + row = 0 + self.drWindow.rowconfigure(row, weight=1) + + self.drWindow.lblDR00 = ttk.Label(self.drWindow, text=" ") + self.drWindow.lblDR00.grid(column=0, row=row, sticky="nsew") + + self.drWindow.lblDR01 = ttk.Label(self.drWindow, text=" ") + self.drWindow.lblDR01.grid(column=1, row=row, sticky="nsew") + + self.drWindow.lblDR02 = ttk.Label(self.drWindow, text=" ") + self.drWindow.lblDR02.grid(column=2, row=row, sticky="nsew") + + row += 1 + self.drWindow.lblDR11 = ttk.Label(self.drWindow, text=donatemsg, wraplength=600) + self.drWindow.lblDR11.grid(column=1, row=row, sticky="nsew") + + row += 1 + self.drWindow.rowconfigure(row, weight=1) + self.drWindow.lblDR21 = ttk.Label(self.drWindow, text=" ") + self.drWindow.lblDR21.grid(column=1, row=row, sticky="nsew") + + row += 1 + + self.drWindow.fmeBBar = tk.Frame(self.drWindow) + self.drWindow.fmeBBar.grid(column=0, row=row, columnspan=5, sticky="nsew") + + self.drWindow.fmeBBar.columnconfigure(0, weight=1) + + self.drWindow.bind('', self.close_donation_reminder) + self.drWindow.bind('', self.drWindow.destroy) + + bdonate = ttk.Button(self.drWindow.fmeBBar, text="Donate", padding='3 3 3 3', command=self.close_donation_reminder) + bdonate.grid(column=9, row=0, sticky="nsew") + + blater = ttk.Button(self.drWindow.fmeBBar, text="Maybe Later", padding='3 3 3 3', command=self.drWindow.destroy) + blater.grid(column=8, row=0, sticky="nsew") + + base.config['GUI']['donation_reminder'] = str(int(datetime.now().timestamp())) + base.saveini() + + def close_donation_reminder(self, *args): + base.debugmsg(5, "args:", args) + self.drWindow.destroy() + + url = "https://github.com/sponsors/damies13" + webbrowser.open(url, new=0, autoraise=True) + # # Settings #