Skip to content

Commit 28caf23

Browse files
committed
Merge pull request #1469 from Private1647/stage
Added Supported Assertions document
1 parent 91e9a6d commit 28caf23

File tree

2 files changed

+145
-0
lines changed

2 files changed

+145
-0
lines changed
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
---
2+
id: kane-ai-supported-assertions
3+
title: KaneAI - Supported Assertions
4+
hide_title: false
5+
sidebar_label: Supported 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+
url: https://www.lambdatest.com/support/docs/kane-ai-supported-assertions/
12+
site_name: LambdaTest
13+
slug: kane-ai-supported-assertions/
14+
---
15+
16+
<script type="application/ld+json"
17+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
18+
"@context": "https://schema.org",
19+
"@type": "BreadcrumbList",
20+
"itemListElement": [{
21+
"@type": "ListItem",
22+
"position": 1,
23+
"name": "Home",
24+
"item": "https://www.lambdatest.com"
25+
},{
26+
"@type": "ListItem",
27+
"position": 2,
28+
"name": "Support",
29+
"item": "https://www.lambdatest.com/support/docs/"
30+
},{
31+
"@type": "ListItem",
32+
"position": 3,
33+
"name": "KaneAI Supported Assertions",
34+
"item": "https://www.lambdatest.com/support/docs/kane-ai-assertions/"
35+
}]
36+
})
37+
}}
38+
></script>
39+
KaneAI offers robust assertion support to validate various aspects of your test cases efficiently. Below is an overview of the supported and unsupported assertions.
40+
41+
## Supported Assertions
42+
43+
KaneAI supports a range of assertions to make test validations more seamless and effective. Here are the types of assertions currently supported:
44+
45+
### Driver Assertions
46+
Driver assertions rely on the web driver to validate browser url, page & window properties and dimensions.
47+
48+
**Examples:**
49+
- Assert if the current browser URL is "https://example.com".
50+
- Check if the page title is "Dashboard".
51+
- Validate if the client height and width match the expected values.
52+
53+
### Text Assertions
54+
Text assertions validate the presence or absence of specific text on the screen.
55+
56+
**Examples:**
57+
- Assert if the text "Welcome Back!" is visible.
58+
- Check if the error message "Invalid password" appears on failed login.
59+
60+
### Selection State Assertions
61+
Selection state assertions verify the selection status of elements like checkboxes and radio buttons.
62+
63+
**Examples:**
64+
- Assert if the "Remember Me" checkbox is checked.
65+
- Verify if the "Male" radio button is selected.
66+
67+
### Color Assertions
68+
Color assertions validate the color properties of elements on the screen.
69+
70+
**Examples:**
71+
- Assert if the submit button has a blue background.
72+
- Check if the error message appears in red.
73+
74+
### Visual Assertions
75+
Visual assertions ensure the visibility of images on the screen.
76+
77+
**Examples:**
78+
- Assert if the company logo is displayed in the header.
79+
- Verify the visibility of a product image on the product page.
80+
81+
### Relative Assertions
82+
Relative assertions check the visibility of one element in relation to another.
83+
84+
**Examples:**
85+
- Assert if the login button is in same column as the username field.
86+
- Check if the submit button and cancel button are in the same row.
87+
88+
---
89+
90+
## Unsupported Assertions
91+
There are some assertions that KaneAI does not support at this moment. However the support for these kind of assertions is currently under development.
92+
Below are examples of unsupported assertions along with examples.
93+
94+
### Element State Assertions (To be available soon)
95+
These assertions check for state of elements like being disabled or enabled.
96+
97+
**Examples:**
98+
- Assert if the submit button is disabled.
99+
- Assert if text input field is enabled.
100+
- Assert if a dropdown is expanded.
101+
102+
### Element Property Assertions (To be available soon)
103+
Property assertions involve checking styles or attributes of an element.
104+
105+
**Examples:**
106+
- Assert if the font size of a header is "16px".
107+
- Assert if the padding of a button is "10px".
108+
109+
### Spatial Assertions (To be available soon)
110+
Spatial assertions validate the position or arrangement of elements.
111+
112+
**Examples:**
113+
- Assert that the 5th column of a table contains "Jordan.Mathews".
114+
115+
### Logical Assertions (To be available soon)
116+
Logical assertions are used to combine multiple conditions.
117+
118+
**Examples:**
119+
- Assert if the user is an admin **and** is logged in.
120+
- Assert if either username or email is filled.
121+
122+
### Mathematical Assertions (To be available soon)
123+
Mathematical assertions verify numerical operations or calculations.
124+
125+
**Examples:**
126+
- Verify if the sum of 3 and 4 equals 7.
127+
128+
### Assertions for Actions Being Performed (To be available soon)
129+
These assertions aim to check the state after an action, which is not supported directly.
130+
131+
**Examples:**
132+
- Assert if the page is scrolled to the bottom.
133+
- Assert if a tooltip appears after hovering over an info icon.
134+
- Currently, you can break this into two steps: Hover on the info icon, then assert if the tooltip is visible.
135+
136+
### Nested Assertions (To be available soon)
137+
Nested assertions involve multiple layers of validation within a single assertion.
138+
139+
**Examples:**
140+
- Assert if both the login button is enabled and the welcome message is visible.
141+
142+
---
143+
144+
For further assistance or questions, feel free to reach out to our support team at [email protected].

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,7 @@ module.exports = {
11241124
items: [
11251125
"kane-ai-command-guide",
11261126
"kane-ai-web-test-writing-guidelines",
1127+
"kane-ai-supported-assertions",
11271128
],
11281129
},
11291130
{

0 commit comments

Comments
 (0)