Skip to content

Commit

Permalink
Acceptance Tests: Attempt to fix preview tests
Browse files Browse the repository at this point in the history
  • Loading branch information
theodesp committed Apr 12, 2024
1 parent 8d97c66 commit 83fdb7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions plugins/faustwp/tests/acceptance/CustomPostTypeCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ public function i_can_view_the_custom_post_type_preview_link(AcceptanceTester $I

$I->loginAsAdmin();
$I->amEditingPostWithId($cpt_id);

$I->click('div.components-guide .components-modal__header button.components-button');
$I->click('button.editor-preview-dropdown__toggle');
$I->wait(4); // Wait for previewlinks.js to modify button href.
$I->seeLink(
'Preview in new tab',
"${front_end_url}/document/${cpt_name}/?preview=true&previewPathname=" . rawurlencode("/document/cpt-document-preview/") . "&p=${cpt_id}&typeName=Document",
);
'Preview in new tab',
"${front_end_url}/${post_name}/?preview=true",
);

$I->click('Preview in new tab');
$I->switchToNextTab();
$I->wait(14); // Wait for authentication
$I->see($post_title, 'section h1');
}
}
2 changes: 1 addition & 1 deletion plugins/faustwp/tests/acceptance/PostPreviewCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function i_can_view_the_post_preview_link(AcceptanceTester $I)
$I->wait(4); // Wait for previewlinks.js to modify button href.
$I->seeLink(
'Preview in new tab',
"${front_end_url}/${post_name}/?preview=true&previewPathname=" . rawurlencode("/post-preview-post/") . "&p=${post_id}&typeName=Post",
"${front_end_url}/${post_name}/?preview=true",
);

$I->click('Preview in new tab');
Expand Down

0 comments on commit 83fdb7b

Please sign in to comment.