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

115
Views
How do test the title is showing in full length and not displaying with a dotted line with cypress?

I am new to working with cypress. I want to test the title text with any length is showing completely with full length and not dotted. I tested the title like below but still, I do not know how to check if the title with long length is displaying with dotted or not!! Thank you for any help.

cy.get(selectors.Content)   
  .find(selectors.dataComponent('title'))     
  .should('be.visible')     
  .and('not.be.empty')
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

If you want to test that there is no ellipsis, try

cy.get(selectors.Content)    
  .find(selectors.dataComponent('title'))      
  .should('be.visible')      
  .and('not.be.empty')  

cy.get(selectors.Content)    
  .find(selectors.dataComponent('title'))      
  .invoke('text')
  .should('not.contain', '...')

Or more strict,

cy.get(selectors.Content)    
  .find(selectors.dataComponent('title'))      
  .invoke('text')
  .should(title => expect(title.endsWith('...')).to.eq(false))
about 4 years ago · Juan Pablo Isaza Report

0

If you know the full length,

cy.get(selectors.Content)    
  .find(selectors.dataComponent('title'))      
  .invoke('text')
  .should('have.length', 20)
about 4 years ago · Juan Pablo Isaza Report
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!