Hi, thanks for your answer. Here's the test:
$this->browse(function (Browser $browser) {
$browser->visit('/')
->assertSee('Login')
->assertSee('Remember Me');
$browser->loginAs(8)
->visit('/')
->assertSee('Dashboard')
->assertDontSee('Crea')
->click('#depositsmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#productionmenu')
->assertSee('10 giorni')
->assertSee('Batterie')
->assertSee('Visualizza')
->assertSee('Crea')
->click('#assistancesmenu')
->assertSee('Accetta')
->click('#ordersmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->assertSee('Visualizza preordini')
->click('#shipmentsmenu')
->assertSee('Visualizza')
->assertSee('Cerca scheda')
->assertSee('Cerca smartcard')
->assertSee('DDT')
->assertSee('Temporanea')
->click('#ddt')
->assertSee('Crea vuoto')
->click('#temporary')
->assertSee('Crea')
->click('#smartcardsmenu')
->assertSee('Trova')
->assertSee('Report sostituite')
->assertSee('Registrazione senza chiavi')
->assertSee('Registrazione con chiavi')
->assertSee('Associazione da file')
->assertSee('Annulla associazione')
->assertSee('Rimanda e-mail')
->click('#customersmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->assertSee('Importa')
->click('#productsmenu')
->assertSee('Inserisci')
->assertSee('Visualizza')
->click('#invoicesmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#meritocracymenu')
->assertSee('Assistenze')
->assertSee('Visualizza')
->click('#interventionsmenu')
->assertSee('Inserisci')
->assertSee('Visualizza')
->click('#paymenttypesmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#paymentwaysmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#usersmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#permissionsmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#softwaremenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#manufacturersmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#lottypesmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#producttypesmenu')
->assertSee('Crea')
->assertSee('Visualizza')
->click('#settingsmenu')
->assertSee('Crea')
->assertSee('Visualizza')
;
});
test says:
Did not see expected text [Accetta] within element [body]. Failed asserting that false is true.
but the screenshot:
as you can see the string "Accetta" is there. Thanks a lot
I would maybe add a test to see that each of the top level menu items exists before drilling down into the sub menus
actually that is my id, and #assistancesmenu does exists. Point is if I remove the assertions after that one, it work. Then I add one by one, and looks like when they become too many, it fails - that's why I speak of performances problem.
Thanks a lot
Hey,
I am not sure if your front-end is using javascript
, but what I can recommend to try is use waitForText
instead of assertSee
.
assertSee
does an immediate check after the previous one.
waitForText
gives the page a few seconds for the text to become visible.
Hi Rob,
thanks a lot for the suggestion! actually with waitForText it works!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community