const { chromium } = require('playwright'); const BASE = 'https://moslem04.falahos.my/'; async function main() { const browser = await chromium.launch(); const page = await browser.newPage({ viewport: { width: 390, height: 844 } }); await page.goto(BASE, { waitUntil: 'networkidle' }); const clickTab = async label => { await page.locator('nav button.tab', { hasText: label }).click(); await page.waitForTimeout(200); }; await clickTab('Assets'); await page.locator('.field:has-text("Description") input').fill('Bakery Sdn Bhd shares'); await page.locator('.field:has-text("Estimated value") input').fill('300000'); await page.locator('.form-card select').first().selectOption('Business interest'); await page.locator('button.btn-primary', { hasText: 'Add asset' }).click(); await page.waitForTimeout(200); await clickTab('Coverage'); const rowText = await page.locator('.asset-row', { hasText: 'Bakery' }).textContent(); console.log('Coverage row for business asset:', rowText.trim()); await clickTab('Nominate'); const assetSelect = page.locator('select').first(); const val = await assetSelect.evaluate(el => Array.from(el.options).find(o => o.textContent.includes('Bakery'))?.value); await assetSelect.selectOption(val); await page.waitForTimeout(200); const suggestionText = await page.locator('.suggestion').textContent().catch(() => 'NO SUGGESTION'); console.log('Suggestion for business asset:', suggestionText.trim()); const channelOptions = await page.locator('.form-card select').nth(1).locator('option').allTextContents(); console.log('Available channel types:', channelOptions); await browser.close(); } main();