Skip to content

Commit

Permalink
ACMS-3360: Refactor test.
Browse files Browse the repository at this point in the history
  • Loading branch information
chandan-singh7929 committed Dec 4, 2023
1 parent c7160f4 commit 368fa70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions tests/src/ExistingSiteJavascript/AudioComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public function testComponent(): void {
$edit_form->pressButton('Browse');
/** @var \Drupal\FunctionalJavascriptTests\JSWebAssert $assertSession */
$assertSession = $this->assertSession();
$mediaLibraryContent = $assertSession->waitForElementVisible("css", ".media-library-content");
$assertSession->waitForElementVisible("css", "#acquia-dam-user-authorization-skip");
$damAuthorizeScreen = $mediaLibraryContent->find("css", "#acquia-dam-user-authorization-skip");
$damAuthorizeScreen = $assertSession->waitForElementVisible("css", "#acquia-dam-user-authorization-skip");
// First time DAM show confirmation screen to authorize access.
// We will press skip button only if it appears.
if ($damAuthorizeScreen instanceof NodeElement) {
Expand Down
6 changes: 2 additions & 4 deletions tests/src/ExistingSiteJavascript/CohesionTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected function setUp(): void {
parent::setUp();
// Set a standard window size so that all javascript tests start with the
// same viewport.
$this->getDriverInstance()->resizeWindow(1920, 1200);
$this->getDriverInstance()->maximizeWindow();
}

/**
Expand Down Expand Up @@ -77,9 +77,7 @@ protected function openMediaLibrary(ElementInterface $edit_form, string $button_
/** @var \Drupal\FunctionalJavascriptTests\JSWebAssert $assertSession */
$assertSession = $this->assertSession();
$this->assertTrue($assertSession->waitForText('Media Library'));
$mediaLibraryContent = $assertSession->waitForElementVisible("css", ".media-library-content");
$assertSession->waitForElementVisible("css", "#acquia-dam-user-authorization-skip");
$damAuthorizeScreen = $mediaLibraryContent->find("css", "#acquia-dam-user-authorization-skip");
$damAuthorizeScreen = $assertSession->waitForElementVisible("css", "#acquia-dam-user-authorization-skip");
// First time DAM show confirmation screen to authorize access.
// We will press skip button only if it appears.
if ($damAuthorizeScreen instanceof NodeElement) {
Expand Down

0 comments on commit 368fa70

Please sign in to comment.