Skip to content

Commit

Permalink
Merge pull request #533 from testsigmahq/dev
Browse files Browse the repository at this point in the history
New docs for Gearset Integreation & Basic Authentication (Safari)
  • Loading branch information
Santhosh-testsigma authored Nov 20, 2024
2 parents 8cb0b4d + 6732775 commit 22c8f12
Show file tree
Hide file tree
Showing 9 changed files with 209 additions and 41 deletions.
42 changes: 21 additions & 21 deletions scripts/indexr.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require("dotenv").config({
require('dotenv').config({
path: `.env`,
});
const Typesense = require("typesense");
const { request } = require("graphql-request");
const Typesense = require('typesense');
const { request } = require('graphql-request');

const pageQuery = `
query {
Expand All @@ -13,7 +13,7 @@ const pageQuery = `
) {
edges {
node {
headings(depth: h3) {
headings(depth: h4) {
value
}
objectID: id
Expand All @@ -29,7 +29,7 @@ const pageQuery = `
fields {
slug
}
excerpt(pruneLength: 100)
excerpt(pruneLength: 200000)
}
}
}
Expand All @@ -39,13 +39,13 @@ const pageQuery = `
function pageToTypesenseRecord({ node }) {
const { id, frontmatter, fields = {}, headings = [], ...rest } = node;

const formattedHeadings = headings.map((h) => h.value || "").filter(Boolean);
const formattedHeadings = headings.map((h) => h.value || '').filter(Boolean);
return {
objectID: id,
title: frontmatter.title || "",
search_keyword: String(frontmatter.search_keyword || ""),
slug: fields.slug || "",
excerpt: frontmatter.excerpt || "",
title: frontmatter.title || '',
search_keyword: String(frontmatter.search_keyword || ''),
slug: fields.slug || '',
excerpt: frontmatter.excerpt || '',
headings: formattedHeadings,
...rest,
};
Expand Down Expand Up @@ -84,23 +84,23 @@ async function indexData() {
await client.collections().create({
name: process.env.TYPESENSE_COLLECTION,
fields: [
{ name: "objectID", type: "string" },
{ name: "title", type: "string" },
{ name: "search_keyword", type: "string" },
{ name: "slug", type: "string" },
{ name: "excerpt", type: "string" },
{ name: "headings", type: "string[]", facet: false },
{ name: 'objectID', type: 'string' },
{ name: 'title', type: 'string' },
{ name: 'search_keyword', type: 'string' },
{ name: 'slug', type: 'string' },
{ name: 'excerpt', type: 'string' },
{ name: 'headings', type: 'string[]', facet: false },
],
});
console.log(
`Collection ${process.env.TYPESENSE_COLLECTION} created successfully.`
);

const response = await request(
"http://127.0.0.1:8000/___graphql",
'http://127.0.0.1:8000/___graphql',
pageQuery
);
console.log("response", response);
console.log('response', response);
const data = await response;

const records = data.docs.edges.map(pageToTypesenseRecord);
Expand All @@ -111,16 +111,16 @@ async function indexData() {
.import(records)
.then((typesenseResponse) => {
// check the output of the response in the console
console.log("typesenseResponse", typesenseResponse);
console.log('typesenseResponse', typesenseResponse);
console.log(`🎉 Successfully indexed records to Typesense search.`);
})
.catch((error) => {
console.error(error);
});

console.log("Indexing complete!");
console.log('Indexing complete!');
} catch (error) {
console.error("Indexing error:", error);
console.error('Indexing error:', error);
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/left-nav-title.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@
"/docs/continuous-integration/codeship-ci/": "CodeShip CI"
},
"github-cicd": {
"/docs/continuous-integration/github-cicd/": "GitHub CICD"
"/docs/continuous-integration/github-cicd/": "GitHub CI/CD"
},
"bitbucket-ci": {
"/docs/continuous-integration/bitbucket-ci/": "Bitbucket CICD"
"/docs/continuous-integration/bitbucket-ci/": "Bitbucket CI/CD"
},
"gitlab-cicd": {
"/docs/continuous-integration/gitlab-cicd/": "GitLab CI/CD"
Expand Down Expand Up @@ -682,5 +682,7 @@
"test-cases": {"/docs/windows-lite-automation/test-cases/": "Test Cases for Windows (Lite)" },
"copado-integration": {"/docs/continuous-integration/copado-integration/": "Copado CI/CD" },
"features-and-scenarios": {"/docs/test-cases/manage/features-and-scenarios/": "Features & Scenarios" },
"key-components": {"/docs/testsigma-tunnel/key-components/": "Components & Requirements" }
"key-components": {"/docs/testsigma-tunnel/key-components/": "Components & Requirements" },
"basic-authentication-safari": {"/docs/desired-capabilities/basic-authentication-safari/": "Basic Authentication [Safari]" },
"gearset": {"/docs/continuous-integration/gearset/": "Gearset CI/CD" }
}
8 changes: 3 additions & 5 deletions src/pages/docs/continuous-integration/copado-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ Testsigma Copado integration allows you to trigger test plan execution every tim

---

## **Prerequisites**
> Before you proceed, ensure you the following:
> - An [API](https://testsigma.com/docs/configuration/api-keys/#steps-to-generate-api-key) Key from your Testsigma account.
> - [Test Cases](https://testsigma.com/docs/test-cases/create-test-steps/overview/) for Salesforce in Testsigma.
> - A [Test Plan](https://testsigma.com/docs/test-management/test-plans/overview/) in your Salesforce project.
> ## **Prerequisites**
>
> Before you begin, ensure you are familiar with the concepts of [Test Cases](https://testsigma.com/docs/test-cases/manage/add-edit-delete/) for Salesforce, [Test Plans](https://testsigma.com/docs/test-management/test-plans/overview/) for Salesforce, and [Generating API Keys](https://testsigma.com/docs/configuration/api-keys/#steps-to-generate-api-key) in Testsigma.
---

Expand Down
73 changes: 73 additions & 0 deletions src/pages/docs/continuous-integration/gearset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: "Integrate Testsigma with Gearset (Salesforce)"
metadesc: "Integrate Testsigma with Gearset for effortless Salesforce test automation | Improve your testing efficiency accelerate Salesforce automation by integrating Testsigma with Gearset"
noindex: false
order: 12.25
page_id: "Integrate Testsigma with Gearset"
warning: false
contextual_links:
- type: section
name: "Contents"
- type: link
name: "Prerequisites"
url: "#prerequisites"
- type: link
name: "Test Plan Execution Setup in Gearset CI Job"
url: "#test-plan-execution-setup-in-gearset-ci-job"
---

---

Testsigma Gearset integration allows you to trigger test plan execution every time a Gearset deployment is triggered. This article discusses how to integrate Testsigma with Gearset in Salesforce deployments.

---

> ## **Prerequisites**
>
> Before you begin, ensure you are familiar with the concepts of [Test Cases](https://testsigma.com/docs/test-cases/manage/add-edit-delete/) for Salesforce, [Test Plans](https://testsigma.com/docs/test-management/test-plans/overview/) for Salesforce, and [Generating API Keys](https://testsigma.com/docs/configuration/api-keys/#steps-to-generate-api-key) in Testsigma.
---

## **Test Plan Execution Setup in Gearset CI Job**

1. On **Outgoing webhooks** section,

![Details in Webhook](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Config_in_Gearset.png)

- Enter the **API Endpoint** from **cURL** in the **Outgoing webhook url** field.
[[info | **NOTE**:]]
| You can find this under **Test Plans > CI/CD Integrations > REST API call to start Test Plan**

- In the **Payload** field, select **Custom**.

- In the **Authentication** field, select **Authorization**.

- In the **Credentials** field, add the **API key** in the following format

> `Bearer <API-KEY>`
- Add the following **Header** details:

> **Header key:** Accept <br>
> **Header value:** application/json
- In the **Content-Type** field, select **application/json**.

- In the **Payload** field, enter the test plan execution ID in the following format:

```
{
“executionId”:”<id>”
}
```
[[info | **NOTE**:]]
| You can find the **Execution ID** under **Test Plans > CI/CD Integrations > REST API call to start Test Plan**
| ![Env ID](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Gearset_EnvID.png)
1. Go to **Notifications**, click **Save CI Job**.
3. Once the metadata is downloaded, verify that the test plan is triggered from Gearset.
---
67 changes: 67 additions & 0 deletions src/pages/docs/desired-capabilities/basic-authentication-safari.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: "Automating Basic Authentication in Safari"
page_title: "Automating Basic Authentication in Safari"
metadesc: "Safari restricts automated basic authentication login by blocking credentials in the URL format. This article discusses bypassing this limitation in Testsigma."
noindex: false
order: 15.99
page_id: "Basic Authentication in Safari"
search_keyword: ""
warning: false
contextual_links:
- type: section
name: "Contents"
- type: link
name: "Prerequisites"
url: "#prerequisites"
- type: link
name: "Generate the Authorization Header"
url: "#generate-the-authorization-header"
- type: link
name: "Adding the Capability"
url: "#adding-the-capability"
---

---

Safari restricts automated Basic Authentication login by blocking credentials in the URL format, which is a challenge in automation testing. In Testsigma, you can bypass this limitation using an encoded Authorization header in the desired capabilities. This article discusses generating the necessary authorization token and configuring capabilities.

---

> ## **Prerequisites**
>
> Before you begin, ensure you are familiar with the concepts of [Test Cases](https://testsigma.com/docs/test-cases/manage/add-edit-delete/), [Ad-hoc Runs](https://testsigma.com/docs/runs/adhoc-runs/), and [Desired Capabilities](https://testsigma.com/docs/desired-capabilities/overview/) in Testsigma.
---

## **Generate the Authorization Header**

1. Navigate to [Basic Auth Header Generator](https://www.debugbear.com/basic-auth-header-generator).

2. Enter your **username** and **password** to generate the **Authorization Header**.

![Auth Header](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Header_Generator.png)

---

## **Adding the Capability**

1. On the **Test Case Details** page, click **Run**.
![Run](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Run_Now_BA.png)

2. In the **Ad-Hoc Run** overlay,

- Select available **macOS**, **Version**, **Browser**, and **Resolution**.
![Machine, Ver, Browser & Resol](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Machine_OS_BA.png)

- Enter **testsigma.customHeaders** in the **Key** field, select **String** as **Data type**, and set the **Value** as per the generated **Authorization Header**.
![Desired Capabilities](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Desired_Capabilities_BA.png)

> **Value Format:** ```{ "Authorization": "Basic <token>" }```
3. Click **Run Now** to execute the test case.
![Execute Test](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Execute_Test_BA.png)

4. After execution completes, refer to the screenshot captured at the test step level.
![Screenshot of Execution](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Screenshot_Run_BA.png)

---
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ contextual_links:
- type: link
name: "Use Test Step Settings"
url: "#use-test-step-settings"
- type: link
name: "Configuring Global Timeouts (New)"
url: "#configuring-global-timeouts-new"
- type: link
name: "Update Step Settings"
url: "#update-step-settings"
Expand Down Expand Up @@ -60,6 +63,23 @@ Here’s a quick GIF demonstrating how to access & update the test step settings

---

## **Configuring Global Timeouts (New)**

The following table outlines how the **Global Step Timeout** settings & **Test Step Timeout** interact based on different configurations.

| Scenario | Test Step Timeout | Global Step Timeout | Toggle | Outcome |
|----------|-----------------------------------------|----------------------|--------|---------------------------------------------------------------------------------------------|
| **Case 1** | 30 seconds (default) | 30 seconds (default)| OFF | Global timeout (30 seconds) applies universally, as it matches the default step timeout. |
| **Case 2** | 30 seconds (default) | 60 seconds | OFF | Global timeout (60 seconds) applies, as it overrides the default step timeout (30 seconds). |
| **Case 3** | Some steps customized, some unchanged | Updated value | OFF | Customized steps use their specific timeouts and steps without custom timeouts use the global timeout. |
| **Case 4** | Some steps customized, some unchanged | Any value | ON | Global timeout applies to all steps, overriding step-specific timeouts. |


Refer to the screenshot below to enable the **Global Step Timeout** toggle in the **Additional Settings** section of the **Adhoc Run** overlay.

![Global Timeouts](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Global_Settings.png)

---
## **Update Step Settings**

To update several test steps, click the **checkboxes** next to the **test steps** you want to update and then click on **Update Settings** in the menu bar to open a popup window where you can make changes to the settings. ![Update Step Settings](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/update_testsettings.gif)
Expand Down
13 changes: 8 additions & 5 deletions src/pages/docs/test-data/types/mailbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ Testsigma provides a digital inbox called Mail Box to verify OTP accuracy, check

---

## **Prerequisites**

Before using Mailbox Test Data, ensure that you understand specific concepts such as creating a [Test Case](https://testsigma.com/docs/test-cases/manage/add-edit-delete/#creating-a-test-case), managing [Test Steps](https://testsigma.com/docs/test-cases/step-types/natural-language/), and effectively using them with [Test Data Types](https://testsigma.com/docs/test-data/types/overview/) and [Data Generators](https://testsigma.com/docs/test-data/types/data-generator/). Additionally, familiarise yourself with [Regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) if necessary.
> ## **Prerequisites**
>
> Before using Mailbox Test Data, ensure that you understand specific concepts such as creating a [Test Case](https://testsigma.com/docs/test-cases/manage/add-edit-delete/#creating-a-test-case), managing [Test Steps](https://testsigma.com/docs/test-cases/step-types/natural-language/), and effectively using them with [Test Data Types](https://testsigma.com/docs/test-data/types/overview/) and [Data Generators](https://testsigma.com/docs/test-data/types/data-generator/). Additionally, familiarise yourself with [Regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) if necessary.
[[info | NOTE:]]
| You can enable Mail Box for your account by contacting **[email protected]** or using the **instant chat** option.
| - You can enable Mail Box for your account by contacting **[email protected]** or using the **instant chat** option.
| - You can now access the Mail Box & Phone Numbers outside of test executions. This allows you to retrieve messages, OTPs, and authentication codes when you enable the toggle.
| - For test executions, the toggle does not affect the execution. The test will continue to run regardless of whether the toggle is enabled or not.

---

Expand Down Expand Up @@ -83,7 +85,8 @@ Here is a quick GIF demonstrating the above workflow:
![Fetch OTP from Mail Box](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/fetchotp_mailbox.gif)

[[info | NOTE:]]
| You must perform both [Add Mail Box in Test Step](https://testsigma.com/docs/test-data/types/mailbox/#add-mailbox-in-test-step) and [Fetch OTP from Mail Box](https://testsigma.com/docs/test-data/types/mailbox/#fetch-otp-from-mailbox) for Two-Factor Authentication.
| - You must perform both [Add Mail Box in Test Step](https://testsigma.com/docs/test-data/types/mailbox/#add-mailbox-in-test-step) and [Fetch OTP from Mail Box](https://testsigma.com/docs/test-data/types/mailbox/#fetch-otp-from-mailbox) for Two-Factor Authentication.


---

Expand Down
17 changes: 11 additions & 6 deletions src/pages/docs/test-data/types/phone-number.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ The phone number data type is used to automate two-factor authentication (2FA) a

---

## **Prerequisites**
- You should be familiar with regular expressions. Refer to the [regex guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).
> ## **Prerequisites**
>
> - You should be familiar with regular expressions. Refer to the [regex guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).
[[info | NOTE:]]
| - You can enable Phone Number for your account by contacting **[email protected]** or using the **instant chat** option.
| - You can now access the Phone Numbers outside of test executions. This allows you to retrieve messages, OTPs, and authentication codes when you enable the toggle.
| - For test executions, the toggle does not affect the execution. The test will continue to run regardless of whether the toggle is enabled or not.

- Contact **[email protected]** to get a phone number.

---

Expand Down Expand Up @@ -75,9 +80,9 @@ Providing phone numbers for OTP and login purposes is restricted in certain coun

---

## **Prerequisites**

- You should have Testsigma SMS Forwarder application.
> ## **Prerequisites**
>
> - You should have Testsigma SMS Forwarder application.

---
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/testsigma-tunnel/using-tunnel.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You can use Testsigma Tunnel for Test Automation by configuring the desired capa
|---|---|---|
|**testsigmaLab.tunnelName**|String|&lt;tunnel_Name&gt;|

![Tunnel DC](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/DC_TS_Tunnel.png)
![Tunnel DC](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/Tunnel_Desired_Capability.png)

---

Expand Down

0 comments on commit 22c8f12

Please sign in to comment.