From 0128e68a75ba255170c00edd48dcaa71bd98a746 Mon Sep 17 00:00:00 2001 From: Eemi Narhi Date: Thu, 6 Feb 2020 17:49:57 +0200 Subject: [PATCH 1/3] Added new content to page --- .gitignore | 3 - README.md | 65 +- Results/log.html | 2125 +++++++++++++++++++++++++++++++++++++ Results/output.xml | 29 + Results/report.html | 2431 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 4645 insertions(+), 8 deletions(-) create mode 100644 Results/log.html create mode 100644 Results/output.xml create mode 100644 Results/report.html diff --git a/.gitignore b/.gitignore index bf67639..ac4c39c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -output.xml -report.html -log.html new_file.txt .DS_Store \ No newline at end of file diff --git a/README.md b/README.md index 2c43b3d..c5027f6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,18 @@ # Beginners Guide to Robot Framework +Table of contents: + +- [Introduction](#introduction) +- [Installation](#installation) + - [Troubleshooting installation](#troubleshooting-installation) + - [Selecting code editor](#selecting-code-editor) +- [Writing a first automation case](#writing-a-first-automation-case) +- [Viewing test results](#viewing-test-results) +- [Content of the test case](#content-of-the-test-case) +- [Variables](#variables) +- [Keywords](#keywords) +- [More information](#more-information) + ## Introduction Hello! So you want to learn Robot Framework? This guide is everything you need for getting started! You don’t need any previous experience in test automation to use this guide. You will learn how to install Robot Framework on your computer and get started building cool automation. @@ -52,19 +65,19 @@ Following example shows how to write your first robot automation case: My First Robot Test Log To Console Hello Robot World! ``` -4. First test is now ready and it should look like this: +First test is now ready and it should look like this: ``` *** Test Cases *** My First Robot Test Log To Console Hello Robot World! ``` -5. Open Terminal/Command Prompt. Navigate to the same folder where your `.robot` file is located and run the test by inputting command `robot my_first.robot`. For example: +4. Open Terminal/Command Prompt. Navigate to the same folder where your `.robot` file is located and run the test by inputting command `robot my_first.robot`. For example: ``` cd your_folder robot my_first.robot ``` -6. When Robot is run, you will see this: +6. When Robot is run, you will see the results: ``` > robot my_first.robot ============================================================================== @@ -82,10 +95,52 @@ Log: /log.html Report: /report.html ``` -Robot has created test report files in the same folder where you run the test. You can check details of the first test run by opening report.html file. +Congratulations! You have now run your first test case. Robot has created test report files in the same folder where you run the test. -[Examples](./Examples) of this manual introduces Keyword Libraries and Variables related to Robot Framework automation. +## Viewing test results +You can check details of the first test run by opening report.html file. + +Running the demo generates the following three result files. These files are linked to pre-executed files available online, but executing the demo creates them locally. + +[report.html](./Results/report.html) - Higher level test report. + +[log.html](./Results/log.html) - Detailed test execution log. + +[output.xml](./Results/output.xml) - Results in machine readable XML format. + +## Content of the test case +​ +Test cases are created from keywords that are ready made or user written. An example of a keyword is `Log To Console`, which you used in your first automation case. That keyword was part of the Robot Framework. There is a wide selection of other libraries [available](https://robotframework.org/#libraries), which you can use based on your needs. + +Your next automation case will show how to add libries to `Settings` section of your Robot file. +1. Let's add an Operating Systems library to our next example: +``` +*** Settings *** +Library OperatingSystem +``` +Your second test is now ready and it should look like this. This test will create a new file called new_file.txt: +``` +*** Settings *** +Library OperatingSystem + +***Test Cases*** + +My Second Robot Test + Create File new_file.txt Hello World! +``` +2. Run the Robot like in the previous test. +After running the Robot the new_file.txt should contain the text `Hello World!`. + +## Variables +- TODO: variables -> Example how to use + +## Keywords +TODO: +- library keywords +- User keywords -> Link to quick start guide ## More information Thank you for visiting the Beginners Guide! Hope you enjoyed learning Robot Framework. More about writing test cases: [How To Write Good Test Cases](https://github.com/robotframework/HowToWriteGoodTestCases/blob/master/HowToWriteGoodTestCases.rst). + +[Examples](./Examples) of this manual introduces Keyword Libraries and Variables related to Robot Framework automation. diff --git a/Results/log.html b/Results/log.html new file mode 100644 index 0000000..6b49c47 --- /dev/null +++ b/Results/log.html @@ -0,0 +1,2125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Codestin Search App + + +
+

Opening Robot Framework log failed

+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Results/output.xml b/Results/output.xml new file mode 100644 index 0000000..4452c78 --- /dev/null +++ b/Results/output.xml @@ -0,0 +1,29 @@ + + + + + +Logs the given message to the console. + +Hello Robot World! + + + + + + + + + +Critical Tests +All Tests + + + + +My First + + + + + diff --git a/Results/report.html b/Results/report.html new file mode 100644 index 0000000..cb51349 --- /dev/null +++ b/Results/report.html @@ -0,0 +1,2431 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Codestin Search App + + +
+

Opening Robot Framework report failed

+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 93142cbda3d1a62668626565c486330a28dc171d Mon Sep 17 00:00:00 2001 From: Eemi Narhi Date: Thu, 6 Feb 2020 17:58:39 +0200 Subject: [PATCH 2/3] Fixed number list --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c5027f6..b5d70ea 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ My First Robot Test cd your_folder robot my_first.robot ``` -6. When Robot is run, you will see the results: +5. When Robot is run, you will see the results: ``` > robot my_first.robot ============================================================================== From ed2cd6ce6ef3dbd46a42ffbb9f922428220b2389 Mon Sep 17 00:00:00 2001 From: Laura Ojala Date: Wed, 12 Feb 2020 13:14:24 +0200 Subject: [PATCH 3/3] Fix Markdown style --- README.md | 61 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b5d70ea..87b58d3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Table of contents: - [Introduction](#introduction) - [Installation](#installation) - - [Troubleshooting installation](#troubleshooting-installation) + - [Troubleshooting installation](#troubleshooting-installation) - [Selecting code editor](#selecting-code-editor) - [Writing a first automation case](#writing-a-first-automation-case) - [Viewing test results](#viewing-test-results) @@ -20,19 +20,25 @@ Hello! So you want to learn Robot Framework? This guide is everything you need f ## Installation 1. First, check if your computer already has Python programming language. Open Terminal/Command Prompt and type in: -``` + +```bash python --version ``` + 2. If Python is not installed, download and install latest version from [Python Downloads](https://www.python.org/downloads/). If installing to Windows, check "Add Python to PATH" in the Python installer. 3. Restart the Terminal/Command Prompt program after Python installation. 4. Next, install Robot Framework. Type in to Terminal/Command Prompt: -``` + +```bash pip install robotframework ``` + If installation was succesful, this command prints robot version: -``` + +```bash robot --version ``` + Wow! Robot Framework is now ready to be used! ### Troubleshooting installation @@ -41,12 +47,15 @@ If command pip does not work, most probable reason is that Python is not found. Option 1: Add Python to PATH. Robot Framework's installation instructions include [in-depth instructions for modifying PATH](https://github.com/robotframework/robotframework/blob/master/INSTALL.rst#configuring-path). -Option 2: Or if you use Windows, run Python using command `py -m `: -``` +Option 2: Or if you use Windows, run Python using command `py -m`: + +```bash py -m pip install robotframework ``` + and for checking if installation was succesful: -``` + +```bash py -m robot --version ``` @@ -61,27 +70,34 @@ Following example shows how to write your first robot automation case: 1. Create a new file and save it using an extension `.robot`, for example, `my_first.robot` 2. Write in file `*** Test Cases ***`. This creates [section](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#test-data-sections) for test cases. 3. Type in following (note to add the four spaces before `Log To Console`) -``` + +```python My First Robot Test Log To Console Hello Robot World! ``` + First test is now ready and it should look like this: -``` + +```python *** Test Cases *** My First Robot Test Log To Console Hello Robot World! ``` + 4. Open Terminal/Command Prompt. Navigate to the same folder where your `.robot` file is located and run the test by inputting command `robot my_first.robot`. For example: -``` + +```bash cd your_folder robot my_first.robot ``` + 5. When Robot is run, you will see the results: -``` + +```bash > robot my_first.robot ============================================================================== -My First +My First ============================================================================== My First Robot Test Hello Robot World! My First Robot Test | PASS | @@ -94,10 +110,12 @@ Output: /output.xml Log: /log.html Report: /report.html -``` +``` + Congratulations! You have now run your first test case. Robot has created test report files in the same folder where you run the test. ## Viewing test results + You can check details of the first test run by opening report.html file. Running the demo generates the following three result files. These files are linked to pre-executed files available online, but executing the demo creates them locally. @@ -109,17 +127,21 @@ Running the demo generates the following three result files. These files are lin [output.xml](./Results/output.xml) - Results in machine readable XML format. ## Content of the test case -​ + Test cases are created from keywords that are ready made or user written. An example of a keyword is `Log To Console`, which you used in your first automation case. That keyword was part of the Robot Framework. There is a wide selection of other libraries [available](https://robotframework.org/#libraries), which you can use based on your needs. Your next automation case will show how to add libries to `Settings` section of your Robot file. + 1. Let's add an Operating Systems library to our next example: -``` + +```python *** Settings *** Library OperatingSystem ``` + Your second test is now ready and it should look like this. This test will create a new file called new_file.txt: -``` + +```python *** Settings *** Library OperatingSystem @@ -128,14 +150,19 @@ Library OperatingSystem My Second Robot Test Create File new_file.txt Hello World! ``` + 2. Run the Robot like in the previous test. + After running the Robot the new_file.txt should contain the text `Hello World!`. ## Variables -- TODO: variables -> Example how to use + +- TODO: variables -> Example how to use ## Keywords + TODO: + - library keywords - User keywords -> Link to quick start guide