Skip to content

Commit

Permalink
Add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrgicak committed Mar 13, 2024
1 parent 12ed01f commit 005dc24
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions packages/playground/website/cypress/e2e/blueprints.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ describe('Blueprints', () => {
},
{
step: 'runPHP',
code: `<?php
require '/wordpress/wp-load.php';
code: `<?php
require '/wordpress/wp-load.php';
$wp_rewrite->flush_rules();
`,
},
Expand Down Expand Up @@ -81,4 +81,21 @@ describe('Blueprints', () => {
.find('[aria-label="“Test post” (Edit)"]')
.should('exist');
});

it('PHP Shutdown should work', () => {
const blueprint: Blueprint = {
landingPage: '/wp-admin/',
features: { networking: true },
steps: [
{ step: 'login' },
{
step: 'writeFile',
path: '/wordpress/wp-content/mu-plugins/rewrite.php',
data: "<?php add_action( 'shutdown', function() { post_message_to_js('test'); } );",
},
],
};
cy.visit('/#' + JSON.stringify(blueprint));
cy.wordPressDocument().its('body').should('contain', 'Dashboard');
});
});

0 comments on commit 005dc24

Please sign in to comment.