Skip to content

Commit a012b9c

Browse files
authored
Merge pull request #1353 from amanchopra1905/stage
kane ai assertion feature
2 parents 30b05c8 + c4e9955 commit a012b9c

File tree

7 files changed

+88
-3
lines changed

7 files changed

+88
-3
lines changed
96.5 KB
Loading
99.5 KB
Loading
104 KB
Loading
98.3 KB
Loading
102 KB
Loading

docs/kane-ai-assertions.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
id: kane-ai-assertions
3+
title: KaneAI - Assertions
4+
hide_title: false
5+
sidebar_label: Assertions
6+
description: Learn how to define and apply soft and hard assertions on your test code executed via KaneAI
7+
keywords:
8+
- lambdatest automation
9+
- lambdatest kaneai
10+
- kaneai assertions
11+
- kaneai hard assertion
12+
- kaneai soft assertion
13+
url: https://www.lambdatest.com/support/docs/kane-ai-assertions/
14+
site_name: LambdaTest
15+
slug: kane-ai-assertions/
16+
---
17+
18+
<script type="application/ld+json"
19+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
20+
"@context": "https://schema.org",
21+
"@type": "BreadcrumbList",
22+
"itemListElement": [{
23+
"@type": "ListItem",
24+
"position": 1,
25+
"name": "Home",
26+
"item": "https://www.lambdatest.com"
27+
},{
28+
"@type": "ListItem",
29+
"position": 2,
30+
"name": "Support",
31+
"item": "https://www.lambdatest.com/support/docs/"
32+
},{
33+
"@type": "ListItem",
34+
"position": 3,
35+
"name": "KaneAI Assertions",
36+
"item": "https://www.lambdatest.com/support/docs/kane-ai-assertions/"
37+
}]
38+
})
39+
}}
40+
></script>
41+
The Assertion Feature in KaneAI enhances test execution control by transitioning from soft assertions (which allow tests to proceed despite failures) to hard assertions, where test execution stops immediately upon failure. This feature ensures that failures are logged with detailed remarks, providing better debugging insights. However, users retain flexibility by marking specific assertions as soft, allowing test execution to continue selectively.
42+
43+
## Key Features
44+
- **Hard Assertions :** Test execution halts immediately upon assertion failure, marking the test as failed.
45+
- **Soft Assertions :** Specific assertions can be marked as soft, allowing test execution to continue despite failures.
46+
- **Detailed Failure Logging :** Every failed assertion logs comprehensive failure remarks for better debugging.
47+
- **Improved Test Control :** Users can customize assertion behavior based on test requirements.
48+
49+
## Step-by-Step Guide
50+
51+
### Step 1: Initiate a Test Session
52+
- Log in to your LambdaTest account.
53+
- Click on Create a Web / App Test to start a new session within Kane AI.
54+
55+
<img loading="lazy" src={require('../assets/images/kane-ai/features/assertion/img1.png').default} alt="kaneai" className="doc_img"/>
56+
57+
### Step 2: Perform an Assertion test
58+
- Create an assertion step and KaneAI will perform a visual query to detect if the specified test is valid or not.
59+
- If the assertion passes, it is marked as **Assertion True**.
60+
- If the assertion fails it will be marked as **Assertion Failed**.
61+
62+
<img loading="lazy" src={require('../assets/images/kane-ai/features/assertion/img2.png').default} alt="kaneai" className="doc_img"/>
63+
64+
### Step 3: Configure Hard Assertion
65+
- Click on the assertion step where the test failed.
66+
- Toggle the button to enable or disable the **Hard assertion**:
67+
- If enabled, test execution stops immediately on failure.
68+
- If disabled, the test continues execution despite the failure.
69+
- Save the configuration and proceed.
70+
71+
<img loading="lazy" src={require('../assets/images/kane-ai/features/assertion/img3.png').default} alt="kaneai" className="doc_img"/>
72+
73+
### Step 4: Review and Execute the test
74+
- Navigate to the Test Manager to view the summary of executed tests.
75+
- Review the steps performed, and click on the **save** button.
76+
- Navigate to the **Code** tab, your code is generated to run on HyperExecute.
77+
- Click on the button **Run on HyperExecute**.
78+
79+
<img loading="lazy" src={require('../assets/images/kane-ai/features/assertion/img4.png').default} alt="kaneai" className="doc_img"/>
80+
81+
### Step 5: Monitor the Test Execution
82+
- Veriy your test results in the logs as shown below:
83+
84+
<img loading="lazy" src={require('../assets/images/kane-ai/features/assertion/img5.png').default} alt="kaneai" className="doc_img"/>

sidebars.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,10 @@ module.exports = {
11061106
]
11071107
},
11081108
"kane-ai-modules",
1109-
"kane-ai-secrets"
1109+
"kane-ai-secrets",
1110+
"kaneai-upload-and-download-files",
1111+
"kaneai-modules-versions-and-enhancement",
1112+
"kane-ai-assertions"
11101113
],
11111114
},
11121115
{
@@ -1116,8 +1119,6 @@ module.exports = {
11161119
items: [
11171120
"kane-ai-command-guide",
11181121
"kane-ai-web-test-writing-guidelines",
1119-
"kaneai-upload-and-download-files",
1120-
"kaneai-modules-versions-and-enhancement"
11211122
],
11221123
},
11231124
{

0 commit comments

Comments
 (0)