在Laravel Dusk和Vuejs更改URL之后,通过SPA应用程序更改URL

问题描述

我正在使用Laravel Dusk来对使用Vuejs作为前端的应用程序实施功能测试。

我使用以下代码来模拟过程:

class UserLoginTest extends DuskTestCase
{
    public function test_can_get_token()
    {
        $this->browse(function ($browser) {
            $transaction_info = Transaction_log::create([
                'app_id' => 1,'merchant_id' => 1,'real_amount' => 10000,'callback_url' => 'http://example.com','api_key' => 'some-hashed-api-key',]);

            $browser->visit('v1/cpg/' . $transaction_info->uuid)
                ->value('#mobileNumber','09330XXX216')
                ->pause(3000)
                ->press('@login-button') // The button is pressed (shows like pressing the button)
                // The test (on the browser) stops here,but I expect it to show the next page
                ->assertSee('code'); // This MUST be shown on the next page,after pressing the @login-button
}

正如我上面在评论中提到的那样,一切正常,可以自动运行,但是在按下登录按钮后更改页面内容。由于Vuejs处理的SPA概念,我缺少什么吗?

<v-text-field
 v-model="input1"
  solo
 flat
 height="30"
  outline
 mask="#"
  ref="input1"
   @input="pressTab(2)"
>code</v-text-field>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)