aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaresh Kamboju <naresh.kamboju@linaro.org>2016-08-03 19:56:32 +0530
committerNaresh Kamboju <naresh.kamboju@linaro.org>2016-08-03 19:56:32 +0530
commit48d6f5b84445e3579a546c9d2b88440c137391fe (patch)
treea3550b9af79cac6ac77159087caa64b480522135
robot-framework-tests: Initial commit
Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
-rw-r--r--README.rst39
-rw-r--r--chrome-test.robot14
-rw-r--r--chromium-test.robot14
-rw-r--r--firefox-test.robot14
-rwxr-xr-xinstall-on-debian.sh50
-rw-r--r--login-lava.robot34
-rw-r--r--youtube-play-bkk16.robot23
-rw-r--r--youtube-play.robot19
8 files changed, 207 insertions, 0 deletions
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..caefe21
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,39 @@
+Robot framework tests
++++++++++++++++++++++
+Robot Framework is a generic test automation framework for acceptance testing
+and acceptance test-driven development (ATDD). It has easy-to-use tabular test
+data syntax and it utilizes the keyword-driven testing approach. Its testing
+capabilities can be extended by test libraries implemented either with Python
+or Java, and users can create new higher-level keywords from existing ones
+using the same syntax that is used for creating test cases. reference: [1]
+
+[1] http://robotframework.org/
+
+Requirements
+============
+- Linux (Debian / Ubuntu / Openembedded / Fedora based)
+- Python 2.7
+- python-pip
+- robotframework
+- robotframework-selenium2library
+- Web-Browser (firefox, google-chrome or chromium)
+- chromedriver
+- google-chrome / chromium / firefox
+
+Installation
+============
+Refer and run
+If you are on Debian or Ubuntu please run
+./install-on-debian.sh
+
+Basic Usage
+===========
+robot chrome-test.robot
+robot chromium-test.robot
+robot firefox-test.robot
+robot login-lava.robot
+robot youtube-play-bkk16.robot
+robot youtube-play.robot
+
+Run all tests in the current directory
+python -m robot .
diff --git a/chrome-test.robot b/chrome-test.robot
new file mode 100644
index 0000000..4ceb6e8
--- /dev/null
+++ b/chrome-test.robot
@@ -0,0 +1,14 @@
+*** Settings ***
+Library Selenium2Library
+
+*** Variables ***
+
+*** Test Cases ***
+open the browser
+ [Documentation] Test program to open and close browser
+ [Tags] smoketest
+ Open Browser http://www.linaro.org chrome
+ sleep 5s
+ Close Browser
+
+*** Keywords ***
diff --git a/chromium-test.robot b/chromium-test.robot
new file mode 100644
index 0000000..4ceb6e8
--- /dev/null
+++ b/chromium-test.robot
@@ -0,0 +1,14 @@
+*** Settings ***
+Library Selenium2Library
+
+*** Variables ***
+
+*** Test Cases ***
+open the browser
+ [Documentation] Test program to open and close browser
+ [Tags] smoketest
+ Open Browser http://www.linaro.org chrome
+ sleep 5s
+ Close Browser
+
+*** Keywords ***
diff --git a/firefox-test.robot b/firefox-test.robot
new file mode 100644
index 0000000..7a88025
--- /dev/null
+++ b/firefox-test.robot
@@ -0,0 +1,14 @@
+*** Settings ***
+Library Selenium2Library
+
+*** Variables ***
+
+*** Test Cases ***
+open the browser
+ [Documentation] Test program to open and close browser
+ [Tags] smoketest
+ Open Browser http://www.linaro.org firefox
+ sleep 5s
+ Close Browser
+
+*** Keywords ***
diff --git a/install-on-debian.sh b/install-on-debian.sh
new file mode 100755
index 0000000..bcfd88a
--- /dev/null
+++ b/install-on-debian.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+# pre-requirements
+prerequirements () {
+ sudo apt-get install -y python2.7
+ sudo apt-get install -y python-pip
+ sudo pip install robotframework
+ sudo pip install robotframework-selenium2library
+}
+
+# For x86_64
+install_chromedriver_x86_64 () {
+ wget http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip
+ unzip chromedriver_linux64.zip
+ sudo cp chromedriver /usr/bin/
+ exit 0
+}
+
+install_chromedriver_x86 () {
+ wget http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux32.zip
+ unzip chromedriver_linux32.zip
+ sudo cp chromedriver /usr/bin/
+ exit 0
+}
+
+# For aarch64
+install_chromedriver_aarch64 () {
+ google_chrome_softlink
+ sudo apt-get install chromedriver
+ export PATH=/usr/lib/chromium/:$PATH
+ echo "export PATH=/usr/lib/chromium/:$PATH" >> ~/.bashrc
+ exit 0
+}
+
+# In case of 96boards we pre install chromium
+# Officially chromium not supported by robot framework.
+# Made a soft link as google-chrome from chromium.
+# In the test case we have to mention browser name as chrome.
+google_chrome_softlink () {
+ cd /usr/bin/
+ sudo ln -sf chromium google-chrome
+ cd -
+}
+
+prerequirements
+install_chromedriver_`arch`
+if [ $? -ne 0 ]; then
+ echo "Not supported Architecture `arch`"
+ echo "install-on-debian.sh : failed"
+ exit 1
+fi
diff --git a/login-lava.robot b/login-lava.robot
new file mode 100644
index 0000000..9e92667
--- /dev/null
+++ b/login-lava.robot
@@ -0,0 +1,34 @@
+*** Settings ***
+Library Selenium2Library
+
+*** Variables ***
+#TODO: replace firstname.lastname and passwd with your lava login credentials
+${Username} firstname.lastname
+${Password} passwd
+${Browser} chrome
+${SiteUrl} https://validation.linaro.org/accounts/login/
+${Delay} 5s
+
+*** Test Cases ***
+LoginTest
+ Open Browser to the Login Page
+ Enter User Name
+ Enter Password
+ Click Login
+ sleep ${Delay}
+ Assert Dashboard Title
+ [Teardown] Close Browser
+
+*** Keywords ***
+Open Browser to the Login Page
+ open browser ${SiteUrl} ${Browser}
+ Maximize Browser Window
+
+Enter User Name
+ Input Text id_username ${Username}
+
+Enter Password
+ Input Text id_password ${Password}
+
+Click Login
+ click button Login
diff --git a/youtube-play-bkk16.robot b/youtube-play-bkk16.robot
new file mode 100644
index 0000000..f0411fb
--- /dev/null
+++ b/youtube-play-bkk16.robot
@@ -0,0 +1,23 @@
+*** Settings ***
+Library Selenium2Library
+
+*** Variables ***
+${Browser} chrome
+${SiteUrl} https://youtu.be/HpvZ2HwL4zI
+${DashboardTitle} Linaro Connect BKK16 - Welcome and Introduction - YouTube
+${Delay} 10s
+
+*** Test Cases ***
+LoginTest
+ Open Browser to the Login Page
+ sleep ${Delay}
+ Assert Dashboard Title
+ [Teardown] Close Browser
+
+*** Keywords ***
+Open Browser to the Login Page
+ open browser ${SiteUrl} ${Browser}
+ Maximize Browser Window
+
+Assert Dashboard Title
+ Title Should be ${DashboardTitle}
diff --git a/youtube-play.robot b/youtube-play.robot
new file mode 100644
index 0000000..a344c36
--- /dev/null
+++ b/youtube-play.robot
@@ -0,0 +1,19 @@
+*** Settings ***
+Library Selenium2Library
+
+*** Variables ***
+${Browser} chrome
+${SiteUrl} https://youtu.be/HpvZ2HwL4zI
+${DashboardTitle} Linaro Connect BKK16 - Welcome and Introduction - YouTube
+${Delay} 10s
+
+*** Test Cases ***
+LoginTest
+ Open Browser to the Login Page
+ sleep ${Delay}
+ [Teardown] Close Browser
+
+*** Keywords ***
+Open Browser to the Login Page
+ open browser ${SiteUrl} ${Browser}
+ Maximize Browser Window