Skip to content

Commit

Permalink
Ms applications
Browse files Browse the repository at this point in the history
Signed-off-by: Maarit Härkönen <[email protected]>
  • Loading branch information
maaharko committed Oct 10, 2024
1 parent 33c650c commit 6d95578
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 11 deletions.
13 changes: 12 additions & 1 deletion Robot-Framework/resources/common_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,19 @@ Check that the application was started
Should Not Be Empty ${app_pids} ${app_name} is not started
Log To Console ${app_name} is started

Check Application Login Page
[Documentation] Check that application is able to connect to Internet and login page is available
[Arguments] ${application}=outlook
@{browser_ids} SeleniumLibrary.Get Browser Ids
Log ${browser_ids}

${source} SeleniumLibrary.Get source
Log ${source}

${handles} SeleniumLibrary.Get Window Handles
Log ${handles}

Check If Ping Fails
[Documentation] Check that ping is not getting response from host
# ${out} Run and Return RC ping ${DEVICE_IP_ADDRESS} -c 1
${result} Run Process ping ${DEVICE_IP_ADDRESS} -c1 timeout=1s
Should Not Be Equal ${result.rc} ${0}
45 changes: 35 additions & 10 deletions Robot-Framework/test-suites/bat-tests/business_vm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,36 @@
*** Settings ***
Documentation Testing Business VM
Force Tags bat businessvm lenovo-x1
Resource ../../config/variables.robot
Resource ../../resources/ssh_keywords.resource
Resource ../../resources/virtualization_keywords.resource
Resource ../../config/variables.robot
Resource ../../resources/common_keywords.resource
Library SeleniumLibrary

# Suite Teardown Run Keywords Remove Wifi configuration AND Close All Connections
Suite Teardown Close All Connections
Test Setup Run Keywords Connect to netvm AND Connect to VM ${GUI_VM}

*** Variables ***
${ta_wifi_ssid} TII-Testautomation
${netvm_ssh} ${EMPTY}

*** Test Cases ***

*** Test Cases ***
Start Microsoft Outlook on LenovoX1
[Documentation] Start Microsoft Outlook in dedicated VM and verify process started
[Tags] outlook SP-T186
Connect to netvm
Connect to VM ${GUI_VM}
[Tags] outlook SP-T186 SSRCSP-5328
# Configure wifi ${netvm_ssh} ${ta_wifi_ssid} ${TA_WIFI_PSWD} lenovo=True
Start XDG application "Microsoft Outlook"
Connect to VM ${BUSINESS_VM}
Check that the application was started outlook
Check Application Login Page
[Teardown] Kill process @{app_pids}

Start Microsoft 365 on LenovoX1
[Documentation] Start Microsoft 365 in dedicated VM and verify process started
[Tags] microsoft365 SP-T188
Connect to netvm
Connect to VM ${GUI_VM}
Start XDG application "Microsoft 365"
Connect to VM ${BUSINESS_VM}
Check that the application was started microsoft365
Expand All @@ -37,8 +42,6 @@ Start Microsoft 365 on LenovoX1
Start Microsoft Teams on LenovoX1
[Documentation] Start Microsoft Teams in dedicated VM and verify process started
[Tags] teams SP-T187
Connect to netvm
Connect to VM ${GUI_VM}
Start XDG application Teams
Connect to VM ${BUSINESS_VM}
Check that the application was started teams
Expand All @@ -47,9 +50,31 @@ Start Microsoft Teams on LenovoX1
Start Microsoft Trusted Browser on LenovoX1
[Documentation] Start Microsoft Trusted Browser in dedicated VM and verify process started
[Tags] trusted_browser SP-T189
Connect to netvm
Connect to VM ${GUI_VM}
Start XDG application "Trusted Browser"
Connect to VM ${BUSINESS_VM}
Check that the application was started chromium
[Teardown] Kill process @{app_pids}

*** Keywords ***
# Remove these after rebasing logging pr
Configure wifi
[Arguments] ${netvm_ssh} ${SSID} ${passw} ${lenovo}=False
Switch Connection ${netvm_ssh}
Log To Console Configuring Wifi
IF ${lenovo}
Execute Command nmcli dev wifi connect ${SSID} password ${passw} sudo=True sudo_password=${PASSWORD}
ELSE
Execute Command sh -c "wpa_passphrase ${SSID} ${passw} > /etc/wpa_supplicant.conf" sudo=True sudo_password=${PASSWORD}
Execute Command systemctl restart wpa_supplicant.service sudo=True sudo_password=${PASSWORD}
END

Remove Wifi configuration
[Arguments] ${lenovo}=False
Switch Connection ${netvm_ssh}
Log To Console Removing Wifi configuration
IF ${lenovo}
Execute Command nmcli con down id ${SSID} sudo=True sudo_password=${PASSWORD}
ELSE
Execute Command rm /etc/wpa_supplicant.conf sudo=True sudo_password=${PASSWORD}
Execute Command systemctl restart wpa_supplicant.service sudo=True sudo_password=${PASSWORD}
END
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
robotframework-advancedlogging = self.packages.${system}.robotframework-advancedlogging;
robotframework-jsonlibrary = self.packages.${system}.robotframework-jsonlibrary;
robotframework-retryfailed = self.packages.${system}.robotframework-retryfailed;
robotframework-seleniumlibrary = self.packages.${system}.robotframework-seleniumlibrary;
robotframework-seriallibrary = self.packages.${system}.robotframework-seriallibrary;
};
robotframework-jsonlibrary = pkgs.python3Packages.callPackage ./pkgs/robotframework-jsonlibrary {};
robotframework-retryfailed = pkgs.python3Packages.callPackage ./pkgs/robotframework-retryfailed {};
robotframework-seleniumlibrary = pkgs.python3Packages.callPackage ./pkgs/robotframework-seleniumlibrary {};
robotframework-seriallibrary = pkgs.python3Packages.callPackage ./pkgs/robotframework-seriallibrary {};
robotframework-advancedlogging = pkgs.python3Packages.callPackage ./pkgs/robotframework-advancedlogging {};
pkcs7 = pkgs.python3Packages.callPackage ./pkgs/pkcs7 {}; # Requirement of PyP100
Expand All @@ -47,6 +49,7 @@
robotframework
self.packages.${system}.robotframework-jsonlibrary
self.packages.${system}.robotframework-retryfailed
self.packages.${system}.robotframework-seleniumlibrary
self.packages.${system}.robotframework-seriallibrary
self.packages.${system}.robotframework-advancedlogging
self.packages.${system}.PyP100
Expand Down
58 changes: 58 additions & 0 deletions pkgs/robotframework-seleniumlibrary/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
click,
robotframework,
robotframework-pythonlibcore,
selenium,
approvaltests,
pytest-mockito,
pytestCheckHook,
robotstatuschecker,
}:

buildPythonPackage rec {
pname = "robotframework-seleniumlibrary";
version = "6.6.1";
pyproject = true;

# no tests included in PyPI tarball
src = fetchFromGitHub {
owner = "robotframework";
repo = "SeleniumLibrary";
rev = "refs/tags/v${version}";
sha256 = "sha256-ULY0FH1RFQIlhS45LU3vUKi6urZJHiDgi6NdqU5tV2g=";
};

build-system = [ setuptools ];

dependencies = [
click
robotframework
robotframework-pythonlibcore
selenium
];

nativeCheckInputs = [
approvaltests
pytest-mockito
pytestCheckHook
robotstatuschecker
];

preCheck = ''
mkdir utest/output_dir
'';

__darwinAllowLocalNetworking = true;

meta = {
changelog = "https://github.com/robotframework/SeleniumLibrary/blob/${src.rev}/docs/SeleniumLibrary-${version}.rst";
description = "Web testing library for Robot Framework";
homepage = "https://github.com/robotframework/SeleniumLibrary";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ dotlambda ];
};
}

0 comments on commit 6d95578

Please sign in to comment.