¿Cómo puedo obtener el texto del botón de search en la herramienta de prueba de extremo a extremo de PlayWright ? Lo intenté a continuación y page.innerText(selector, options) pero no estoy definido. ¿Alguien puede indicar por qué el método innerText no funciona aquí?
//homePage.js
const { expect } = require('@playwright/test'); exports.HomePage = class HomePage { constructor(page) { this.page = page; this.getSearchButton = page.innerText(.RoundButton__root .RoundButton__root--blue'); } async goto() { await this.page.goto('https://www.localsearch.com.au/'); } async getSearchButtonText() { await this.getSearchButton ; } }//inicio.js
const { test, expect } = require('@playwright/test'); const { HomePage } = require('../pom/homePage'); test('Verify Search button text', async ({ page }) => { const homePage = new HomePage(page); await homePage.goto(); const text = await homePage.getSearchButtonText(); console.log("Search text::"+text); });