{"action":"opened","issue":{"url":"https://api.github.com/repos/chuijiaolianying/robotx/issues/1","labels_url":"https://api.github.com/repos/chuijiaolianying/robotx/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/chuijiaolianying/robotx/issues/1/comments","events_url":"https://api.github.com/repos/chuijiaolianying/robotx/issues/1/events","html_url":"https://github.com/chuijiaolianying/robotx/issues/1","id":107835052,"number":1,"title":"doc","user":{"login":"chuijiaolianying","id":2087368,"avatar_url":"https://avatars.githubusercontent.com/u/2087368?v=3","gravatar_id":"","url":"https://api.github.com/users/chuijiaolianying","html_url":"https://github.com/chuijiaolianying","followers_url":"https://api.github.com/users/chuijiaolianying/followers","following_url":"https://api.github.com/users/chuijiaolianying/following{/other_user}","gists_url":"https://api.github.com/users/chuijiaolianying/gists{/gist_id}","starred_url":"https://api.github.com/users/chuijiaolianying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuijiaolianying/subscriptions","organizations_url":"https://api.github.com/users/chuijiaolianying/orgs","repos_url":"https://api.github.com/users/chuijiaolianying/repos","events_url":"https://api.github.com/users/chuijiaolianying/events{/privacy}","received_events_url":"https://api.github.com/users/chuijiaolianying/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-23T01:37:20Z","updated_at":"2015-09-23T01:37:20Z","closed_at":null,"body":"# RobotX\r\n\r\n---\r\n\r\n## What is\r\n\r\n- RobotX is a tool set for QE team automation development with [Robot Framework][RobotFramework]\r\n\r\n- RobotX can automatically, intelligently and dynamically partition all automated tests into multiple pcs, and each one of which can be executed in parallel. The execution can happen on different physical/virtual machines. More the partitions, less tests executed on each one. That means that if you have multiple PCs you can use them for a combined test run.\r\n\r\n- On the newest RobotX version, we'll use [Docker][Docker] containers as executed machines. [Docker][Docker] containers will be created and deleted after execution each time.\r\n\r\n- RobotX contains:\r\n\r\n  * Runner\r\n  * Generator\r\n  * Debugger\r\n  * Checker\r\n\r\n---\r\n\r\n## How to\r\n\r\n  robotx can be used in command-line and [Jenkins][Jenkins]\r\n\r\n- Comman-line Usage:\r\n\r\n  * `robotx <sub-command> [options] [args]`\r\n  * sub-commands:\r\n        - check: Check and validate Robot case and tag syntax\r\n        - debug: Debug Robot case, Keyword, Library\r\n        - generate: Create new project, new test suite, new resource file\r\n        - run:   Run project with or without jenkins, [TCMS][TCMS], Docker\r\n\r\n- `robotx run [option]`\r\n  * --tcms: Whether write result to tcms in real-time.\r\n      - robotx.core.nitrateclient.py\r\n  * --jenkins: Whether run project in jenkins or in local.\r\n      - robotx.core.paramshandler.py\r\n  * --distributed: Whether run project in multi PCs, or in single PC\r\n  * --docker: Whether run project in Docker containers\r\n      - robotx.core.dockerclient.py\r\n  * -c : set project cases_path\r\n  * -p: set project plan_id\r\n  * -r: set project run_id\r\n  * -t: select cases via case_tag\r\n  * --priorities: select cases via case_priorities\r\n  * --variable: dynamically set other_variables when run cases\r\n  * -m: set master_ip when run distributed\r\n  * -h: set slaves when run distributed\r\n  * -w: set slaves passwd. (because of fabric bug, all slaves pwd must as same\r\n\r\n- `robotx check [option]`\r\n  robotx.core.commands.check.py\r\n  * --tcms: Whether check cases for running with TCMS\r\n  * -c: set cases_path\r\n  * -p: set plan_id\r\n\r\n- `robotx generate [option]`\r\n  robotx.core.commands.generate.py\r\n  * -p: create new project\r\n  * -s: create new test suite file\r\n  * -r: create new test resource file\r\n  * -d: create and update case, resource and lib docs.\r\n\r\n- `robotx debug`\r\n  robotx.core.commands.debug.py\r\n\r\n---\r\n\r\n## Code\r\n\r\n### **Check**\r\n\r\n`robotx check [option]` : that's a very useful function for validating test data syntax after writing automation test scripts.\r\n\r\n```\r\nybian@ybian ~/w/t/t/D/c/01__webui (master) > robotx check -c 01__wiki_test.txt \r\n************************** Syntax Checking ***************************\r\n...\r\n===============================================================================\r\n| FAIL |:  Case 317462 demo show 4\r\n-------------------------------------------------------------------------------\r\nNo keyword with name 'And do non-exist keyword' found.\r\n=============================================================================== \r\n\r\n===============================================================================\r\n| FAIL |:  Case 384344 demo show 7\r\n-------------------------------------------------------------------------------\r\nNo keyword with name 'do no-exist keyword' found.\r\n=============================================================================== \r\n\r\n\r\n( No news is good news:) )\r\nchecing result is in the file: /tmp/stdout.txt\r\n******************************** DONE ********************************\r\n\r\n```\r\n\r\nThere is an option when run Robot Framework: --dryrun. Dryrun will verify test data and runs tests so that library keywords are not executed. So that could be used as syntax check while automation developing.\r\n\r\nIn __robotx/core/commands/check.py__, use Robot Framework API `run` and set option `dryrun=True`. \r\n\r\nAnd there will also create tmp files to store __check_result.xml__ and __stdout.txt__. Robot Framework offer `ExecutionResult` API for parsing run result, `detail_result = ExecutionResult(xml_result)` this will get the instance of result-class in this dryrun. If there has some error happends, we will use a function named `detail_result.visit()` will print the error in `DryRunChecker` format.\r\n\r\nThere is a little problem in the end of `robotx check`, wheter error happend or not, `( No news is good news:) )` will be printed in the screen. This may bring a little strange to user.\r\n\r\n\r\n### **generate**\r\n\r\n`robotx generate [option]`: create a new project, new test suite, new resource, and create or update case, res, lib docs.\r\n\r\nRobotX generate just simplely copy from Demo and rename it to the user specified path and rename it while create a project, test suite and resources. Because of create project will copy a folder with using a function named `copy_helper` in __robotx/utils/copy.py__. And create a suite and resource just need copy the demo file, so we just use standard library `shutil.copy`.\r\n\r\nWhen create docs, this is a little different because docs are created from case, res and lib's doc string. Robot Framework offer related APIs named `LibDoc` and `TestDoc` for helping generate docs. And we \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n[RobotFramework]:http://www.robotframework.org\r\n[Docker]:http://www.docker.com\r\n[Jenkins]:https://jenkins.engineering.redhat.com\r\n[TCMS]:https://tcms.engineering.redhat.com\r\n"}}