Skip to content

Commit d9b563f

Browse files
FanqingMxyliugo
andauthored
fix: fix the tasks of shopping admin (#85)
Co-authored-by: xyliugo <[email protected]>
1 parent b915345 commit d9b563f

File tree

20 files changed

+542
-353
lines changed

20 files changed

+542
-353
lines changed

src/mcp_services/playwright_webarena/playwright_state_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DockerConfig:
4141

4242
@property
4343
def base_url(self) -> str:
44-
return f"http://34.143.185.85:{self.host_port}"
44+
return f"http://34.143.228.182:{self.host_port}"
4545

4646

4747
class PlaywrightStateManager(BaseStateManager):
@@ -186,7 +186,7 @@ def _wait_until_ready(self) -> bool:
186186

187187
# Determine host and port from URL for port checks
188188
parsed = urlparse(base_url)
189-
host = parsed.hostname or "34.143.185.85"
189+
host = parsed.hostname or "34.143.228.182"
190190
port = parsed.port or self.config.host_port
191191

192192
# First wait for port to open to avoid long HTTP errors
@@ -208,7 +208,7 @@ def _configure_shopping_admin_post_start(self) -> None:
208208
"""Run Magento-specific steps for shopping_admin container.
209209
Uses EXTERNAL_IP env var if provided; waits a bit for services to start.
210210
"""
211-
external_ip = os.getenv("EXTERNAL_IP", "34.143.185.85")
211+
external_ip = os.getenv("EXTERNAL_IP", "34.143.228.182")
212212
try:
213213
wait_seconds = int(os.getenv("SHOPPING_ADMIN_SETUP_WAIT", "120"))
214214
except ValueError:

src/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
},
305305
"base_url": {
306306
"env_var": "PLAYWRIGHT_WEBARENA_BASE_URL",
307-
"default": "http://34.143.185.85:7780/admin",
307+
"default": "http://34.143.228.182:7780/admin",
308308
"required": False,
309309
"description": "Base URL for WebArena environment",
310310
},

tasks/playwright_webarena/reddit/task_7/description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Create a comprehensive budget travel resource for European travel on the Postmil
22

33
**Task Requirements:**
44

5-
1. Navigate to http://34.143.185.85:9999 and register a new account with username "EuroTravelPlanner" and password "SecureTravel2024!"
5+
1. Navigate to http://34.143.228.182:9999 and register a new account with username "EuroTravelPlanner" and password "SecureTravel2024!"
66

77
2. After successful registration and login, search for "Europe travel budget" using the search bar to check for existing content
88

tasks/playwright_webarena/reddit/task_7/verify.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def verify() -> bool:
3737
try:
3838
# 1. Check if account can login
3939
print("Step 1: Verifying account login...", file=sys.stderr)
40-
await page.goto('http://34.143.185.85:9999/', wait_until='networkidle')
40+
await page.goto('http://34.143.228.182:9999/', wait_until='networkidle')
4141

4242
# Check if already logged in
4343
user_button = page.locator('button:has-text("EuroTravelPlanner")')
@@ -79,7 +79,7 @@ async def verify() -> bool:
7979

8080
# 2. Check if forum exists at /f/BudgetEuropeTravel
8181
print("\nStep 2: Checking forum existence...", file=sys.stderr)
82-
await page.goto('http://34.143.185.85:9999/f/BudgetEuropeTravel', wait_until='networkidle')
82+
await page.goto('http://34.143.228.182:9999/f/BudgetEuropeTravel', wait_until='networkidle')
8383

8484
# Check if we get 404 or the forum exists
8585
page_title = await page.title()
@@ -92,7 +92,7 @@ async def verify() -> bool:
9292

9393
# 3. Verify forum details at edit page
9494
print("\nStep 3: Verifying forum details at edit page...", file=sys.stderr)
95-
await page.goto('http://34.143.185.85:9999/f/BudgetEuropeTravel/edit', wait_until='networkidle')
95+
await page.goto('http://34.143.228.182:9999/f/BudgetEuropeTravel/edit', wait_until='networkidle')
9696

9797
# Check if we can access edit page (should be moderator)
9898
if "404" in await page.title() or "not found" in (await page.title()).lower():
@@ -127,11 +127,11 @@ async def verify() -> bool:
127127

128128
# 4. Verify wiki page exists at /w/europe-travel-budget-guide
129129
print("\nStep 4: Checking wiki page...", file=sys.stderr)
130-
await page.goto('http://34.143.185.85:9999/w/europe-travel-budget-guide', wait_until='networkidle')
130+
await page.goto('http://34.143.228.182:9999/w/europe-travel-budget-guide', wait_until='networkidle')
131131

132132
if "404" in await page.title() or "not found" in (await page.title()).lower():
133133
# Try alternative URL
134-
await page.goto('http://34.143.185.85:9999/wiki/europe-travel-budget-guide', wait_until='networkidle')
134+
await page.goto('http://34.143.228.182:9999/wiki/europe-travel-budget-guide', wait_until='networkidle')
135135
if "404" in await page.title() or "not found" in (await page.title()).lower():
136136
print("Error: Wiki page does not exist", file=sys.stderr)
137137
await page.screenshot(path=str(SCREENSHOT_DIR / "wiki_not_found.png"))
@@ -153,7 +153,7 @@ async def verify() -> bool:
153153

154154
# 5. Check for the post in the forum
155155
print("\nStep 5: Checking for post in forum...", file=sys.stderr)
156-
await page.goto('http://34.143.185.85:9999/f/BudgetEuropeTravel', wait_until='networkidle')
156+
await page.goto('http://34.143.228.182:9999/f/BudgetEuropeTravel', wait_until='networkidle')
157157

158158
post_title = "My 14-day Europe trip for under 1000 - Complete itinerary"
159159
post_link = page.locator(f'a:has-text("{post_title}")')
@@ -179,7 +179,7 @@ async def verify() -> bool:
179179
print("\nStep 6: Checking travel insurance search and upvote...", file=sys.stderr)
180180

181181
# Perform the search
182-
await page.goto('http://34.143.185.85:9999/', wait_until='networkidle')
182+
await page.goto('http://34.143.228.182:9999/', wait_until='networkidle')
183183
search_box = page.locator('input[type="search"], input[placeholder*="Search"]')
184184
if await search_box.count():
185185
await search_box.fill("travel insurance Europe")
@@ -216,7 +216,7 @@ async def verify() -> bool:
216216

217217
# 7. Verify user settings at /user/EuroTravelPlanner/preferences
218218
print("\nStep 7: Checking user settings...", file=sys.stderr)
219-
await page.goto('http://34.143.185.85:9999/user/EuroTravelPlanner/preferences', wait_until='networkidle')
219+
await page.goto('http://34.143.228.182:9999/user/EuroTravelPlanner/preferences', wait_until='networkidle')
220220

221221
# Check timezone setting - look for the select element with Europe/Amsterdam selected
222222
timezone_select = page.locator('select[name*="timezone"], select:has(option:has-text("Amsterdam"))')

tasks/playwright_webarena/shopping_admin/task_1/description.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,31 @@ Perform a comprehensive marketing and customer analysis workflow in the Magento
22

33
**Task Requirements:**
44

5-
1. Navigate to http://34.143.185.85:7780/admin/. if need to login, login with username 'admin' and password 'admin1234'
5+
1. First, we need to access the system to begin our comprehensive analysis:
6+
Navigate to http://34.143.228.182:7780/admin/. if need to login, login with username 'admin' and password 'admin1234'
67

7-
2. Go to Reports > Marketing > Search Terms and analyze the search data:
8+
2. Let's start by analyzing customer search behavior to understand what customers are looking for:
9+
Go to Search Terms in Reports and analyze the search data:
810
- Identify the TOP 2 search terms with the highest number of hits (record exact terms and hit counts)
911
- Find a search term that has 0 results but still has search hits (record exact term and hit count)
1012
- Count the total number of search terms displayed in the report
1113

12-
3. Navigate to Marketing > Promotions > Cart Price Rules and identify:
14+
3. Next, we'll examine our promotional strategies to understand current marketing efforts:
15+
Navigate to Cart Price Rules and identify:
1316
- Find ALL rules that contain a coupon code
1417
- Record the exact coupon codes and the complete rule names for each
1518
- Count how many active rules exist in total
1619

17-
4. Go to Marketing > Communications > Newsletter Subscribers:
20+
4. Now let's analyze our email marketing reach and subscriber engagement:
21+
Go to Newsletter Subscribers:
1822
- Apply filter to show only 'Subscribed' status
1923
- Count the total number of subscribed users showing after filter
2024
- Verify whether these TWO emails appear in the subscribed list:
2125
2226
2327

24-
5. Create TWO new customers in Customers > All Customers with the following details:
28+
5. To support our analysis, we need to create test customer profiles for different segments:
29+
Create TWO new customers with the following details:
2530

2631
Customer 1:
2732
- First Name: Marketing1
@@ -37,7 +42,8 @@ Perform a comprehensive marketing and customer analysis workflow in the Magento
3742
- Associate to Website: Main Website
3843
- Group: Wholesale
3944

40-
6. Go to Dashboard and identify:
45+
6. Finally, let's review overall business performance metrics from the main dashboard:
46+
Go to Dashboard and identify:
4147
- The top bestselling and most expensive product name and quantity sold
4248
- The total revenue displayed on the dashboard
4349

0 commit comments

Comments
 (0)