mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
d04abc90b4
- this helps differentiate between the different tests we have available
27 lines
995 B
JavaScript
27 lines
995 B
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,
|
|
percentOff: 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);
|
|
});
|
|
});
|
|
});
|