Skip to content

Commit e993e48

Browse files
committed
Create needed pages in initialize step.
1 parent bfd1346 commit e993e48

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

tests/bin/initialize.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ set -e
33

44
npm run env run tests-wordpress chmod -- -c ugo+w /var/www/html
55
npm run env run tests-cli wp rewrite structure '/%postname%/' -- --hard
6+
7+
wp-env run tests-cli wp post create --post_title='Mailchimp signup form – shortcode' --post_type=page --post_status=publish --post_author=1 --post_content='<!-- wp:shortcode -->[mailchimpsf_form]<!-- /wp:shortcode -->'
8+
wp-env run tests-cli wp post create --post_title='Mailchimp signup form - Block' --post_type=page --post_status=publish --post_author=1 --post_content='<!-- wp:mailchimp/mailchimp /-->'

tests/cypress/e2e/submission/subscribe.test.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@
22
import { generateRandomEmail } from '../../support/functions/utility';
33

44
describe('Subscribe actions', () => {
5-
let shortcodePostURL;
6-
let blockPostPostURL;
7-
85
before(() => {
9-
// Load the post URLs from the JSON file
10-
cy.fixture('postUrls').then((urls) => {
11-
shortcodePostURL = urls.shortcodePostURL;
12-
blockPostPostURL = urls.blockPostPostURL;
13-
});
14-
156
cy.login(); // WP
167
cy.mailchimpLoginIfNotAlreadyLoggedIn();
178

@@ -70,7 +61,7 @@ describe('Subscribe actions', () => {
7061
// Step 2: Create the post
7162
cy.createPost({ title: postTitle, content: '', beforeSave }).then((post) => {
7263
if (post) {
73-
shortcodePostURL = `/?p=${post.id}`;
64+
const shortcodePostURL = `/?p=${post.id}`;
7465
signUpAndVerify(shortcodePostURL);
7566
}
7667
});
@@ -87,9 +78,9 @@ describe('Subscribe actions', () => {
8778
// Step 2: Create the post
8879
cy.createPost({ title: postTitle, content: '', beforeSave }).then((postBlock) => {
8980
if (postBlock) {
90-
blockPostPostURL = `/?p=${postBlock.id}`;
81+
const blockPostPostURL = `/?p=${postBlock.id}`;
9182
signUpAndVerify(blockPostPostURL);
9283
}
9384
});
9485
});
95-
});
86+
});

0 commit comments

Comments
 (0)