Bus Booking Portal

Bus Booking Portal

🚌 BookMyBus

🔍 Find Your Bus

🔥 Trending Bus Routes

Chennai → Bangalore

From ₹499 | 7 hrs | Daily Trips

Delhi → Jaipur

From ₹399 | 6 hrs | Night Buses

Mumbai → Goa

From ₹799 | 10 hrs | Luxury Coaches

Hyderabad → Vizag

From ₹599 | 9 hrs | Sleeper AC

💰 Great Deals on Buses

Flat ₹100 OFF

Use WELCOME100

10% Cashback

On UPI Payments

Group Travel

4+ seats = 5% OFF

Comments

  1. import test, { expect } from "@playwright/test";


    test('book bus',async({page})=>{
    await page.goto('https://playwrightautomationtesting.blogspot.com/2025/05/bus-booking-portal.html')
    await page.getByPlaceholder('From City').fill('adfs')
    await page.getByPlaceholder('To City').fill('xyz')
    await page.getByPlaceholder('Select Date').nth(1).click()
    await page.getByLabel('June 18, 2025').click();
    await page.locator('#passengers').selectOption({label:'2 Passengers'});
    await page.locator('#busClass').selectOption({label:'AC Sleeper'})
    await page.getByText('Search Buses').click()
    const text = await page.locator(`//div[@class='card']//h3`).first().textContent()
    expect(text).toBe('adfs → xyz')
    const text1 = await page.locator(`//div[@class='card']//p`).first().textContent()
    expect(text1).toBe('Class: AC Sleeper | 2 Passengers | 2025-06-18')
    const text2 = await page.locator(`//div[@class='card']//p`).nth(1).textContent()
    expect(text2).toBe('🚍 Departure: 8:00 AM | Arrival: 2:00 PM')
    const text3 = await page.locator(`//div[@class='card']//p`).nth(2).textContent()
    expect(text3).toBe('💰 Price: ₹799')
    })

    ReplyDelete

Post a Comment

Popular Posts