mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 03:22:21 +03:00
d64d8c0ddd
refs https://www.notion.so/ghost/Critical-Paths-980dd089c3e74a6fbc619271f5a9ce42 - this test will create a free-trial Offer and go through Stripe checkout, ensuring the member is created as paid - also changes some utils to support creating the free-trial offer vs just a discounted Offer
28 lines
1.0 KiB
JavaScript
28 lines
1.0 KiB
JavaScript
const {expect, test} = require('@playwright/test');
|
|
const {createTier, createOffer} = require('../utils');
|
|
|
|
test.describe('Admin', () => {
|
|
test.describe('Tiers', () => {
|
|
test('Can create a Tier and Offer', async ({page}) => {
|
|
await page.goto('/ghost');
|
|
const tierName = 'New Test Tier';
|
|
await createTier(page, {
|
|
name: tierName,
|
|
monthlyPrice: 5,
|
|
yearlyPrice: 50
|
|
});
|
|
const offerName = await createOffer(page, {
|
|
name: 'Get 5% Off!',
|
|
tierName,
|
|
offerType: 'discount',
|
|
amount: 5
|
|
});
|
|
|
|
await page.locator('.gh-nav a[href="#/offers/"]').click();
|
|
await page.locator('.gh-offers-list').waitFor({state: 'visible', timeout: 1000});
|
|
await expect(page.locator('.gh-offers-list')).toContainText(tierName);
|
|
await expect(page.locator('.gh-offers-list')).toContainText(offerName);
|
|
});
|
|
});
|
|
});
|