From dd6db992b525cebb0d62a9153a5a512a50349f50 Mon Sep 17 00:00:00 2001 From: JohannesDienst-askui Date: Mon, 4 Mar 2024 11:43:14 +0100 Subject: [PATCH 1/4] feat: move credentials to .env file instead of writing them in plain text (#DVRL-71) --- .../templates/.env.nj | 2 ++ .../templates/askui-helper-windows.nj | 5 +--- .../templates/askui-helper.nj | 5 +--- .../interactive_cli/create-example-project.ts | 26 +++++++++++++------ 4 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 packages/askui-nodejs/example_projects_templates/templates/.env.nj diff --git a/packages/askui-nodejs/example_projects_templates/templates/.env.nj b/packages/askui-nodejs/example_projects_templates/templates/.env.nj new file mode 100644 index 00000000000..2d04ebd9940 --- /dev/null +++ b/packages/askui-nodejs/example_projects_templates/templates/.env.nj @@ -0,0 +1,2 @@ +ASKUI_WORKSPACE_ID={{ workspace_id }} +ASKUI_TOKEN={{ access_token }} \ No newline at end of file diff --git a/packages/askui-nodejs/example_projects_templates/templates/askui-helper-windows.nj b/packages/askui-nodejs/example_projects_templates/templates/askui-helper-windows.nj index 7d98eb68e22..bd696f711fd 100644 --- a/packages/askui-nodejs/example_projects_templates/templates/askui-helper-windows.nj +++ b/packages/askui-nodejs/example_projects_templates/templates/askui-helper-windows.nj @@ -1,5 +1,6 @@ import { UiControlClient } from 'askui'; {{ allure_stepreporter_import }} +import 'dotenv/config'; // Client is necessary to use the askui API // eslint-disable-next-line import/no-mutable-exports @@ -9,10 +10,6 @@ let aui: UiControlClient; beforeAll(async () => { aui = await UiControlClient.build({ - credentials: { - workspaceId: '{{ workspace_id}}', - token: '{{ access_token }}', - }, {{ reporter_placeholder }} }); diff --git a/packages/askui-nodejs/example_projects_templates/templates/askui-helper.nj b/packages/askui-nodejs/example_projects_templates/templates/askui-helper.nj index 9e4669d2c66..98f41fed354 100644 --- a/packages/askui-nodejs/example_projects_templates/templates/askui-helper.nj +++ b/packages/askui-nodejs/example_projects_templates/templates/askui-helper.nj @@ -1,5 +1,6 @@ import { UiControlClient, UiController } from 'askui'; {{ allure_stepreporter_import }} +import 'dotenv/config'; // Server for controlling the operating system let uiController: UiController; @@ -21,10 +22,6 @@ beforeAll(async () => { await uiController.start(); aui = await UiControlClient.build({ - credentials: { - workspaceId: '{{ workspace_id}}', - token: '{{ access_token }}', - }, {{ reporter_placeholder }} }); diff --git a/packages/askui-nodejs/src/lib/interactive_cli/create-example-project.ts b/packages/askui-nodejs/src/lib/interactive_cli/create-example-project.ts index 717439d1ff5..a404bd3b0af 100644 --- a/packages/askui-nodejs/src/lib/interactive_cli/create-example-project.ts +++ b/packages/askui-nodejs/src/lib/interactive_cli/create-example-project.ts @@ -192,22 +192,32 @@ export class CreateExampleProject { private static async installTestFrameworkPackages(): Promise { const runCommand = promisify(exec); const frameworkDependencies = { - jest: 'npm i -D @askui/askui-reporters typescript ts-node @types/jest ts-jest jest @askui/jest-allure-circus eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import eslint-plugin-askui', + jest: 'npm i -D @askui/askui-reporters typescript ts-node @types/jest ts-jest jest dotenv @askui/jest-allure-circus eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import eslint-plugin-askui', }; await runCommand(frameworkDependencies.jest); } private async addUserCredentials() { return [{ - title: 'Add user credentials', + title: 'Add user credentials in .env file', task: async () => new Listr([ { - title: 'Add workspace id ', - task: async () => { this.helperTemplateConfig['workspace_id'] = this.cliOptions.workspaceId; }, - }, - { - title: 'Add access token', - task: async () => { this.helperTemplateConfig['access_token'] = this.cliOptions.accessToken; }, + title: 'Create .env ', + task: async () => { + const askuiDotEnvTemplateFilePath = path.join( + getPathToNodeModulesRoot(), + 'example_projects_templates', + 'templates', + ); + + const templateFileName = '.env.nj'; + this.helperTemplateConfig['workspace_id'] = this.cliOptions.workspaceId; + this.helperTemplateConfig['access_token'] = this.cliOptions.accessToken; + nunjucks.configure(askuiDotEnvTemplateFilePath, { autoescape: false }); + const result = nunjucks.render(templateFileName, this.helperTemplateConfig); + const filePath = path.join(this.baseDirPath, '.env'); + await fs.writeFile(filePath, result, 'utf8'); + }, }, ]), }]; From a18be9b5950b9249d4b978b41cae4e6b66ab9a60 Mon Sep 17 00:00:00 2001 From: JohannesDienst-askui Date: Mon, 4 Mar 2024 17:11:06 +0100 Subject: [PATCH 2/4] feat: make .env optional; docs on how to activate credentials from .env (#DVRL-71) --- .../Installing AskUI/getting-started-linux.md | 32 +++++++++++++++++++ .../Installing AskUI/getting-started-macos.md | 32 +++++++++++++++++++ .../Installing AskUI/getting-started.md | 32 +++++++++++++++++++ .../templates/askui-helper-windows.nj | 7 +++- .../templates/askui-helper.nj | 9 +++++- .../interactive_cli/create-example-project.ts | 12 +++++-- 6 files changed, 120 insertions(+), 4 deletions(-) diff --git a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md index 363755b5f2d..ed0a2b9627d 100644 --- a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md +++ b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md @@ -31,3 +31,35 @@ npx askui@latest init To create and serve a static HTML-Report you have to install [Allure](https://github.com/allure-framework/allure2#download) and then call `allure serve ./allure-results` from your root-directory. ::: + +## (Optional) Store Your Credentials in `.env`-File +Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leacked by pushing them to a remote repository. + +To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by uncommenting the import at the start of the same file: + +```typescript +aui = await UiControlClient.build({ + // Remove the credentials property to + // load credentials from .env file + credentials: { + workspaceId: '< your_workspace_id >', + token: '{{ your_access_token }}', + }, + reporter: new AskUIAllureStepReporter(), + }); +``` + +The resulting file looks like this: + +```typescript +... +import 'dotenv/config'; + +... + + aui = await UiControlClient.build({ + reporter: new AskUIAllureStepReporter(), + }); + +... +``` diff --git a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md index ada78181628..c1805db1a55 100644 --- a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md +++ b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md @@ -36,3 +36,35 @@ npx askui@latest init To create and serve a static HTML-Report you have to install [Allure](https://github.com/allure-framework/allure2#download) and then call `allure serve ./allure-results` from your root-directory. ::: + +## (Optional) Store Your Credentials in `.env`-File +Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leacked by pushing them to a remote repository. + +To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by uncommenting the import at the start of the same file: + +```typescript +aui = await UiControlClient.build({ + // Remove the credentials property to + // load credentials from .env file + credentials: { + workspaceId: '< your_workspace_id >', + token: '{{ your_access_token }}', + }, + reporter: new AskUIAllureStepReporter(), + }); +``` + +The resulting file looks like this: + +```typescript +... +import 'dotenv/config'; + +... + + aui = await UiControlClient.build({ + reporter: new AskUIAllureStepReporter(), + }); + +... +``` diff --git a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md index 5896faf422f..40db3b3ba5b 100644 --- a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md +++ b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md @@ -165,6 +165,38 @@ To add a new workflow, create a file in this folder, ending in `.test.ts` The project comes with one **template workflow**, which is called `my-first-askui-test-suite.ts`. On the next page, you will dive deeper on how to write instructions in the AskUI automation framework. +### Step 10: (Optional) Store Your Credentials in `.env`-File +Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leacked by pushing them to a remote repository. + +To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by uncommenting the import at the start of the same file: + +```typescript +aui = await UiControlClient.build({ + // Remove the credentials property to + // load credentials from .env file + credentials: { + workspaceId: '< your_workspace_id >', + token: '{{ your_access_token }}', + }, + reporter: new AskUIAllureStepReporter(), + }); +``` + +The resulting file looks like this: + +```typescript +... +import 'dotenv/config'; + +... + + aui = await UiControlClient.build({ + reporter: new AskUIAllureStepReporter(), + }); + +... +``` + ## Next Steps You are now ready to create your first workflow with AskUI! Please go to the next page [Write Your First Instruction](../write-your-first-instruction.md). diff --git a/packages/askui-nodejs/example_projects_templates/templates/askui-helper-windows.nj b/packages/askui-nodejs/example_projects_templates/templates/askui-helper-windows.nj index bd696f711fd..36a716dd431 100644 --- a/packages/askui-nodejs/example_projects_templates/templates/askui-helper-windows.nj +++ b/packages/askui-nodejs/example_projects_templates/templates/askui-helper-windows.nj @@ -1,6 +1,7 @@ import { UiControlClient } from 'askui'; {{ allure_stepreporter_import }} -import 'dotenv/config'; +// Uncomment the next file to load credentials from .env +// import 'dotenv/config'; // Client is necessary to use the askui API // eslint-disable-next-line import/no-mutable-exports @@ -10,6 +11,10 @@ let aui: UiControlClient; beforeAll(async () => { aui = await UiControlClient.build({ + credentials: { + workspaceId: '{{ workspace_id}}', + token: '{{ access_token }}', + }, {{ reporter_placeholder }} }); diff --git a/packages/askui-nodejs/example_projects_templates/templates/askui-helper.nj b/packages/askui-nodejs/example_projects_templates/templates/askui-helper.nj index 98f41fed354..fb3fb463ec8 100644 --- a/packages/askui-nodejs/example_projects_templates/templates/askui-helper.nj +++ b/packages/askui-nodejs/example_projects_templates/templates/askui-helper.nj @@ -1,6 +1,7 @@ import { UiControlClient, UiController } from 'askui'; {{ allure_stepreporter_import }} -import 'dotenv/config'; +// Uncomment the next file to load credentials from .env file +// import 'dotenv/config'; // Server for controlling the operating system let uiController: UiController; @@ -22,6 +23,12 @@ beforeAll(async () => { await uiController.start(); aui = await UiControlClient.build({ + // Remove the credentials property to + // load credentials from .env file + credentials: { + workspaceId: '{{ workspace_id}}', + token: '{{ access_token }}', + }, {{ reporter_placeholder }} }); diff --git a/packages/askui-nodejs/src/lib/interactive_cli/create-example-project.ts b/packages/askui-nodejs/src/lib/interactive_cli/create-example-project.ts index a404bd3b0af..dd465f7fef5 100644 --- a/packages/askui-nodejs/src/lib/interactive_cli/create-example-project.ts +++ b/packages/askui-nodejs/src/lib/interactive_cli/create-example-project.ts @@ -199,10 +199,10 @@ export class CreateExampleProject { private async addUserCredentials() { return [{ - title: 'Add user credentials in .env file', + title: 'Add user credentials', task: async () => new Listr([ { - title: 'Create .env ', + title: 'Create .env file ', task: async () => { const askuiDotEnvTemplateFilePath = path.join( getPathToNodeModulesRoot(), @@ -219,6 +219,14 @@ export class CreateExampleProject { await fs.writeFile(filePath, result, 'utf8'); }, }, + { + title: 'Add workspace id ', + task: async () => { this.helperTemplateConfig['workspace_id'] = this.cliOptions.workspaceId; }, + }, + { + title: 'Add access token', + task: async () => { this.helperTemplateConfig['access_token'] = this.cliOptions.accessToken; }, + }, ]), }]; } From 437b15c02bce5b8554ed222727fa7ff0aaaecdff Mon Sep 17 00:00:00 2001 From: JohannesDienst-askui Date: Mon, 4 Mar 2024 17:19:11 +0100 Subject: [PATCH 3/4] docs: remove hard coded links to the docs for relative ones (#DVRL-71) --- .../Installing AskUI/getting-started-linux.md | 4 ++-- .../Installing AskUI/getting-started-macos.md | 4 ++-- .../01-Getting Started/Installing AskUI/getting-started.md | 4 ++-- .../01-Getting Started/write-your-first-instruction.md | 6 +++--- .../02-Getting Started/write-your-first-instruction.md | 2 +- .../01-Getting Started/write-your-first-instruction.md | 6 +++--- .../01-Getting Started/write-your-first-instruction.md | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md index ed0a2b9627d..bed7b28e182 100644 --- a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md +++ b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md @@ -33,9 +33,9 @@ To create and serve a static HTML-Report you have to install [Allure](https://gi ::: ## (Optional) Store Your Credentials in `.env`-File -Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leacked by pushing them to a remote repository. +Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leaked by pushing them to a remote repository. -To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by uncommenting the import at the start of the same file: +To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by commenting in the import at the start of the same file: ```typescript aui = await UiControlClient.build({ diff --git a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md index c1805db1a55..14b5214fed8 100644 --- a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md +++ b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md @@ -38,9 +38,9 @@ To create and serve a static HTML-Report you have to install [Allure](https://gi ::: ## (Optional) Store Your Credentials in `.env`-File -Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leacked by pushing them to a remote repository. +Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leaked by pushing them to a remote repository. -To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by uncommenting the import at the start of the same file: +To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by commenting in the import at the start of the same file: ```typescript aui = await UiControlClient.build({ diff --git a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md index 40db3b3ba5b..389ebe6d998 100644 --- a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md +++ b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md @@ -166,9 +166,9 @@ The project comes with one **template workflow**, which is called `my-first-asku On the next page, you will dive deeper on how to write instructions in the AskUI automation framework. ### Step 10: (Optional) Store Your Credentials in `.env`-File -Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leacked by pushing them to a remote repository. +Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leaked by pushing them to a remote repository. -To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by uncommenting the import at the start of the same file: +To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by commenting in the import at the start of the same file: ```typescript aui = await UiControlClient.build({ diff --git a/docs/docs/general/01-Getting Started/write-your-first-instruction.md b/docs/docs/general/01-Getting Started/write-your-first-instruction.md index 771af0f4858..d861313e70b 100644 --- a/docs/docs/general/01-Getting Started/write-your-first-instruction.md +++ b/docs/docs/general/01-Getting Started/write-your-first-instruction.md @@ -148,7 +148,7 @@ With AskUI, there are near-infinite ways to target an element. We outlined the t To close out the interactive annotation, use `CMD/CTRL + W` or `ESC`. #### Approach B: Filtering by Proximity: Using Relational Selectors -- **Process**: Chain multiple element descriptions together using commands like `leftOf()`, `above()`, etc., to create a unique selector based on element relationships. More information can be found in the [AskUI documentation](https://docs.askui.com/docs/0.11.6/general/Element%20Selection/relational-selectors). +- **Process**: Chain multiple element descriptions together using commands like `leftOf()`, `above()`, etc., to create a unique selector based on element relationships. More information can be found in the [AskUI documentation](../03-Element%20Selection/relational-selectors.md). - **Advantages**: Increases selector specificity, particularly useful in complex UIs with numerous similar elements. - **Best Used When**: Targeting elements in a densely populated UI or when elements lack unique identifiers. @@ -163,7 +163,7 @@ To close out the interactive annotation, use `CMD/CTRL + W` or `ESC`. ``` #### Approach C: Custom Element-Descriptions: Screenshot-Based Selection (Advanced) -- **Process**: Use a screenshot snippet of the desired element to locate its exact position on the screen. More information can be found in the [AskUI documentation](https://docs.askui.com/docs/0.11.6/general/Element%20Selection/text-and-element-selectors#custom-elements). +- **Process**: Use a screenshot snippet of the desired element to locate its exact position on the screen. More information can be found in the [AskUI documentation](../03-Element%20Selection/text-and-element-selectors.md#custom-elements). - **Advantages**: Highly accurate for unique or custom-designed elements. - **Best Used When**: The element has a distinct visual appearance. - **Considerations**: This method is sensitive to screen resolution changes; ensure consistency in the automation/testing environment. @@ -192,7 +192,7 @@ it('should click on my element', async () => { ### Step 3: Selecting the Right Action for Your Task In this step you translate your intention (e.g., click a button, enter text) into a programmable action. -To learn more about the different types of actions, check out our [API Documentation](https://docs.askui.com/docs/0.11.6/api/API/table-of-contents). +To learn more about the different types of actions, check out our [API Documentation](../../api/01-API/table-of-contents.md). In this case, we will use the `click` method, which is great for interacting with buttons, links and checkboxes. diff --git a/docs/versioned_docs/version-0.12.2/general/02-Getting Started/write-your-first-instruction.md b/docs/versioned_docs/version-0.12.2/general/02-Getting Started/write-your-first-instruction.md index 266aa42e634..56cb679c736 100644 --- a/docs/versioned_docs/version-0.12.2/general/02-Getting Started/write-your-first-instruction.md +++ b/docs/versioned_docs/version-0.12.2/general/02-Getting Started/write-your-first-instruction.md @@ -167,7 +167,7 @@ Congratulations! You’ve just built your first instruction using AskUI. :tada: Have a look at [Relational Selectors](../03-Element%20Selection/relational-selectors.md) to select elements via a visual relation instead. ### Technical -For technical problems with the execution, take a look at our [Troubleshooting page](https://docs.askui.com/docs/general/Troubleshooting/) +For technical problems with the execution, take a look at our [Troubleshooting page](../07-Troubleshooting/index.md) ## Where to Go Next? diff --git a/docs/versioned_docs/version-0.13.1/general/01-Getting Started/write-your-first-instruction.md b/docs/versioned_docs/version-0.13.1/general/01-Getting Started/write-your-first-instruction.md index 771af0f4858..d861313e70b 100644 --- a/docs/versioned_docs/version-0.13.1/general/01-Getting Started/write-your-first-instruction.md +++ b/docs/versioned_docs/version-0.13.1/general/01-Getting Started/write-your-first-instruction.md @@ -148,7 +148,7 @@ With AskUI, there are near-infinite ways to target an element. We outlined the t To close out the interactive annotation, use `CMD/CTRL + W` or `ESC`. #### Approach B: Filtering by Proximity: Using Relational Selectors -- **Process**: Chain multiple element descriptions together using commands like `leftOf()`, `above()`, etc., to create a unique selector based on element relationships. More information can be found in the [AskUI documentation](https://docs.askui.com/docs/0.11.6/general/Element%20Selection/relational-selectors). +- **Process**: Chain multiple element descriptions together using commands like `leftOf()`, `above()`, etc., to create a unique selector based on element relationships. More information can be found in the [AskUI documentation](../03-Element%20Selection/relational-selectors.md). - **Advantages**: Increases selector specificity, particularly useful in complex UIs with numerous similar elements. - **Best Used When**: Targeting elements in a densely populated UI or when elements lack unique identifiers. @@ -163,7 +163,7 @@ To close out the interactive annotation, use `CMD/CTRL + W` or `ESC`. ``` #### Approach C: Custom Element-Descriptions: Screenshot-Based Selection (Advanced) -- **Process**: Use a screenshot snippet of the desired element to locate its exact position on the screen. More information can be found in the [AskUI documentation](https://docs.askui.com/docs/0.11.6/general/Element%20Selection/text-and-element-selectors#custom-elements). +- **Process**: Use a screenshot snippet of the desired element to locate its exact position on the screen. More information can be found in the [AskUI documentation](../03-Element%20Selection/text-and-element-selectors.md#custom-elements). - **Advantages**: Highly accurate for unique or custom-designed elements. - **Best Used When**: The element has a distinct visual appearance. - **Considerations**: This method is sensitive to screen resolution changes; ensure consistency in the automation/testing environment. @@ -192,7 +192,7 @@ it('should click on my element', async () => { ### Step 3: Selecting the Right Action for Your Task In this step you translate your intention (e.g., click a button, enter text) into a programmable action. -To learn more about the different types of actions, check out our [API Documentation](https://docs.askui.com/docs/0.11.6/api/API/table-of-contents). +To learn more about the different types of actions, check out our [API Documentation](../../api/01-API/table-of-contents.md). In this case, we will use the `click` method, which is great for interacting with buttons, links and checkboxes. diff --git a/docs/versioned_docs/version-0.14.0/general/01-Getting Started/write-your-first-instruction.md b/docs/versioned_docs/version-0.14.0/general/01-Getting Started/write-your-first-instruction.md index 771af0f4858..d861313e70b 100644 --- a/docs/versioned_docs/version-0.14.0/general/01-Getting Started/write-your-first-instruction.md +++ b/docs/versioned_docs/version-0.14.0/general/01-Getting Started/write-your-first-instruction.md @@ -148,7 +148,7 @@ With AskUI, there are near-infinite ways to target an element. We outlined the t To close out the interactive annotation, use `CMD/CTRL + W` or `ESC`. #### Approach B: Filtering by Proximity: Using Relational Selectors -- **Process**: Chain multiple element descriptions together using commands like `leftOf()`, `above()`, etc., to create a unique selector based on element relationships. More information can be found in the [AskUI documentation](https://docs.askui.com/docs/0.11.6/general/Element%20Selection/relational-selectors). +- **Process**: Chain multiple element descriptions together using commands like `leftOf()`, `above()`, etc., to create a unique selector based on element relationships. More information can be found in the [AskUI documentation](../03-Element%20Selection/relational-selectors.md). - **Advantages**: Increases selector specificity, particularly useful in complex UIs with numerous similar elements. - **Best Used When**: Targeting elements in a densely populated UI or when elements lack unique identifiers. @@ -163,7 +163,7 @@ To close out the interactive annotation, use `CMD/CTRL + W` or `ESC`. ``` #### Approach C: Custom Element-Descriptions: Screenshot-Based Selection (Advanced) -- **Process**: Use a screenshot snippet of the desired element to locate its exact position on the screen. More information can be found in the [AskUI documentation](https://docs.askui.com/docs/0.11.6/general/Element%20Selection/text-and-element-selectors#custom-elements). +- **Process**: Use a screenshot snippet of the desired element to locate its exact position on the screen. More information can be found in the [AskUI documentation](../03-Element%20Selection/text-and-element-selectors.md#custom-elements). - **Advantages**: Highly accurate for unique or custom-designed elements. - **Best Used When**: The element has a distinct visual appearance. - **Considerations**: This method is sensitive to screen resolution changes; ensure consistency in the automation/testing environment. @@ -192,7 +192,7 @@ it('should click on my element', async () => { ### Step 3: Selecting the Right Action for Your Task In this step you translate your intention (e.g., click a button, enter text) into a programmable action. -To learn more about the different types of actions, check out our [API Documentation](https://docs.askui.com/docs/0.11.6/api/API/table-of-contents). +To learn more about the different types of actions, check out our [API Documentation](../../api/01-API/table-of-contents.md). In this case, we will use the `click` method, which is great for interacting with buttons, links and checkboxes. From f3843224dae8d0a1d947d9d896d5c76c06bfb49a Mon Sep 17 00:00:00 2001 From: JohannesDienst-askui Date: Wed, 6 Mar 2024 18:03:18 +0100 Subject: [PATCH 4/4] docs: remove docs for dotenv config (#DVRL-71) --- .../Installing AskUI/getting-started-linux.md | 31 ------------------ .../Installing AskUI/getting-started-macos.md | 32 ------------------- .../Installing AskUI/getting-started.md | 32 ------------------- 3 files changed, 95 deletions(-) diff --git a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md index bed7b28e182..c2d134cca5b 100644 --- a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md +++ b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-linux.md @@ -32,34 +32,3 @@ To create and serve a static HTML-Report you have to install [Allure](https://gi ::: -## (Optional) Store Your Credentials in `.env`-File -Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leaked by pushing them to a remote repository. - -To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by commenting in the import at the start of the same file: - -```typescript -aui = await UiControlClient.build({ - // Remove the credentials property to - // load credentials from .env file - credentials: { - workspaceId: '< your_workspace_id >', - token: '{{ your_access_token }}', - }, - reporter: new AskUIAllureStepReporter(), - }); -``` - -The resulting file looks like this: - -```typescript -... -import 'dotenv/config'; - -... - - aui = await UiControlClient.build({ - reporter: new AskUIAllureStepReporter(), - }); - -... -``` diff --git a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md index 14b5214fed8..ada78181628 100644 --- a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md +++ b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started-macos.md @@ -36,35 +36,3 @@ npx askui@latest init To create and serve a static HTML-Report you have to install [Allure](https://github.com/allure-framework/allure2#download) and then call `allure serve ./allure-results` from your root-directory. ::: - -## (Optional) Store Your Credentials in `.env`-File -Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leaked by pushing them to a remote repository. - -To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by commenting in the import at the start of the same file: - -```typescript -aui = await UiControlClient.build({ - // Remove the credentials property to - // load credentials from .env file - credentials: { - workspaceId: '< your_workspace_id >', - token: '{{ your_access_token }}', - }, - reporter: new AskUIAllureStepReporter(), - }); -``` - -The resulting file looks like this: - -```typescript -... -import 'dotenv/config'; - -... - - aui = await UiControlClient.build({ - reporter: new AskUIAllureStepReporter(), - }); - -... -``` diff --git a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md index 389ebe6d998..5896faf422f 100644 --- a/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md +++ b/docs/docs/general/01-Getting Started/Installing AskUI/getting-started.md @@ -165,38 +165,6 @@ To add a new workflow, create a file in this folder, ending in `.test.ts` The project comes with one **template workflow**, which is called `my-first-askui-test-suite.ts`. On the next page, you will dive deeper on how to write instructions in the AskUI automation framework. -### Step 10: (Optional) Store Your Credentials in `.env`-File -Your credentials (_Access Token_ and _Workspace ID_) get stored in plain text in the file (`askui_example/helpers/askui-helper.ts`). Storing credentials in plain text increases their risk to be leaked by pushing them to a remote repository. - -To load them from the `.env` file that gets created you have to remove the `credentials` property from `UiControlClient` in `askui_example/helpers/askui-helper.ts` and activate the `dotenv`-environment by commenting in the import at the start of the same file: - -```typescript -aui = await UiControlClient.build({ - // Remove the credentials property to - // load credentials from .env file - credentials: { - workspaceId: '< your_workspace_id >', - token: '{{ your_access_token }}', - }, - reporter: new AskUIAllureStepReporter(), - }); -``` - -The resulting file looks like this: - -```typescript -... -import 'dotenv/config'; - -... - - aui = await UiControlClient.build({ - reporter: new AskUIAllureStepReporter(), - }); - -... -``` - ## Next Steps You are now ready to create your first workflow with AskUI! Please go to the next page [Write Your First Instruction](../write-your-first-instruction.md).