simple test
This commit is contained in:
parent
54314a0cde
commit
5ded78f8e4
1 changed files with 103 additions and 102 deletions
|
|
@ -4,6 +4,9 @@ async function simpleProxyTest() {
|
|||
console.log('🔬 Simple Proxy Test...');
|
||||
|
||||
try {
|
||||
await Browser.initialize({ headless: true, timeout: 10000, blockResources: false });
|
||||
console.log('✅ Browser initialized');
|
||||
|
||||
await Browser.initialize({ headless: true, timeout: 10000, blockResources: false });
|
||||
console.log('✅ Browser initialized');
|
||||
|
||||
|
|
@ -12,10 +15,9 @@ async function simpleProxyTest() {
|
|||
'http://doimvbnb-US-rotate:w5fpiwrb9895@p.webshare.io:80'
|
||||
);
|
||||
console.log('✅ Page created with proxy');
|
||||
let summaryData: any = null;
|
||||
let summaryData: any = null; // Initialize summaryData to store API response
|
||||
let eventCount = 0;
|
||||
page.onNetworkEvent(event => {
|
||||
// Capture the summary API response
|
||||
if (event.url.includes('/webrest/search/product-types/summary')) {
|
||||
console.log(`🎯 Found summary API call: ${event.type} ${event.url}`);
|
||||
|
||||
|
|
@ -36,19 +38,18 @@ async function simpleProxyTest() {
|
|||
});
|
||||
|
||||
console.log('⏳ Waiting for page load...');
|
||||
await page.waitForLoadState('domcontentloaded', { timeout: 8000 });
|
||||
await page.waitForLoadState('domcontentloaded', { timeout: 20000 });
|
||||
console.log('✅ Page loaded');
|
||||
|
||||
// RIGHT HERE - Interact with the page to find Stocks checkbox and Apply button
|
||||
try {
|
||||
console.log('🔍 Looking for Products tab...');
|
||||
|
||||
// Wait for the page to fully load
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForTimeout(20000);
|
||||
|
||||
// First, click on the Products tab
|
||||
const productsTab = page.locator('#productSearchTab[role="tab"][href="#products"]');
|
||||
await productsTab.waitFor({ timeout: 10000 });
|
||||
await productsTab.waitFor({ timeout: 20000 });
|
||||
console.log('✅ Found Products tab');
|
||||
|
||||
console.log('🖱️ Clicking Products tab...');
|
||||
|
|
@ -56,7 +57,7 @@ async function simpleProxyTest() {
|
|||
console.log('✅ Products tab clicked');
|
||||
|
||||
// Wait for the tab content to load
|
||||
await page.waitForTimeout(2000);
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
// Click on the Asset Classes accordion to expand it
|
||||
console.log('🔍 Looking for Asset Classes accordion...');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue