Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
se esperaba que {Objeto ()} no estuviera vacío - WebdriverIO - POM - Chai

Actualmente estoy usando WebdriverIO con POM y Chai expect/asserts. No he podido hacer funcionar mi afirmación chai.

 expectChai(watchesPage.infoTitle).to.not.be.empty;

Cuando ejecuto la prueba, aparece un error en el registro de mi consola que dice expected { Object () } not to be empty .

Este es mi archivo de especificaciones JS.

 //chai.pom.js import watchesPage from "../ebay/watches.page"; const expectChai = require("chai").expect; const assert = require("chai").assert; describe("Watches Page", () => { it("should show the banner container", async () => { browser.url("https://www.ebay.com/b/Watches/260325/bn_7117208191"); const watchesText = $(".title-banner__title"); await expect(watchesText).toBeDisplayed(); }); it("should show the banner title", async () => { //const infoTitle = await $(".title-banner__subtitle"); await watchesPage.infoTitle.getText(); //const infoTitleText = await infoTitle.getText(); await expect(watchesPage.infoTitle).toHaveTextContaining( "The place to elevate your style since 1995.." ); expectChai(watchesPage.infoTitle).to.not.be.empty; assert.isEmpty(watchesPage.infoTitle); }); });

Y este es mi archivo de página. ignore el constructor llamado super.

 //watches.page.js import Page from "./page"; class WatchesPage extends Page { //const infoTitle = await $(".title-banner__subtitle"); //const infoTitleText = await infoTitle.getText(); get infoTitle() { return $(".title-banner__subtitle"); } open() { super.open("htpp:"); } } export default new WatchesPage();

Espero que me puedan ayudar, muchas gracias de antemano!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!