Skip to content

Latest commit

 

History

History
110 lines (75 loc) · 4.19 KB

README.md

File metadata and controls

110 lines (75 loc) · 4.19 KB

Sessions

Switch branch to see contents of each session

Install Python

Following the wiki

Refer to: https://docs.robotframework.org/docs/getting_started/testing#install-python

Install common test library

Check out the repository test-automation-fwk-python for common test library source. Clone the library repository to local in same level with this test repository.

Follow steps to build and install the common test library

As the instruction, you are able to install the common test library in the global environment or in the in-project virtualenv.

With using in-project virtualenv in test-automation-fwk-python. Needs to activate the virtualenv before running tests in this repo.

../test-automation-fwk-python/.venv/Scripts/activate

Based the environment you selected and install the common test library, you can proceed to the next steps to execute test. Ensure can check Robot Framework version by running the command:

robot --version

Run tests

Note: ensure the terminal is in the root directory of the project

Demo1: Execute simple test using Standard Library

robot --include demo1 --outputdir reports ./tests

--outputdir defines where to create output files (log.html, output.xml, report.html)

Demo2: Execute simple test using open-source External Library is installed by pip

robot --include demo2 --outputdir reports ./tests

Demo3: Execute simple test using custom External Library is implemented by Python with static API

robot --include demo3 --outputdir reports ./tests

--pythonpath additional locations to add to the module search path

Demo4: Execute simple test using custom External Library is implemented by Python with dynamic API

robot --include demo4 --outputdir reports ./tests

Demo5: Execute simple test using custom External Library is implemented by Python with hybrid API

robot --include demo5 --outputdir reports ./tests

Demo6: Execute all tests in previous demos in a single execution

robot --include session2 --outputdir reports ./tests

Autoformatting Robot Framework code

You are able to use any IDE to work with Robot Framework code, while compose the code you may not always can keep the format or indent consistent. robotidy is a tool to help you format the code once you have done.

robotidy is tool for cleaning up and changing format of Robot Framework test data files

Mandatory argument is the path to file or a directory to format. If a directory is given, all files inside it are processed recursively.

robotidy ./tests