Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added examples and modified url links #812

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Allure annotations provide metadata for reporting.
`<before>` may contain these child elements:

* Any [Action][actions]
* [`<actionGroup>`]s
* [`<actionGroup>`]

### after {#after-tag}

Expand Down
160 changes: 157 additions & 3 deletions docs/test/assertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ The following example shows a common test that gets text from a page and asserts

### assertElementContainsAttribute

The `<assertElementContainsAttribute>` asserts that the selected html element contains and matches the expected value for the given attribute.

Example:

```xml
Expand Down Expand Up @@ -92,7 +94,8 @@ It must be in typical array format like `[1,2,3,4,5]` or `[alpha, brontosaurus,
See [assertArrayHasKey docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertArrayHasKey)

Attribute|Type|Use|Description
---|---|---|---`message`|string|optional|Text of informational message about a cause of failure.
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
`stepKey`|string|required| A unique identifier of the text step.
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.
Expand Down Expand Up @@ -123,6 +126,15 @@ Attribute|Type|Use|Description

See [assertStringContainsString docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertStringContainsString).

Example:

```xml
<assertStringContainsString stepKey="assertDropDownTierPriceTextProduct1">
<expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult>
<actualResult type="variable">DropDownTierPriceTextProduct1</actualResult>
</assertStringContainsString>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text describing the cause of the failure.
Expand All @@ -134,6 +146,15 @@ Attribute|Type|Use|Description

See [assertStringContainsStringIgnoringCase docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertStringContainsStringIgnoringCase).

Example:

```xml
<assertStringContainsStringIgnoringCase stepKey="verifyContentType">
<actualResult type="variable">grabContentType</actualResult>
<expectedResult type="string">{{image.extension}}</expectedResult>
</assertStringContainsStringIgnoringCase>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Message describing the cause of failure.
Expand All @@ -156,6 +177,14 @@ Attribute|Type|Use|Description

See [assertEmpty docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertEmpty).

Example:

```xml
<assertEmpty stepKey="assertSearchButtonEnabled">
<actualResult type="string">$grabSearchButtonAttribute</actualResult>
</assertEmpty>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -167,6 +196,15 @@ Attribute|Type|Use|Description

See [assertEquals docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertEquals).

Example:

```xml
<assertEquals message="ExpectedPrice" stepKey="assertBundleProductPrice">
<actualResult type="variable">grabProductPrice</actualResult>
<expectedResult type="string">$75.00</expectedResult>
</assertEquals>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand Down Expand Up @@ -245,6 +283,15 @@ Attribute|Type|Use|Description

See [assertGreaterOrEquals docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertGreaterOrEquals).

Example:

```xml
<assertGreaterOrEquals stepKey="checkStatusSortOrderAsc" after="getOrderStatusSecondRow">
<actualResult type="const">$getOrderStatusSecondRow</actualResult>
<expectedResult type="const">$getOrderStatusFirstRow</expectedResult>
</assertGreaterOrEquals>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -256,6 +303,15 @@ Attribute|Type|Use|Description

See [assertGreaterThan docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertGreaterThan).

Example:

```xml
<assertGreaterThan stepKey="checkQuantityWasChanged">
<actualResult type="const">$grabEndQuantity</actualResult>
<expectedResult type="const">$grabStartQuantity</expectedResult>
</assertGreaterThan>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -267,6 +323,15 @@ Attribute|Type|Use|Description

See [assertGreaterThanOrEqual docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertGreaterThanOrEqual).

Example:

```xml
<assertGreaterThanOrEqual stepKey="checkStatusSortOrderAsc" after="getOrderStatusSecondRow">
<actualResult type="const">$getOrderStatusSecondRow</actualResult>
<expectedResult type="const">$getOrderStatusFirstRow</expectedResult>
</assertGreaterThanOrEqual>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand Down Expand Up @@ -300,6 +365,15 @@ Attribute|Type|Use|Description

See [assertLessOrEquals docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertLessOrEquals).

Example:

```xml
<assertLessOrEquals stepKey="checkHeightIsCorrect">
<actualResult type="variable">getImageHeight</actualResult>
<expectedResult type="variable">getSectionHeight</expectedResult>
</assertLessOrEquals>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -311,6 +385,15 @@ Attribute|Type|Use|Description

See [assertLessThan docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertLessThan).

Example:

```xml
<assertLessThan stepKey="assertLessImages">
<expectedResult type="variable">initialImages</expectedResult>
<actualResult type="variable">newImages</actualResult>
</assertLessThan>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -322,6 +405,15 @@ Attribute|Type|Use|Description

See [assertLessThanOrEqual docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertLessThanOrEqual).

Example:

```xml
<assertLessThanOrEqual stepKey="checkHeightIsCorrect">
<actualResult type="variable">getImageHeight</actualResult>
<expectedResult type="variable">getSectionHeight</expectedResult>
</assertLessThanOrEqual>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -333,6 +425,15 @@ Attribute|Type|Use|Description

See [assertNotContains docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertNotContains).

Example:

```xml
<assertNotContains stepKey="assertCustomerGroupNotInOptions">
<actualResult type="variable">customerGroups</actualResult>
<expectedResult type="string">{{customerGroup.code}}</expectedResult>
</assertNotContains>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -344,6 +445,15 @@ Attribute|Type|Use|Description

See [assertStringNotContainsString docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertStringNotContainsString).

Example:

```xml
<assertStringNotContainsString stepKey="checkoutAsGuest">
<expectedResult type="string">{{CaptchaData.checkoutAsGuest}}</expectedResult>
<actualResult type="variable">$formItems</actualResult>
</assertStringNotContainsString>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -355,6 +465,15 @@ Attribute|Type|Use|Description

See [assertStringNotContainsStringIgnoringCase docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertStringNotContainsStringIgnoringCase).

Example:

```xml
<assertStringContainsStringIgnoringCase stepKey="verifyContentType">
<actualResult type="variable">grabContentType</actualResult>
<expectedResult type="string">{{image.extension}}</expectedResult>
</assertStringContainsStringIgnoringCase>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -366,6 +485,14 @@ Attribute|Type|Use|Description

See [assertNotEmpty docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertNotEmpty).

Example:

```xml
<assertNotEmpty stepKey="checkSwatchFieldForAdmin">
<actualResult type="const">$grabSwatchForAdmin</actualResult>
</assertNotEmpty>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand All @@ -377,6 +504,15 @@ Attribute|Type|Use|Description

See [assertNotEquals docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertNotEquals).

Example:

```xml
<assertNotEquals stepKey="assertNotEquals">
<actualResult type="string">{$grabTotalAfter}</actualResult>
<expectedResult type="string">{$grabTotalBefore}</expectedResult>
</assertNotEquals>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand Down Expand Up @@ -444,6 +580,15 @@ Attribute|Type|Use|Description

See [assertNotRegExp docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertNotRegExp).

Example:

```xml
<assertNotRegExp stepKey="simpleThumbnailIsNotDefault">
<actualResult type="const">$getSimpleProductThumbnail</actualResult>
<expectedResult type="const">'/placeholder\/thumbnail\.jpg/'</expectedResult>
</assertNotRegExp>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand Down Expand Up @@ -477,6 +622,15 @@ Attribute|Type|Use|Description

See [assertRegExp docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertRegExp).

Example:

```xml
<assertRegExp message="adminAnalyticsMetadata object is invalid" stepKey="validateadminAnalyticsMetadata">
<expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?("[\w_]+":\s+"[^"]*?"\s+)};#s</expectedResult>
<actualResult type="variable">$pageSource</actualResult>
</assertRegExp>
```

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
Expand Down Expand Up @@ -530,7 +684,7 @@ Attribute|Type|Use|Description

### expectException

See [expectException docs on codeception.com](http://codeception.com/docs/modules/WebDriver#expectException).
See [expectException docs on codeception.com](https://codeception.com/docs/modules/Asserts#expectException).

Attribute|Type|Use|Description
---|---|---|---
Expand All @@ -540,7 +694,7 @@ Attribute|Type|Use|Description

### fail

See [fail docs on codeception.com](http://codeception.com/docs/modules/WebDriver#fail).
See [fail docs on codeception.com](https://codeception.com/docs/modules/Asserts#fail).

Attribute|Type|Use|Description
---|---|---|---
Expand Down