From a959eec9cf36c143f2061b65eefca66573f77310 Mon Sep 17 00:00:00 2001 From: Christian Bromann Date: Fri, 26 May 2023 22:57:01 -0700 Subject: [PATCH] docs(appium): Add contributing documentation (#18691) --- .vscode/extensions.json | 5 + packages/appium/docs/en/contributing/index.md | 102 +++++++++++++++++- 2 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..13d16c329 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "stateful.runme" + ] +} diff --git a/packages/appium/docs/en/contributing/index.md b/packages/appium/docs/en/contributing/index.md index 68c9b8884..a4f6b4adb 100644 --- a/packages/appium/docs/en/contributing/index.md +++ b/packages/appium/docs/en/contributing/index.md @@ -1,5 +1,6 @@ --- title: Contributing to Appium +cwd: ../../../../../ --- This section of Appium's documentation is for those who are interested in contributing to Appium's @@ -16,8 +17,105 @@ already. ## Ways to Contribute -TODO +The project offers a variety of ways to contribute, e.g.: + +- contributing code +- improving documentation +- creating educational content (blog posts, tutorials, videos, etc.) +- spreading the good word about the project (e.g. via Twitter) +- filing bugs if you discover them while using Appium +- making feature requests if you are missing something in the project or help triaging bugs +- supporting users in the [Appium forum](https://discuss.appium.io/) ## The Appium Development Process -TODO +To contribute to the Appium code base make sure to check out the Git repository. + +!!! info + + If you are VS Code user you can easily check out the project using [Runme](https://runme.dev/api/runme?repository=https%3A%2F%2Fgithub.com%2Fappium%2Fappium.git&fileToOpen=packages%2Fappium%2Fdocs%2Fen%2Fcontributing%2Findex.md). + +It is advised to [fork](https://github.com/appium/appium/fork) before cloning it to your system. + +```sh { name=clone } +export GITHUB_USERNAME= +git clone git@github.com:$GITHUB_USERNAME/appium.git +``` + +After cloning you can go ahead and install the project dependencies: + +```sh { name=install } +npm install +``` + +From here on there are several things you can do. + +### Watch Files + +When developing Appium code we have to watch all JavaScript and TypeScript files to re-compile them after every change. You can run this watch process via: + +```sh { name=watch, background=true } +npm run dev +``` + +### Start Appium in Dev-Mode + +To test your changes you can run Appium in dev mode via: + +```sh { name=start } +npm start +``` + +### Run Tests + +The project maintains a set of different test variations you can run to verify the quality of the code. + +#### Linting + +Appium uses EsLint for static code analysis and linting. You can run these checks via: + +```sh { name=test-linting } +npm run lint +``` + +#### Unit + +Run via: + +```sh { name=test-unit } +npm run test:unit +``` + +You can also run tests for specific workspaces, e.g.: + +```sh { name=test-workspace } +export APPIUM_WORKSPACE=@appium/doctor +npm run test:unit -w $APPIUM_WORKSPACE +``` + +#### Smoke and e2e Tests + +Run via: + +```sh { name=test-slow } +npm run test:slow +``` + +### Deploy Docs Locally + +Our documentation system uses [MKDocs](https://www.mkdocs.org/) and therefor requires [Python](https://www.python.org/) to be installed on your system. You can run the docs by: + +```sh +# installing needed Python dependencies +pip install -r packages/docutils/requirements.txt +# build the project +npm run build +# run dev server +npm run dev:docs +``` + +You should be able to view the page at `http://127.0.0.1:8000/docs/en`: + +```sh +open http://127.0.0.1:8000/docs/en +```