<?php

namespace Tests\Browser\Pages\Admin;

use Laravel\Dusk\Browser;
use Tests\Data\Admin\AdminLoginPage;
use Tests\Data\Admin\AdminPage;
use Tests\Data\Admin\LoginData;
use Tests\DuskTestCase;

class GoPluginsTest extends DuskTestCase
{
        /**
         * A basic browser test example.
         * @return void
         */
        public function testGopLugins()
        {

        $this->browse(function (Browser $browser) {
            $browser->visit(AdminLoginPage::Admin_Login['login_url'])
                //1.登录
                ->type(AdminLoginPage::Admin_Login['login_email'], LoginData::Ture_Data['email'])
                ->type(AdminLoginPage::Admin_Login['login_pwd'], LoginData::Ture_Data['password'])
                ->press(AdminLoginPage::Admin_Login['login_btn'])
                ->pause(2000)
                //2.插件市场
                ->click(AdminPage::TOP['plugins_market'])
                ->pause(2000)
                //3.根据地址获取断言
                ->assertPathIs(AdminPage::Assert['plugins_assert']);

        });
    }
}
