3

I am trying to assert that a list return the value that I need, but the assertion is failing and I don't know why if the difference is equals

theActorInTheSpotlight().should(seeThat(Elmenu.menu(SegurosVolutariosUi.CAMPOS_FORMULARIO_SEGUROS_VOLUTARIOS), contains(etiquetasFormulario)))
java.lang.AssertionError: 
Expected: iterable containing [<[Aseguradora, Tipo de seguro, Tipo de venta, Fecha de venta, Estado, Vendedor, Fecha de renovación, Origen]>]
     but: item 0: was "Aseguradora"
double-beep
  • 5,031
  • 17
  • 33
  • 41

1 Answers1

0

I believe the reason for failure is that your approach tries to compares the whole collections, which doesn't equal. If you want to check presence of single/multiple items you can use hasItem(s) matchers.

// direct check for a single value
theActorInTheSpotlight().should(seeThat(Elmenu.menu(SegurosVolutariosUi.CAMPOS_FORMULARIO_SEGUROS_VOLUTARIOS), hasItem("Aseguradora")))
// or just make an array with items from the list
theActorInTheSpotlight().should(seeThat(Elmenu.menu(SegurosVolutariosUi.CAMPOS_FORMULARIO_SEGUROS_VOLUTARIOS), hasItems(etiquetasFormulario.toArray(new String[0]))))
Drash
  • 1