Skip to content

Commit 3f07c6e

Browse files
committed
Add e2e test
1 parent 12ed01f commit 3f07c6e

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

packages/playground/website/cypress/e2e/blueprints.cy.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ describe('Blueprints', () => {
1515
},
1616
{
1717
step: 'runPHP',
18-
code: `<?php
19-
require '/wordpress/wp-load.php';
18+
code: `<?php
19+
require '/wordpress/wp-load.php';
2020
$wp_rewrite->flush_rules();
2121
`,
2222
},
@@ -81,4 +81,21 @@ describe('Blueprints', () => {
8181
.find('[aria-label="“Test post” (Edit)"]')
8282
.should('exist');
8383
});
84+
85+
it.only('PHP Shutdown should work', () => {
86+
const blueprint: Blueprint = {
87+
landingPage: '/wp-admin/',
88+
features: { networking: true },
89+
steps: [
90+
{ step: 'login' },
91+
{
92+
step: 'writeFile',
93+
path: '/wordpress/wp-content/mu-plugins/rewrite.php',
94+
data: "<?php add_action( 'shutdown', function() { post_message_to_js('test'); } );",
95+
},
96+
],
97+
};
98+
cy.visit('/#' + JSON.stringify(blueprint));
99+
cy.wordPressDocument().its('body').should('contain', 'Dashboard');
100+
});
84101
});

0 commit comments

Comments
 (0)