Get translated text in waitForText(), Dusk, dusk, dusk....
Hi, I will be very grateful if community will help solve my problem with testing.
I have multilingual app(11 languages) And I want to see text on page depending on language what I'm testing. I tried $browser->waitForText(trans('proof-of-use.title')); And I get back fail Facebook\WebDriver\Exception\TimeOutException: Waited 5 seconds for text [proof-of-use.title]. Hope someone can explain why that happend and how to fix it
The BrowserTest class is extending the PhpUnit test class by default. Therefore you can't access Laravel specific functions when running these tests. You can only use the browser tests functions!
I would also recommend you to leave these translation out of your tests like you do now. Instead write a test where you say switch language to some language and assert some translations using static text. This way you have full control over the tests ;)