Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
Expect an array to contain a string using webdriver.io

How can I write my test so that it expects my array to contain a specific string? I've tried what I have below and some other methods such as using array.includes but can't get it to work properly.

let value = "test4";
let dropdownValues = ["test1", "test2", "test3", "test4"];

expect(dropdownValues).toHaveTextContaining(value);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The way to go about this is to set a variable that checks if the array contains a certain string and use that variable in the expect statement:

let value = "test4";
let dropdownValues = ["test1", "test2", "test3", "test4"];
let valueExist = dropdownValues.includes(value);

expect(valueExist).toEqual(true);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda