0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Added mailgun mock to allow publishing workflow to run

no issue
This commit is contained in:
Sam Lord 2022-12-08 12:43:07 +00:00 committed by Sam Lord
parent 4c6a86eca4
commit 249802d62b
2 changed files with 15 additions and 1 deletions

View file

@ -82,6 +82,18 @@ const setupStripe = async (page, stripConnectIntegrationToken) => {
await page.getByRole('button', {name: 'OK'}).click();
};
// Setup Mailgun with fake data, for Ghost Admin to allow bulk sending
const setupMailgun = async (page) => {
await page.locator('.gh-nav a[href="#/settings/"]').click();
await page.locator('.gh-setting-group').filter({hasText: 'Email newsletter'}).click();
await page.locator('.gh-expandable-block').filter({hasText: 'Mailgun configuration'}).getByRole('button', {name: 'Expand'}).click();
await page.locator('[data-test-mailgun-domain-input]').fill('api.testgun.com');
await page.locator('[data-test-mailgun-api-key-input]').fill('Not an API key');
await page.locator('[data-test-button="save-members-settings"]').click();
await page.waitForSelector('[data-test-button="save-members-settings"] [data-test-task-button-state="success"]');
};
/**
* Delete all members, 1 by 1, using the UI
* @param {import('@playwright/test').Page} page
@ -303,6 +315,7 @@ const createMember = async (page, {email, name, note, label = '', compedPlan}) =
module.exports = {
setupGhost,
setupStripe,
setupMailgun,
deleteAllMembers,
createTier,
createOffer,

View file

@ -2,7 +2,7 @@ const config = require('../../../core/shared/config');
const {promisify} = require('util');
const {spawn, exec} = require('child_process');
const {knex} = require('../../../core/server/data/db');
const {setupGhost, setupStripe} = require('./e2e-browser-utils');
const {setupGhost, setupStripe, setupMailgun} = require('./e2e-browser-utils');
const {chromium} = require('@playwright/test');
const {startGhost} = require('../../utils/e2e-framework');
const {stopGhost} = require('../../utils/e2e-utils');
@ -77,6 +77,7 @@ const setup = async (playwrightConfig) => {
await setupGhost(page);
if (!usingRemoteServer) {
await setupStripe(page, stripeConnectIntegrationToken);
await setupMailgun(page);
}
await page.context().storageState({path: storageState});
await browser.close();