Test case given with 3 steps:
```javascript
{
"actions": [
{
"action": "Click on the \"Books\" navigation item",
"expectedResult": "Books listing page appears"
},
{
"action": "Click on my profile icon",
"expectedResult": "A dropdown with profile options with \"My Favourites\" appears"
},
{
"action": "Click on My Favourites option",
"expectedResult": "Favourite items are consistent with ones on home page"
}
]
}
```
Pinata logs
=== Step 1, Action: "Click on the \"Books\" navigation item" ===
Orchestrator Plan response:
- Actor: "Click on the 'Books' navigation item in the top blue navigation bar."
- Assertor: "Verify that after clicking, you are on the Books listing page by checking for a heading or title indicating 'Books' and a list of books displayed."
Actor -> success
Assertor -> success
=== Step 2, Action: "Click on my profile icon" ===
Orchestrator Plan response:
- Actor: "Click on the 'Admin' profile icon in the top right corner of the navigation bar."
- Assertor: "Verify that a dropdown menu appears below the profile icon and that one of its options is labeled 'My Favourites'."
Actor -> success
Assertor -> success
=== Step 3, Action: "Click on My Favourites option" ===
Orchestrator Plan response:
- Actor: "Click on the 'My Favourites' option in the profile dropdown menu."
- Assertor: "Verify that all item titles listed as favourites match those shown in any favourites-related widget or section on the homepage (such as Most Viewed Favourites)."
Actor -> success
Assertor verdict: {
"status": "unknown",
"discrepancies": "Unable to verify assertion due to lack of visibility of the homepage or its favourites-related widgets/sections in this screenshot."
}
WebTestPilot logs
Abstract Page:
```
{
"name": "User Dashboard Page",
"description": "Displays recent activity, favorites, and updates in a clean, card-based layout.",
"layout": "<Page>...</Page>"
}
```
=== Step 1, Action: "Click on the \"Books\" navigation item" ===
Proposed Actions: `click(target_description="Books navigation item in the top right navigation bar")`
Closest state: User Dashboard Page
Is same logical page: false
Abstract Page:
```
{
"name": "Books Library Overview Page",
"description": "Displays book cards, navigation, and actions; visually clean with sidebar and top bar.",
"layout": "<Page>...</Page>"
}
```
... Post condition checking ... -> Pass
=== Step 2, Action: "Click on my profile icon" ===
Proposed Actions: ```click(target_description="profile icon in the top right corner")```
Closest state: Books Library Overview Page
Is same logical page: false
Abstract Page:
```
{
"name": "Books Overview Page",
"description": "Displays book cards, sidebar lists, and user actions in a clean, card-based layout.",
"layout": "<Page>...</Page>"
}
```
... Post condition checking ... -> Pass
=== Step 3, Action: "Click on My Favourites option" ===
Proposed Actions: ```click(target_description="My Favourites option in the dropdown menu at the top right")```
Closest state: User Dashboard Page
Is same logical page: false
Abstract Page:
```
{
"name": "Favorites List Page",
"description": "Displays user’s favorite books, chapters, pages, and shelves in a clean layout.",
"layout": "<Page>...</Page>"
}
```
Generate Post-condition:
```python
def postcondition(session: Session):
from typing import List
from pydantic import BaseModel, Field
# Define schema for a favourite item
class FavouriteItem(BaseModel):
title: str = Field(..., description="Title of the favourited item")
description: str = Field(..., description="Description of the favourited item")
class FavouritesList(BaseModel):
items: List[FavouriteItem] = Field(default_factory=list, description="List of favourited items")
# Extract favourites from the dashboard (homepage)
dashboard_favourites = session.history[0].extract(
"extract all items in the 'My Most Viewed Favourites' card, including their titles and descriptions",
schema=FavouritesList
).items
# Extract favourites from the current favourites page
favourites_page_favourites = session.history[-1].extract(
"extract all items in the favourites list, including their titles and descriptions",
schema=FavouritesList
).items
# Compare titles (order-insensitive)
dashboard_titles = set(item.title for item in dashboard_favourites)
favourites_page_titles = set(item.title for item in favourites_page_favourites)
assert dashboard_titles == favourites_page_titles, (
f"Favourited item titles on the homepage ({dashboard_titles}) do not match those on the Favourites page ({favourites_page_titles})."
)
```
POST-CONDITION PASSED!