-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/microweber/microweber into dev
- Loading branch information
Showing
4 changed files
with
105 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,4 +68,6 @@ public function fillForm(Browser $browser, $username = 1, $password = 1) | |
$browser->pause(100); | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
|
||
namespace Tests\Browser\Components; | ||
|
||
use Facebook\WebDriver\WebDriverBy; | ||
use Laravel\Dusk\Browser; | ||
use Laravel\Dusk\Component as BaseComponent; | ||
|
||
class AdminMakeInstall extends BaseComponent | ||
{ | ||
/** | ||
* Get the root selector for the component. | ||
* | ||
* @return string | ||
*/ | ||
public function selector() | ||
{ | ||
return ''; | ||
} | ||
|
||
/** | ||
* Assert that the browser page contains the component. | ||
* | ||
* @param Browser $browser | ||
* @return void | ||
*/ | ||
public function assert(Browser $browser) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Get the element shortcuts for the component. | ||
* | ||
* @return array | ||
*/ | ||
public function elements() | ||
{ | ||
return []; | ||
} | ||
|
||
|
||
|
||
public function makeInstallation(Browser $browser) | ||
{ | ||
|
||
$siteUrl = site_url(); | ||
$this->browse(function (Browser $browser) use($siteUrl) { | ||
|
||
if (mw_is_installed()) { | ||
$this->assertTrue(true); | ||
return true; | ||
} | ||
|
||
/* $deleteDbFiles = []; | ||
$deleteDbFiles[] = dirname(dirname(__DIR__)) . DS . 'config/microweber.php'; | ||
$deleteDbFiles[] = dirname(dirname(__DIR__)) . DS . 'storage/127_0_0_1.sqlite'; | ||
foreach ($deleteDbFiles as $file) { | ||
if (is_file($file)) { | ||
unlink($file); | ||
} | ||
}*/ | ||
|
||
$browser->visit($siteUrl)->assertSee('install'); | ||
|
||
$browser->within(new ChekForJavascriptErrors(), function ($browser) { | ||
$browser->validate(); | ||
}); | ||
|
||
|
||
// Fill the install fields | ||
$browser->type('admin_username', '1'); | ||
$browser->type('admin_password', '1'); | ||
$browser->type('admin_password2', '1'); | ||
$browser->type('admin_email', 'bobi@microweber.com'); | ||
|
||
$browser->pause(300); | ||
$browser->select('#default_template', 'new-world'); | ||
|
||
$browser->pause(100); | ||
$browser->click('@install-button'); | ||
|
||
$browser->pause(20000); | ||
|
||
clearcache(); | ||
|
||
|
||
|
||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters