test(browser): remove notification prompt helper
This commit is contained in:
parent
37eac11df3
commit
9c1ca422ce
1 changed files with 0 additions and 35 deletions
|
|
@ -105,8 +105,6 @@
|
||||||
$applicationRoute = "/project/{$this->project->uuid}/environment/{$this->environment->uuid}/application/{$this->application->uuid}";
|
$applicationRoute = "/project/{$this->project->uuid}/environment/{$this->environment->uuid}/application/{$this->application->uuid}";
|
||||||
|
|
||||||
$page = visit($applicationRoute);
|
$page = visit($applicationRoute);
|
||||||
|
|
||||||
dismissNotificationPrompt($page);
|
|
||||||
$page->screenshot();
|
$page->screenshot();
|
||||||
|
|
||||||
$page->assertSee('General')
|
$page->assertSee('General')
|
||||||
|
|
@ -115,7 +113,6 @@
|
||||||
->fill('customDockerRunOptions', '--read-only');
|
->fill('customDockerRunOptions', '--read-only');
|
||||||
|
|
||||||
submitResourceForm($page);
|
submitResourceForm($page);
|
||||||
dismissNotificationPrompt($page);
|
|
||||||
toggleCheckboxByWireModel($page, 'isStatic');
|
toggleCheckboxByWireModel($page, 'isStatic');
|
||||||
$page->screenshot();
|
$page->screenshot();
|
||||||
|
|
||||||
|
|
@ -129,7 +126,6 @@
|
||||||
->and($this->application->settings->is_static)->toBeTrue();
|
->and($this->application->settings->is_static)->toBeTrue();
|
||||||
|
|
||||||
$reloadedPage = visit($applicationRoute);
|
$reloadedPage = visit($applicationRoute);
|
||||||
dismissNotificationPrompt($reloadedPage);
|
|
||||||
$reloadedPage->screenshot();
|
$reloadedPage->screenshot();
|
||||||
|
|
||||||
$reloadedPage->assertValue('name', $updatedName)
|
$reloadedPage->assertValue('name', $updatedName)
|
||||||
|
|
@ -144,8 +140,6 @@
|
||||||
$databaseRoute = "/project/{$this->project->uuid}/environment/{$this->environment->uuid}/database/{$this->database->uuid}";
|
$databaseRoute = "/project/{$this->project->uuid}/environment/{$this->environment->uuid}/database/{$this->database->uuid}";
|
||||||
|
|
||||||
$page = visit($databaseRoute);
|
$page = visit($databaseRoute);
|
||||||
|
|
||||||
dismissNotificationPrompt($page);
|
|
||||||
$page->screenshot();
|
$page->screenshot();
|
||||||
|
|
||||||
$page->assertSee('General')
|
$page->assertSee('General')
|
||||||
|
|
@ -154,8 +148,6 @@
|
||||||
->fill('description', 'Updated by browser test');
|
->fill('description', 'Updated by browser test');
|
||||||
|
|
||||||
submitResourceForm($page);
|
submitResourceForm($page);
|
||||||
dismissNotificationPrompt($page);
|
|
||||||
|
|
||||||
toggleCheckboxByWireModel($page, 'enableSsl');
|
toggleCheckboxByWireModel($page, 'enableSsl');
|
||||||
|
|
||||||
$page->assertSee('SSL Mode')
|
$page->assertSee('SSL Mode')
|
||||||
|
|
@ -168,39 +160,12 @@
|
||||||
->and($this->database->enable_ssl)->toBeTruthy();
|
->and($this->database->enable_ssl)->toBeTruthy();
|
||||||
|
|
||||||
$reloadedPage = visit($databaseRoute);
|
$reloadedPage = visit($databaseRoute);
|
||||||
dismissNotificationPrompt($reloadedPage);
|
|
||||||
$reloadedPage->screenshot();
|
$reloadedPage->screenshot();
|
||||||
|
|
||||||
$reloadedPage->assertValue('name', $updatedDatabaseName)
|
$reloadedPage->assertValue('name', $updatedDatabaseName)
|
||||||
->assertSee('SSL Mode');
|
->assertSee('SSL Mode');
|
||||||
});
|
});
|
||||||
|
|
||||||
function dismissNotificationPrompt($page): void
|
|
||||||
{
|
|
||||||
$page->script(<<<'JS'
|
|
||||||
const closeButtonTexts = ['Accept and Close', 'Slice', 'Maybe next time'];
|
|
||||||
for (const text of closeButtonTexts) {
|
|
||||||
const closeButton = Array.from(document.querySelectorAll('button, a'))
|
|
||||||
.find((button) => button.textContent.includes(text));
|
|
||||||
|
|
||||||
if (! closeButton) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const modal =
|
|
||||||
closeButton.closest('.fixed') ??
|
|
||||||
closeButton.closest('[role="dialog"]') ??
|
|
||||||
closeButton.closest('div');
|
|
||||||
|
|
||||||
if (modal) {
|
|
||||||
modal.remove();
|
|
||||||
} else {
|
|
||||||
closeButton.click();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
JS);
|
|
||||||
}
|
|
||||||
|
|
||||||
function submitResourceForm($page): void
|
function submitResourceForm($page): void
|
||||||
{
|
{
|
||||||
$page->script("
|
$page->script("
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue