AutomationAsserts
In our testing framework, AutomationAsserts
is a key component that provides various methods for asserting conditions in tests. These methods are used to verify that the application behaves as expected. Below is an explanation of each type of assertion available through AutomationAsserts
, referenced against various validation types:
Exact Text Comparison
Assertion:
assertEquals
Use: Validates that the actual text obtained from the application matches exactly with the expected text.
Reference: Often used in scenarios marked as
EQUAL
in validation types.
Boolean Condition Validation
Assertions:
assertTrue
for positive conditions,assertFalse
for negative conditions.Use: Checks if a condition (like an element being visible or a button being enabled) is true or false.
Reference: Tied to validation types like
IS_DISPLAY
,IS_BUTTON_ENABLE
, andIS_BUTTON_DISABLE
.
Non-Matching Text Check
Assertion:
assertNotEquals
Use: Ensures that two pieces of text are not the same, verifying that certain text changes under different conditions.
Reference: Related to
ATTRIBUTE_VALUE_NOT_PRESENT
validation type.
Case-Insensitive Text Comparison
Assertion:
assertEqualsIgnore
Use: Compares two texts for equality, disregarding any case differences (upper or lower case).
Reference: Used for validation types like
EQUAL_IGNORE
andATTRIBUTE_EQUAL_IGNORE
.
Attribute Value Verification
Use: Involves assertions that check if an element's attribute has a specific value or state.
Reference: Linked to validation types such as
ATTRIBUTE_VALUE_PRESENT
andATTRIBUTE_VALUE_NOT_PRESENT
.
Custom Checks
Use: Allows for implementing custom validation methods that are not covered by standard assertions.
Reference: Corresponds to the
CUSTOM
validation type.
Information Logging
Assertion:
info
Use: This method is used for logging informational messages in the test report, not for validation.
Reference: Used across various validation types for adding context or details in the report.
Understanding and effectively using these AutomationAsserts
methods in conjunction with the designated validation types is crucial for creating thorough and reliable automated tests. They ensure that each test step not only executes as intended but also accurately verifies the expected outcomes.
Last updated
Was this helpful?