From 7bb85ae749227494c8c1bee9f1c471f1ffd5e3e2 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 29 May 2024 16:18:38 +0200 Subject: [PATCH 1/4] feat: Add basic syntax with a runnable example --- code-examples/my_first_test/MyFirstTest.robot | 9 ++++ code-examples/my_first_test/config.json | 12 +++++ .../docs/getting_started/how_to_write_rf.mdx | 47 +++++++++++++++++++ website/docs/getting_started/ide.mdx | 36 +++++++------- website/docs/getting_started/videos.mdx | 14 +++--- 5 files changed, 93 insertions(+), 25 deletions(-) create mode 100644 code-examples/my_first_test/MyFirstTest.robot create mode 100644 code-examples/my_first_test/config.json create mode 100644 website/docs/getting_started/how_to_write_rf.mdx diff --git a/code-examples/my_first_test/MyFirstTest.robot b/code-examples/my_first_test/MyFirstTest.robot new file mode 100644 index 00000000..df0b7ad0 --- /dev/null +++ b/code-examples/my_first_test/MyFirstTest.robot @@ -0,0 +1,9 @@ +*** Settings *** +Library SeleniumLibrary + +*** Test Cases *** +Open Browser And Go To Homepage + [Documentation] This test case opens the browser and navigates to the homepage of Robot Framework. + Open Browser chrome + Go To https://www.robotframework.org + Title Should Be Robot Framework \ No newline at end of file diff --git a/code-examples/my_first_test/config.json b/code-examples/my_first_test/config.json new file mode 100644 index 00000000..36f38fb1 --- /dev/null +++ b/code-examples/my_first_test/config.json @@ -0,0 +1,12 @@ +{ + "name": "MyFirstTest", + "description": "readme.md", + "requirements": [ + "robotframework" + ], + "files": [ + { + "fileName": "MyFirstTest.robot" + } + ] +} diff --git a/website/docs/getting_started/how_to_write_rf.mdx b/website/docs/getting_started/how_to_write_rf.mdx new file mode 100644 index 00000000..f23b132f --- /dev/null +++ b/website/docs/getting_started/how_to_write_rf.mdx @@ -0,0 +1,47 @@ +--- +sidebar_position: 3 +sidebar_label: Writing Your First Test +title: Writing Your First Test +description: The beginnings of the robot framework syntax +tags: + - beginner + - syntax +--- +import CodeBlock from '@theme/CodeBlock'; + +# Writing Your First Test +Robot Framework is a versatile and powerful test automation framework that uses plain text syntax. It is designed to be easy to read and write, making it accessible to both technical and non-technical users. In this guide, we’ll cover the basics of Robot Framework syntax to get you started. + +## File name +You can name your files anything you like, as long as they have the .robot extension. For example: 'MyFirstTest.robot'. + +## Sections +A Robot Framework test suite consists of multiple test cases organized within a single file. The basic structure of a test suite file includes the following sections: + +1. Settings +1. Test Cases/Tasks +{/* Ìf more content is added, the titles above should get deeplinks */} +Although there are additional sections available, the Test Cases/Tasks section is mandatory for running a test. +### Settings +The Settings section is where you define the libraries, resource files, and other settings needed for your test suite. +```robotframework +*** Settings *** +Library SeleniumLibrary +``` + +The libraries contain the keywords (functions) that Robot Framework uses to execute tests. Each library includes documentation of the keywords it provides. To use these, importing the library is necessary. + +### Test Cases/Tasks +The Test Cases or Tasks section is where you define your individual test cases/tasks. Each test case/task is a sequence of keywords (actions). + +```robotframework +*** Test Cases *** +Open Browser And Go To Homepage + [Documentation] This test case opens the browser and navigates to the homepage of Robot Framework. + Open Browser chrome + Go To https://www.robotframework.org + Title Should Be Robot Framework +``` + +## Everything together + \ No newline at end of file diff --git a/website/docs/getting_started/ide.mdx b/website/docs/getting_started/ide.mdx index 26607d96..ceb7ec29 100644 --- a/website/docs/getting_started/ide.mdx +++ b/website/docs/getting_started/ide.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 4 sidebar_label: Set up your IDE title: Set up your IDE description: Install an IDE and Extensions for code-completion and debugging @@ -28,8 +28,8 @@ import { ## Install IDE and Extensions -Several IDEs and Code Editors support the development of Robot Framework tests. -The support ranges from simple code-highlighting, code-completion to test execution and debugging. +Several IDEs and Code Editors support the development of Robot Framework tests. +The support ranges from simple code-highlighting, code-completion to test execution and debugging. We list several IDEs and Extensions here, but there are many more. ### Visual Studio Code @@ -39,7 +39,7 @@ It provides extensions for a lot of different languages and technologies. ![VS Code](/img/vscode_site.png) -Popular extensions for Robot Framework: +Popular extensions for Robot Framework: - [Robot Code](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode) - [Robot Framework Language Server](https://marketplace.visualstudio.com/items?itemName=robocorp.robotframework-lsp) @@ -60,7 +60,7 @@ See the [VS Code setup guide](https://code.visualstudio.com/docs/setup/setup-ove -1. Open a terminal +1. Open a terminal 2. Execute `sudo snap install code --classic` 3. Start Visual Studio Code by executing `code` @@ -69,7 +69,7 @@ See the [VS Code setup guide](https://code.visualstudio.com/docs/setup/setup-ove 1. Download the deb package from [Visual Studio Code](https://code.visualstudio.com/download) 2. Open a terminal -3. Type `sudo dpkg -i ` +3. Type `sudo dpkg -i ` e.g. `sudo dpkg -i ~/Downloads/code_1.65.2-1646927742_amd64.deb` 4. Start Visual Studio Code by executing `code` @@ -78,7 +78,7 @@ e.g. `sudo dpkg -i ~/Downloads/code_1.65.2-1646927742_amd64.deb` 1. Download the rpm package from [Visual Studio Code](https://code.visualstudio.com/download) 2. Open a terminal -3. Type `sudo rpm -i ` +3. Type `sudo rpm -i ` e.g. `sudo rpm -i ~/Downloads/code-1.65.2-1646927812.el7.x86_64.rpm` 4. Start Visual Studio Code by executing `code` @@ -88,7 +88,7 @@ e.g. `sudo rpm -i ~/Downloads/code-1.65.2-1646927812.el7.x86_64.rpm` #### Visual Studio Code Extensions -:::caution +:::caution Make sure that only a **single** Robot Framework extension is installed. ::: @@ -149,13 +149,13 @@ Make sure that only one single Robot Framework extension is installed. 2. Select `Plugins` 3. Select the `Marketplace` tab 4. Search for `Robot Framework Language Server` and click on `Install` -5. Add a Debug Configuration for Robot Framework to run current test suite -![Debug Config Current Test Suite](/img/getting_started/pycharm_conf_current_suite.png) +5. Add a Debug Configuration for Robot Framework to run current test suite +![Debug Config Current Test Suite](/img/getting_started/pycharm_conf_current_suite.png) 6. Add a Debug Configuration for Robot Framework to run current test case (via selected text) ![Debug Config Current Test Case](/img/getting_started/pycharm_conf_selected_test.png) -## Run and Debug Robot Framework Tests +## Run and Debug Robot Framework Tests ### Visual Studio Code with RobotCode @@ -163,21 +163,21 @@ Make sure that only one single Robot Framework extension is installed. ![Run Tests](/img/getting_started/VSC_RBTCD_running_tests.gif) #### Debug -Add a breakpoint to your test suite or resource file, by clicking on the left-hand side of the line. +Add a breakpoint to your test suite or resource file, by clicking on the left-hand side of the line. ![Breakpoint](/img/VSC_AddBreakpoint.png) -Right-Click on the `Play` button +Right-Click on the `Play` button ![Play Button](/img/VSC_RBTCD_PlayBtn.png) -Select `Debug Test` from the context menu. -Test Execution will begin and stop at the breakpoint. +Select `Debug Test` from the context menu. +Test Execution will begin and stop at the breakpoint. ![Debug Test](/img/VSC_RBTCD_Debug.png) -Use `Debug Toolbar` to select actions like step over, step into, step out, continue, pause, etc. +Use `Debug Toolbar` to select actions like step over, step into, step out, continue, pause, etc. ![Debug Toolbar](/img/VSC_DebugToolbar.png) -Run Robot Frameworm commands while debugging from `Debug Console`. -Commands needs to start with `! ` +Run Robot Frameworm commands while debugging from `Debug Console`. +Commands needs to start with `! ` ![Debug Console](/img/VSC_RBTCD_executeDebugCommands.png) ### PyCharm with Robot Framework Language Server diff --git a/website/docs/getting_started/videos.mdx b/website/docs/getting_started/videos.mdx index b3353a56..4a5fb157 100644 --- a/website/docs/getting_started/videos.mdx +++ b/website/docs/getting_started/videos.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 5 sidebar_label: Videos title: Videos and Tutorials description: Videos and Tutorials @@ -7,7 +7,7 @@ description: Videos and Tutorials ## Official Robot Framework Tutorial -The official Robot Framework tutorial video presented by the Robot Framework creator **Pekka Klärck**. +The official Robot Framework tutorial video presented by the Robot Framework creator **Pekka Klärck**. New videos will be added to this playlist in the future. [Official Robot Framework Tutorial](https://youtube.com/playlist?list=PLSK6YK5OGX1AuQy0tbvdKBV9mrKi46kKH) @@ -20,23 +20,23 @@ New videos will be added to this playlist in the future. This channel is dedicated to those who want to start automating with Robot Framework but also to those who are already using this tool and want to find out new tips and tricks they might have missed. -[Robot Framework Tutorials Channel](https://www.youtube.com/@RobotFrameworkTutorials) +[Robot Framework Tutorials Channel](https://www.youtube.com/@RobotFrameworkTutorials) --- -[Complete Robot Framework Tutorial](https://www.youtube.com/playlist?list=PL4GZKvvcjS3u9FP3F9zW4ZbZB8pti2k37) +[Complete Robot Framework Tutorial](https://www.youtube.com/playlist?list=PL4GZKvvcjS3u9FP3F9zW4ZbZB8pti2k37) --- -[Web Automation With Robot Framework](https://www.youtube.com/playlist?list=PL4GZKvvcjS3sRKidOUNVQSR3aq7TEQglp) +[Web Automation With Robot Framework](https://www.youtube.com/playlist?list=PL4GZKvvcjS3sRKidOUNVQSR3aq7TEQglp) --- -[Mobile Automation With Robot Framework And Appium](https://www.youtube.com/playlist?list=PL4GZKvvcjS3vAPWLqWbKZogkL5cD71yrT) +[Mobile Automation With Robot Framework And Appium](https://www.youtube.com/playlist?list=PL4GZKvvcjS3vAPWLqWbKZogkL5cD71yrT) @@ -46,6 +46,6 @@ This channel is dedicated to those who want to start automating with Robot Frame Test Automation University is a free, online learning platform for software testers and developers. It is a community-driven project that is supported by the community. The goal of Test Automation University is to provide free, high-quality, and up-to-date training for software testers and developers. -[Introduction To Robot Framework](https://testautomationu.applitools.com/robot-framework-tutorial/) +[Introduction To Robot Framework](https://testautomationu.applitools.com/robot-framework-tutorial/) From fb838a74bf8811bf55da7aff9866f1aa2400acae Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 31 May 2024 11:17:00 +0200 Subject: [PATCH 2/4] feat: change test to use String library Add indentation section Rename page to Code instead of Test --- code-examples/core/bdd-syntax/config.json | 2 +- code-examples/my_first_test/MyFirstTest.robot | 11 ++-- .../docs/getting_started/how_to_write_rf.mdx | 49 ++++++++++---- website/docs/index.mdx | 64 ++++++++++--------- 4 files changed, 77 insertions(+), 49 deletions(-) diff --git a/code-examples/core/bdd-syntax/config.json b/code-examples/core/bdd-syntax/config.json index 2ae1c660..3191beed 100644 --- a/code-examples/core/bdd-syntax/config.json +++ b/code-examples/core/bdd-syntax/config.json @@ -2,7 +2,7 @@ "name": "BDD Syntax", "description": "readme.md", "requirements": [ - "robotframework==6.0", + "robotframework==7.0", "robotframework-stacktrace", "robotframework-retryfailed" ], diff --git a/code-examples/my_first_test/MyFirstTest.robot b/code-examples/my_first_test/MyFirstTest.robot index df0b7ad0..14080cd3 100644 --- a/code-examples/my_first_test/MyFirstTest.robot +++ b/code-examples/my_first_test/MyFirstTest.robot @@ -1,9 +1,8 @@ *** Settings *** -Library SeleniumLibrary +Library String *** Test Cases *** -Open Browser And Go To Homepage - [Documentation] This test case opens the browser and navigates to the homepage of Robot Framework. - Open Browser chrome - Go To https://www.robotframework.org - Title Should Be Robot Framework \ No newline at end of file +Create A Random String + Log To Console We are going to generate a random string + ${random_string} Generate Random String 10 + Log To Console We finished generating a random string \ No newline at end of file diff --git a/website/docs/getting_started/how_to_write_rf.mdx b/website/docs/getting_started/how_to_write_rf.mdx index f23b132f..9c1b6502 100644 --- a/website/docs/getting_started/how_to_write_rf.mdx +++ b/website/docs/getting_started/how_to_write_rf.mdx @@ -1,7 +1,7 @@ --- sidebar_position: 3 -sidebar_label: Writing Your First Test -title: Writing Your First Test +sidebar_label: Writing Your First Code +title: Writing Your First Code description: The beginnings of the robot framework syntax tags: - beginner @@ -9,7 +9,7 @@ tags: --- import CodeBlock from '@theme/CodeBlock'; -# Writing Your First Test +# Writing Your First Code Robot Framework is a versatile and powerful test automation framework that uses plain text syntax. It is designed to be easy to read and write, making it accessible to both technical and non-technical users. In this guide, we’ll cover the basics of Robot Framework syntax to get you started. ## File name @@ -26,22 +26,45 @@ Although there are additional sections available, the Test Cases/Tasks section i The Settings section is where you define the libraries, resource files, and other settings needed for your test suite. ```robotframework *** Settings *** -Library SeleniumLibrary +Library String ``` -The libraries contain the keywords (functions) that Robot Framework uses to execute tests. Each library includes documentation of the keywords it provides. To use these, importing the library is necessary. +The libraries contain the keywords (functions/steps) that Robot Framework uses to execute tests. Each library includes documentation of the keywords it provides. To use these, importing the library is necessary. ### Test Cases/Tasks -The Test Cases or Tasks section is where you define your individual test cases/tasks. Each test case/task is a sequence of keywords (actions). - +The Test Cases or Tasks section is where you define your individual test cases/tasks. Each test case/task is a sequence of keywords. These keywords determine the steps or actions that your test or task performs. There is no limit to the number of steps a testcase can have, but there are good practices and it is good to create conventions with your co-workers to ensure readability. ```robotframework *** Test Cases *** -Open Browser And Go To Homepage - [Documentation] This test case opens the browser and navigates to the homepage of Robot Framework. - Open Browser chrome - Go To https://www.robotframework.org - Title Should Be Robot Framework +Create A Random String + Log To Console We are going to generate a random string + Generate Random String 10 + Log To Console We finished generating a random string ``` +## Indentation +You can see in the provided examples that Robot Framework code is separated by spaces. To be able to correctly differentiate Robot Framework needs **at least 2 spaces**. A few examples that you can see in the code we have seen until now: +```robotframework +Library String +``` +- `Library` in the Settings section is unindented. This indicates that `Library` is the setting we are declaring. +- Between `Library` and `String` are several spaces. This indicates that `String` is a library that we need for our tests. + +```robotframework +Create A Random String + Log To Console We are going to generate a random string + Generate Random String 10 + Log To Console We finished generating a random string +``` +- `Create A Random String` in the Test Cases section is unindented. This indicates that it is a testcase name +- The lines below `Create A Random String` are indented. Indicating that these are keywords that we use in our testcase +- Between `Generate Random String` and `10` are several spaces. This indicates that 10 is an argument for our keyword, meaning our random string will be 10 characters long. +- Our `Log To Console` keywords are followed by a few spaces and a sentence. The spaces ensure that the following sentence is the text that we want to log to our console. + +So you can see that spacing and indentation is extremely important in Robot Framework. It is neccesary to show the difference between a keyword and arguments that we use in our keywords. And also to differentiate between our test names and the keywords of our test. +Remember, to be able to correctly differentiate Robot Framework needs at least 2 spaces. More is also allowed. In the [Style Guide](../style_guide.md#horizontal-spacing) you can find more about conventions regarding spacing. ## Everything together - \ No newline at end of file + + + +{/* TODO: review newly added indentation text +TODO: add page on front page between RPA and IDE, same Icon as IDE */} \ No newline at end of file diff --git a/website/docs/index.mdx b/website/docs/index.mdx index 401469d6..dcebc63e 100644 --- a/website/docs/index.mdx +++ b/website/docs/index.mdx @@ -36,31 +36,37 @@ import VideoIcon from '/icons/video.svg'; ![Docusaurus themed image](/img/rf_guides_light.svg#gh-light-mode-only) ![Docusaurus themed image](/img/rf_guides_dark.svg#gh-dark-mode-only) -We hope these guides will help you get started with Robot Framework **faster and easier**. +We hope these guides will help you get started with Robot Framework **faster and easier**. If you have any questions, please reach out to our awesome community on [Slack](https://slack.robotframework.org/).
+ icon={} description="How to set up Robot Framework for testing" to="/docs/getting_started/testing" /> + icon={} description="How to set up Robot Framework for Robotic Process Automation (RPA)" to="/docs/getting_started/rpa" /> + } + description="How To Write Robot Framework Code" + to="/docs/getting_started/how_to_write_rf" + /> + icon={} description="Install and set up your IDE for coding and debugging" to="/docs/getting_started/ide" /> + icon={} description="Check out the video tutorials" to="/docs/getting_started/videos" /> @@ -69,37 +75,37 @@ If you have any questions, please reach out to our awesome community on [Slack](
+ icon={} description="A list of different libraries available for Robot Framework" to="/docs/different_libraries/overview" /> + icon={} description="How to choose the right library for your use case" to="/docs/different_libraries/how_to_find_library" /> + icon={} description="Automate Web Applications" to="/docs/different_libraries/browser" /> + icon={} description="Automate Web Applications" to="/docs/different_libraries/selenium" /> + icon={} description="Automate APIs" to="/docs/different_libraries/requests" /> + icon={} description="Libraries for Robotic Process Automation (RPA)" to="/docs/different_libraries/rpa" /> @@ -108,37 +114,37 @@ If you have any questions, please reach out to our awesome community on [Slack](
+ icon={} description="A list of examples for Robot Framework" to="/docs/examples/overview" /> + icon={} description="How to organize your test/rpa project" to="/docs/examples/project_structure" /> + icon={} description="An vehicle insurance calculator web app that requires user inputs in multiple screens" to="/docs/examples/insurance" /> + icon={} description="A simple todo app built in different frameworks and automated using Browser Library" to="/docs/examples/todo" /> + icon={} description="A room booking app with a REST API" to="/docs/examples/restfulbooker" /> + icon={} description="A Login page which requires a two-factor authentication with a TOTP code" to="/docs/examples/mfa_login" /> @@ -147,67 +153,67 @@ If you have any questions, please reach out to our awesome community on [Slack](
+ icon={} description="Docker Images which can be used for testing" to="/docs/using_rf_in_ci_systems/docker" /> + icon={} description="Examples for different CI Systems" to="/docs/using_rf_in_ci_systems/ci" />
- +
+ icon={} description="How to create your own library in Python" to="/docs/extending_robot_framework/custom-libraries/python_library" /> + icon={} description="How to package and release your own custom library" to="/docs/extending_robot_framework/custom-libraries/releasing_your_own_libraries" /> + icon={} description="How to parse test results with the Result Visitor API" to="/docs/parsing_results" /> + icon={} description="Hook into the Robot Framework execution process" to="/docs/extending_robot_framework/listeners_prerun_api/listeners" /> + icon={} description="Interact with and modify the RF Model before the execution process" to="/docs/extending_robot_framework/listeners_prerun_api/prerunmodifier" /> + icon={} description="Interact with the RF API to create new solutions and integrations" to="/docs/extending_robot_framework/listeners_prerun_api/rf-api" />
- +
+ icon={} description="Who we are and what we do" to="/docs/about/about_us" /> + icon={} description="How to join and support us" to="/docs/about/contribute" /> From c430294c017e2872be2ce50d050aad244b942adb Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 5 Jun 2024 19:41:31 +0200 Subject: [PATCH 3/4] feat: updated writing your first code --- code-examples/my_first_test/MyFirstTest.robot | 2 +- .../docs/getting_started/how_to_write_rf.mdx | 57 +++++++++++++------ website/docs/getting_started/ide.mdx | 2 +- 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/code-examples/my_first_test/MyFirstTest.robot b/code-examples/my_first_test/MyFirstTest.robot index 14080cd3..aee48d6e 100644 --- a/code-examples/my_first_test/MyFirstTest.robot +++ b/code-examples/my_first_test/MyFirstTest.robot @@ -4,5 +4,5 @@ Library String *** Test Cases *** Create A Random String Log To Console We are going to generate a random string - ${random_string} Generate Random String 10 + Generate Random String 10 Log To Console We finished generating a random string \ No newline at end of file diff --git a/website/docs/getting_started/how_to_write_rf.mdx b/website/docs/getting_started/how_to_write_rf.mdx index 9c1b6502..f65a8454 100644 --- a/website/docs/getting_started/how_to_write_rf.mdx +++ b/website/docs/getting_started/how_to_write_rf.mdx @@ -1,17 +1,25 @@ --- -sidebar_position: 3 +sidebar_position: 4 sidebar_label: Writing Your First Code title: Writing Your First Code -description: The beginnings of the robot framework syntax +description: The beginnings of the Robot Framework syntax tags: - beginner - syntax --- import CodeBlock from '@theme/CodeBlock'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Writing Your First Code -Robot Framework is a versatile and powerful test automation framework that uses plain text syntax. It is designed to be easy to read and write, making it accessible to both technical and non-technical users. In this guide, we’ll cover the basics of Robot Framework syntax to get you started. +Robot Framework is a versatile and powerful automation framework that uses plain text syntax. It is designed to be easy to read and write, making it accessible to both technical and non-technical users. In this guide, we’ll cover the basics of Robot Framework syntax to get you started. +
+ +:::note +In this guide, we will primarily focus on testing, specifically Test Cases and Test Suites. The same principles also apply when discussing RPA Tasks. +::: ## File name You can name your files anything you like, as long as they have the .robot extension. For example: 'MyFirstTest.robot'. @@ -19,9 +27,9 @@ You can name your files anything you like, as long as they have the .robot exten A Robot Framework test suite consists of multiple test cases organized within a single file. The basic structure of a test suite file includes the following sections: 1. Settings -1. Test Cases/Tasks +1. Test Cases {/* Ìf more content is added, the titles above should get deeplinks */} -Although there are additional sections available, the Test Cases/Tasks section is mandatory for running a test. +Although there are additional sections available, the Test Cases section is mandatory for running a test. ### Settings The Settings section is where you define the libraries, resource files, and other settings needed for your test suite. ```robotframework @@ -31,8 +39,10 @@ Library String The libraries contain the keywords (functions/steps) that Robot Framework uses to execute tests. Each library includes documentation of the keywords it provides. To use these, importing the library is necessary. -### Test Cases/Tasks -The Test Cases or Tasks section is where you define your individual test cases/tasks. Each test case/task is a sequence of keywords. These keywords determine the steps or actions that your test or task performs. There is no limit to the number of steps a testcase can have, but there are good practices and it is good to create conventions with your co-workers to ensure readability. +### Test Cases or Tasks +The Test Cases or Tasks section is where you define your individual test cases. Each test case/task is a sequence of keywords. These keywords determine the steps or actions that your test or task performs. There is no limit to the number of steps a testcase can have, but there are good practices and it is good to create conventions with your co-workers to ensure readability. + + ```robotframework *** Test Cases *** Create A Random String @@ -40,28 +50,39 @@ Create A Random String Generate Random String 10 Log To Console We finished generating a random string ``` - + + +```robotframework +*** Tasks *** +Create A Random String + Log To Console We are going to generate a random string + Generate Random String 10 + Log To Console We finished generating a random string +``` + + ## Indentation -You can see in the provided examples that Robot Framework code is separated by spaces. To be able to correctly differentiate Robot Framework needs **at least 2 spaces**. A few examples that you can see in the code we have seen until now: +In the provided examples, you can see that Robot Framework code is separated by spaces. To correctly differentiate elements, Robot Framework requires at least two spaces. Here are a few examples based on the code we've seen so far: ```robotframework +*** Settings *** Library String ``` -- `Library` in the Settings section is unindented. This indicates that `Library` is the setting we are declaring. -- Between `Library` and `String` are several spaces. This indicates that `String` is a library that we need for our tests. +- The `Library` keyword in the Settings section is unindented. This indicates that `Library` is the setting being declared. +- Between `Library` and `String`, there are several spaces. This indicates that `String` is the name of the library needed for our tests. ```robotframework +*** Test Cases *** Create A Random String Log To Console We are going to generate a random string - Generate Random String 10 + Generate Random String 10 Log To Console We finished generating a random string ``` -- `Create A Random String` in the Test Cases section is unindented. This indicates that it is a testcase name -- The lines below `Create A Random String` are indented. Indicating that these are keywords that we use in our testcase -- Between `Generate Random String` and `10` are several spaces. This indicates that 10 is an argument for our keyword, meaning our random string will be 10 characters long. -- Our `Log To Console` keywords are followed by a few spaces and a sentence. The spaces ensure that the following sentence is the text that we want to log to our console. +- `Create A Random String` in the Test Cases section is unindented, indicating that it is a test case name. +- The lines below `Create A Random String` are indented, showing that these are keywords used in the test case. +- Several spaces between `Generate Random String` and `10` indicate that `10` is an argument for the keyword, specifying that our random string will be 10 characters long. +- The `Log To Console` keywords are followed by a few spaces and a sentence. The spaces ensure that the following sentence is the text we want to log to our console. -So you can see that spacing and indentation is extremely important in Robot Framework. It is neccesary to show the difference between a keyword and arguments that we use in our keywords. And also to differentiate between our test names and the keywords of our test. -Remember, to be able to correctly differentiate Robot Framework needs at least 2 spaces. More is also allowed. In the [Style Guide](../style_guide.md#horizontal-spacing) you can find more about conventions regarding spacing. +You can see that spacing and indentation are extremely important in Robot Framework. They are necessary to distinguish between a keyword and its arguments, as well as to differentiate between test names and the keywords within the tests. Remember, Robot Framework needs at least two spaces to correctly differentiate elements. More spaces are also allowed. For more details on spacing conventions, refer to the [Style Guide](../style_guide.md#horizontal-spacing). ## Everything together diff --git a/website/docs/getting_started/ide.mdx b/website/docs/getting_started/ide.mdx index ceb7ec29..4ef934c2 100644 --- a/website/docs/getting_started/ide.mdx +++ b/website/docs/getting_started/ide.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 3 sidebar_label: Set up your IDE title: Set up your IDE description: Install an IDE and Extensions for code-completion and debugging From ce6214886ea763005740f79dfdf1ad70283039d4 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 5 Jun 2024 20:29:04 +0200 Subject: [PATCH 4/4] feat: move the Your First Code card behind IDE --- website/docs/index.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/index.mdx b/website/docs/index.mdx index dcebc63e..2a6daba5 100644 --- a/website/docs/index.mdx +++ b/website/docs/index.mdx @@ -52,18 +52,18 @@ If you have any questions, please reach out to our awesome community on [Slack]( description="How to set up Robot Framework for Robotic Process Automation (RPA)" to="/docs/getting_started/rpa" /> - } - description="How To Write Robot Framework Code" - to="/docs/getting_started/how_to_write_rf" - /> } description="Install and set up your IDE for coding and debugging" to="/docs/getting_started/ide" /> + } + description="How To Write Robot Framework Code" + to="/docs/getting_started/how_to_write_rf" + /> }