Skip to content

Commit

Permalink
Merge v1.4.0 branch to the Test-damies13#198-for-Issue-damies13#41. T…
Browse files Browse the repository at this point in the history
…rying to make test case a bit faster
  • Loading branch information
ArekKuczynski committed Sep 27, 2024
2 parents dc19559 + e3e8ba8 commit e11ad6d
Show file tree
Hide file tree
Showing 109 changed files with 2,146 additions and 216 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/Package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ jobs:
for file in $files
do
# echo "version variable : $file"
sed -i -e "s/version = \"[^\"]*\"/version = \"${numver}\"/" "$file"
sed -i -e "s/version=\"[^\"]*\"/version = \"${numver}\"/" "$file"
sed -i -e "s/version = \"[^\"]*\"^/version = \"${numver}\"/" "$file"
sed -i -e "s/version=\"[^\"]*\"^/version = \"${numver}\"/" "$file"
# echo "version comment : $file"
sed -i -e "s/# Version .*/# Version ${numver}/" "$file"
done
Expand Down Expand Up @@ -214,6 +214,8 @@ jobs:
files:
- 'rfswarm_agent/**'
- 'Tests/Regression/Agent/**'
- '.github/workflows/Regression_Tests_Agent.yaml'
- 'setup-agent.py'
- name: Check Run Manager Tests
id: run_manager
Expand All @@ -224,6 +226,8 @@ jobs:
files:
- 'rfswarm_manager/**'
- 'Tests/Regression/Manager/**'
- '.github/workflows/Regression_Tests_Manager.yaml'
- 'setup-manager.py'
- name: Check Run Reporter Tests
id: run_reporter
Expand All @@ -234,5 +238,7 @@ jobs:
files:
- 'rfswarm_reporter/**'
- 'Tests/Regression/Reporter/**'
- '.github/workflows/Regression_Tests_Reporter.yaml'
- 'setup-reporter.py'
#
7 changes: 5 additions & 2 deletions .github/workflows/Regression_Tests_Manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ jobs:
sudo apt update -y
- name: "Ubuntu Installs"
if: ${{ matrix.platform == 'ubuntu-latest' }}
# sudo apt install -y python3-tk python3-dev python3-xlib scrot fluxbox # tesseract-ocr
run: |
sudo apt install -y python3-tk python3-dev python3-xlib scrot fluxbox xclip # tesseract-ocr
sudo apt -y install python3-tk python3-dev python3-xlib scrot lxqt xclip # tesseract-ocr
sudo apt list --installed
- name: "Ubuntu Xvfb"
if: ${{ matrix.platform == 'ubuntu-latest' }}
Expand All @@ -60,7 +61,9 @@ jobs:
xauth list
sleep 1
# fluxbox
fluxbox &
# fluxbox &
# lxqt
startlxqt &
- name: Update Robot Tag
shell: python
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/Regression_Tests_Reporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ jobs:
sudo apt update -y
- name: "Ubuntu Installs"
if: ${{ matrix.platform == 'ubuntu-latest' }}
# Install the minimal LXQt desktop.
# sudo apt install lxqt
# Install the Xfce desktop.
# sudo apt install xfce4
# sudo apt -y install python3-tk python3-dev python3-xlib scrot fluxbox tesseract-ocr
run: |
sudo apt -y install python3-tk python3-dev python3-xlib scrot fluxbox tesseract-ocr
sudo apt -y install python3-tk python3-dev python3-xlib scrot lxqt tesseract-ocr
sudo apt -y install xsel xclip
sudo apt list --installed
- name: "Ubuntu Xvfb"
Expand All @@ -60,7 +65,9 @@ jobs:
xauth list
sleep 1
# fluxbox
fluxbox &
# fluxbox &
# lxqt
startlxqt &
- name: "MacOS Install tesseract"
if: ${{ matrix.platform == 'macos-latest' }}
run: |
Expand Down
10 changes: 10 additions & 0 deletions Doc/rfswarm_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ pip* install rfswarm-agent
```
\*some systems might need you to use pip3 and or sudo

Next, desktop users can optionally install the desktop icon
- In the start menu for Windows
- In the Applications folder for Mac
- As a .desktop file for Linux (known to work for Gnome, KDE, Cinamon, XFCE, LXQt, should also work for other desktop environments that support standard .desktop files)

Using the command
```console
rfswarm-manager -c icon
```

### 3. Run Agent 1st time

```console
Expand Down
11 changes: 10 additions & 1 deletion Doc/rfswarm_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,18 @@ Once you have the prerequisites sorted, the installation is simply
```console
pip* install rfswarm-manager
```

\*some systems might need you to use pip3 and or sudo

Next, desktop users can optionally install the desktop icon
- In the start menu for Windows
- In the Applications folder for Mac
- As a .desktop file for Linux (known to work for Gnome, KDE, Cinamon, XFCE, LXQt, should also work for other desktop environments that support standard .desktop files)

Using the command
```console
rfswarm-manager -c icon
```

### 2. Adjust the Firewall

Check if there is a firewall on you Manager machine, if so you may need to adjust the firewall to add a rule to allow communication between the Manager and the Agent.
Expand Down
9 changes: 9 additions & 0 deletions Doc/rfswarm_reporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,15 @@ pip* install rfswarm-reporter

\*some systems might need you to use pip3 and or sudo

Next, desktop users can optionally install the desktop icon
- In the start menu for Windows
- In the Applications folder for Mac
- As a .desktop file for Linux (known to work for Gnome, KDE, Cinamon, XFCE, LXQt, should also work for other desktop environments that support standard .desktop files)

Using the command
```console
rfswarm-manager -c icon
```

### 3. Run the Reporter

Expand Down
1 change: 1 addition & 0 deletions README_PyPi.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ To learn more about rfswarm please refer to the [Documentation](https://github.c

- [rfswarm Documentation](https://github.com/damies13/rfswarm/blob/master/Doc/README.md)
- [Discord](https://discord.gg/jJfCMrqCsT)
- [Slack](https://robotframework.slack.com/archives/C06J2Q0LGEM)
- [Reporting Issues / Known Issues](https://github.com/damies13/rfswarm/issues)

<kbd align="centre">
Expand Down
76 changes: 67 additions & 9 deletions Tests/Regression/Agent/CommandLine_Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Set Platform By Python
Set Suite Variable ${platform} ubuntu
END


Set Platform By Tag
# [Arguments] ${ostag}
Log ${OPTIONS}
Expand All @@ -61,7 +60,7 @@ Show Log
[Arguments] ${filename}
Log to console ${\n}-----${filename}-----
${filedata}= Get File ${filename}
Log to console ${filedata}
Log ${filedata} console=True
Log to console -----${filename}-----${\n}

Run Agent
Expand Down Expand Up @@ -107,7 +106,7 @@ Stop Manager
END
Log ${result.stdout}
Log ${result.stderr}

# Should Be Equal As Integers ${result.rc} 0
Log to console Process returned: ${result.rc}
END
Expand Down Expand Up @@ -193,11 +192,11 @@ Get Modules From Program .py File That Are Not BuildIn
... turtledemo types typing unicodedata unittest urllib usercustomize uu uuid venv warnings wave
... weakref webbrowser winreg winsound wsgiref xdrlib xml xmlrpc zipapp zipfile zipimport zlib zoneinfo
&{replace_names} Create Dictionary PIL=pillow

${manager_content} Get File ${file_path}
${all_imports_lines} Split String ${manager_content} separator=\n
Log ${all_imports_lines}

${custom_imports} Create List
${length} Get Length ${all_imports_lines}
FOR ${i} IN RANGE 0 ${length}
Expand All @@ -213,7 +212,7 @@ Get Modules From Program .py File That Are Not BuildIn
BREAK
END
END

FOR ${j} IN RANGE 0 ${length2}
Log ${import_line_elements}[${j}]
IF '${import_line_elements}[${j}]' == '#'
Expand All @@ -236,7 +235,7 @@ Get Modules From Program .py File That Are Not BuildIn
${custom_imports}[${i}] Set Variable ${replace_names}[${custom_imports}[${i}]]
END
END

RETURN ${custom_imports}

Get Install Requires From Setup File
Expand All @@ -258,7 +257,7 @@ Get Install Requires From Setup File
Append To List ${sliced_times} @{sliced_times1}
@{sliced_times2} Split String ${items} separator=-
Append To List ${sliced_times} @{sliced_times2}

FOR ${i} IN @{sliced_times}
Append To List ${refactored_requires} ${i}

Expand Down Expand Up @@ -287,4 +286,63 @@ Get Agent Default Save Path
${i}= Get Index From List ${pip_data_list} Location:
${location}= Set Variable ${pip_data_list}[${i + 1}]
RETURN ${location}${/}rfswarm_agent${/}
#

Check Icon Install
VAR ${projname}= rfswarm-agent scope=TEST
VAR ${dispname}= RFSwarm Agent scope=TEST
Run Keyword Check Icon Install For ${platform}

Check Icon Install For Macos
${Status}= Run Keyword And Return Status Directory Should Exist %{HOME}${/}Applications${/}${projname}.app
IF ${Status}
${appfolder}= Set Variable %{HOME}${/}Applications${/}${dispname}.app
ELSE
${appfolder}= Set Variable ${/}Applications${/}${dispname}.app
END
Directory Should Exist ${appfolder} .app Folder not found

Directory Should Exist ${appfolder}${/}Contents Contents Folder not found
Directory Should Exist ${appfolder}${/}Contents${/}MacOS MacOS Folder not found

Directory Should Exist ${appfolder}${/}Contents${/}Resources Resources Folder not found

Directory Should Exist ${appfolder}${/}Contents${/}Resources${/}${projname}.iconset iconset Folder not found

File Should Exist ${appfolder}${/}Contents${/}Resources${/}${projname}.iconset${/}icon_*.png Icons Images not found

File Should Exist ${appfolder}${/}Contents${/}Resources${/}${projname}.icns icns File not found

File Should Exist ${appfolder}${/}Contents${/}Info.plist plist File not found
Show Log ${appfolder}${/}Contents${/}Info.plist

File Should Exist ${appfolder}${/}Contents${/}PkgInfo PkgInfo File not found
Show Log ${appfolder}${/}Contents${/}PkgInfo

File Should Exist ${appfolder}${/}Contents${/}MacOS${/}${projname} Executable Symbolic Link File not found

Check Icon Install For Windows
Log %{USERPROFILE}
Log %{APPDATA}
Directory Should Exist %{APPDATA} APPDATA Directory not found
Directory Should Exist %{APPDATA}${/}Microsoft Microsoft Directory not found
Directory Should Exist %{APPDATA}${/}Microsoft${/}Windows Windows Directory not found
Directory Should Exist %{APPDATA}${/}Microsoft${/}Windows${/}Start Menu Start Menu Directory not found
File Should Exist %{APPDATA}${/}Microsoft${/}Windows${/}Start Menu${/}${dispname}.lnk Shortcut File not found


Check Icon Install For Ubuntu
Log %{HOME}
# /home/dave/.local/share/applications/rfswarm-manager.desktop
${Status}= Run Keyword And Return Status File Should Exist %{HOME}${/}.local${/}share${/}applications${/}${projname}.desktop
IF ${Status}
${pathprefix}= Set Variable %{HOME}${/}.local${/}share
ELSE
${pathprefix}= Set Variable ${/}usr${/}share
END
File Should Exist ${pathprefix}${/}applications${/}${projname}.desktop Desktop File not found
File Should Exist ${pathprefix}${/}icons${/}hicolor${/}128x128${/}apps${/}${projname}.png Icon File not found



#
#
14 changes: 13 additions & 1 deletion Tests/Regression/Agent/CommandLine_Features.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
Resource CommandLine_Common.robot
Suite Setup Set Platform

Suite Setup Set Platform

*** Test Cases ***
Install Application Icon or Desktop Shortcut
[Tags] ubuntu-latest windows-latest macos-latest Issue #145
@{agent_options}= Create List -g 6 -c ICON
Run Agent ${agent_options}
Sleep 2
Show Log ${OUTPUT DIR}${/}stdout_agent.txt
Show Log ${OUTPUT DIR}${/}stderr_agent.txt

Check Icon Install
Agent Version
[Tags] ubuntu-latest macos-latest windows-latest
# ${result}= Run python3 ${EXECDIR}${/}rfswarm_agent${/}rfswarm_agent.py -v
Expand Down Expand Up @@ -264,4 +276,4 @@ Agent Command Line PROPERTY -p
Should Be True ${len} > 0
... msg=Custom propery 'Issue-#14' not found in PreRun db. ${\n}Query Result: ${prop_result}

[Teardown] Run Keywords Stop Agent Stop Manager
[Teardown] Run Keywords Stop Agent Stop Manager
6 changes: 6 additions & 0 deletions Tests/Regression/Manager/CommandLine_Basic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Manager Help
Log to console ${\n}${result}
Should Contain ${result} IPADDRESS

Show User Dir
${user_dir}= Evaluate os.path.expanduser("~") modules=os
Log user_dir: ${user_dir} console=True
@{items}= List Directory ${user_dir}
Log items: ${items} console=True

*** Keywords ***
Clean Up Old Files
[Tags] ubuntu-latest macos-latest windows-latest
Expand Down
Loading

0 comments on commit e11ad6d

Please sign in to comment.