Skip to content

Commit

Permalink
Adding more test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
karinathomasbbc committed Feb 4, 2025
1 parent e3a8010 commit a24320f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
22 changes: 20 additions & 2 deletions cypress/e2e/pages/articles/index.cy.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
/* eslint-disable import/no-relative-packages */
import runTestsForPage from '#nextjs/cypress/support/helpers/runTestsForPage';
import { testsThatAlwaysRunForAllPages } from '../testsForAllPages';
import { testsThatFollowSmokeTestConfig } from './tests';
import articleTests from './tests';
// import { testsThatFollowSmokeTestConfigForAMPOnly } from './testsForAMPOnly';
// import { testsThatFollowSmokeTestConfigForCanonicalOnly } from './testsForCanonicalOnly';
// import { testsForLiteOnly } from './testsForLiteOnly';

const testSuites = [
{
path: '/gahuza/articles/c5y51yxeg53o',
runforEnv: ['local'],
service: 'gahuza',
tests: [testsThatAlwaysRunForAllPages, articleTests],
},
{
path: '/news/articles/cn7k01xp8kxo',
runforEnv: ['local'],
service: 'news',
tests: [testsThatAlwaysRunForAllPages, articleTests],
},
{
path: '/mundo/articles/ce7p1pw7165o',
runforEnv: ['live'],
service: 'mundo',
tests: [testsThatAlwaysRunForAllPages, testsThatFollowSmokeTestConfig],
tests: [testsThatAlwaysRunForAllPages, articleTests],
},
{
path: '/persian/articles/crgxnrdl1xvo',
runforEnv: ['live'],
service: 'persian',
tests: [testsThatAlwaysRunForAllPages, articleTests],
},
];

Expand Down
7 changes: 1 addition & 6 deletions cypress/e2e/pages/articles/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ const serviceHasInlineLink = service =>
service === 'news' || service === 'afaanoromoo';

// For testing features that may differ across services but share a common logic e.g. translated strings.
// eslint-disable-next-line import/prefer-default-export
export const testsThatFollowSmokeTestConfig = ({
service,
pageType,
variant = 'default',
}) => {
export default ({ service, pageType, variant = 'default' }) => {
describe(`Running tests for ${service} ${pageType}`, () => {
describe(`Metadata`, () => {
// Here we should only have metadata tests that are unique to articles pages
Expand Down

0 comments on commit a24320f

Please sign in to comment.