60 lines
2.0 KiB
PHP
60 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace ElixirAudit\Tests\DataSetup\traits\Cms;
|
|
|
|
/**
|
|
* Trait for common CMS Table interactions
|
|
*/
|
|
trait cmsTableTrait
|
|
{
|
|
public function saveMainFormAndAssertSuccess(): void
|
|
{
|
|
$this->scrollIntoViewHoverClick('.buttons_bottom #fsave', self::CSS_SELECTOR);
|
|
$this->waitUntilDomReadyState();
|
|
$this->assertFormSuccessfullySavedMessage();
|
|
}
|
|
|
|
public function cancelMainForm(): void
|
|
{
|
|
$this->scrollIntoViewHoverClick('.buttons_bottom #fcancel', self::CSS_SELECTOR);
|
|
$this->waitUntilDomReadyState();
|
|
}
|
|
|
|
public function goBackToTable(): void
|
|
{
|
|
$this->scrollIntoViewHoverClick('.buttons_bottom #tback', self::CSS_SELECTOR);
|
|
$this->waitUntilDomReadyState();
|
|
}
|
|
|
|
public function deleteCmsTableRow($row): void
|
|
{
|
|
$selector = "#cms-table-drop-marker > div.table-rows > div > ul:nth-child($row) > li.w20.last.actions.even > div > a#ldelete";
|
|
$this->openCmsConfirmDialog($selector);
|
|
$this->cmsConfirmDialogActionYes();
|
|
$this->assertTableSuccessfullyDeletedMessage();
|
|
}
|
|
|
|
public function editCmsTableRow($row): void
|
|
{
|
|
$selector = "#cms-table-drop-marker > div.table-rows > div > ul:nth-child($row) > li.w20.last.actions.even > div > a#ledit";
|
|
$this->scrollIntoViewHoverClick($selector, self::CSS_SELECTOR);
|
|
$this->waitUntilDomReadyState();
|
|
}
|
|
|
|
public function editCmsTableRowById(int $id): void
|
|
{
|
|
$selector = "#cms-table-drop-marker > div.table-rows > div > ul#($id) > li.w20.last.actions.even > div > a#ledit";
|
|
$this->scrollIntoViewHoverClick($selector, self::CSS_SELECTOR);
|
|
$this->waitUntilDomReadyState();
|
|
}
|
|
|
|
public function clickRowExcelExport($row): void
|
|
{
|
|
$selector = "#cms-table-drop-marker > div.table-rows > div > ul:nth-child($row) > li > div > a.download";
|
|
$this->scrollIntoViewHoverClick($selector, self::CSS_SELECTOR);
|
|
$this->waitUntilDomReadyState();
|
|
}
|
|
}
|