Ghost/ghost/core/test/e2e-browser/admin/tiers.spec.js
Daniel Lockyer 97e5ca1de6
Extracted Playwright tests into separate files
- we should start to keep tests grouped by their area, so first we split
  by Admin tests and then Portal tests, and within that we split into
  setup/Tiers/Offers etc
2022-12-06 19:08:09 +07:00

25 lines
880 B
JavaScript

const {expect, test} = require('@playwright/test');
const {createTier, createOffer} = require('../utils');
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);
});
});