Skip to content

Commit

Permalink
add tests for config microsite
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Jun 26, 2024
1 parent b989f54 commit 07d8c52
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 109 deletions.
6 changes: 0 additions & 6 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { defineConfig, devices } from '@playwright/test';


/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
Expand Down
12 changes: 1 addition & 11 deletions sites/configs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,8 @@
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build-preview": "astro build && astro preview",
"build-cache": "npm run build-pipeline-json && npm run build-component-json && npm run build-md-cache",
"build-md-cache": "node ../../bin/build-cache.js && tar -cvJf ../../.cache.tar.xz ../../.cache && node ../../bin/build-content-collection",
"build-md-cache-force": "node ../../bin/build-cache.js --force && tar -cvJf ../../.cache.tar.xz ../../.cache && node ../../bin/build-content-collection",
"build-cache-no-tar": "npm run build-pipeline-json && npm run build-component-json && node ../../bin/build-cache.js && node ../../bin/build-content-collection",
"build-cache-force": "npm run build-pipeline-json && npm run build-component-json && npm run build-md-cache-force",
"build": "NODE_OPTIONS='--max-old-space-size=4096' astro build",
"build-without-cache": "npm run build-cache-no-tar && astro build",
"preview": "astro preview",
"build-pipeline-json": "tar -xf ../../.cache.tar.xz && node ../../bin/pipelines.json.js && tar -cvJf ../../.cache.tar.xz ../../.cache",
"build-component-json": "node ../../bin/components.json.js"
"test": "playwright test --ui"
},
"dependencies": {
"@astrojs/mdx": "^3.1.2",
Expand Down
11 changes: 11 additions & 0 deletions sites/configs/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig, devices } from '@playwright/test';

import baseConfig from '../../playwright.config';

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
...baseConfig,
testDir: './tests/',
});
24 changes: 24 additions & 0 deletions sites/configs/tests/configs.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { test, expect } from '@playwright/test';

test.describe.configure({ mode: 'parallel' });
// @ts-check

test('config listing page', async ({ page }) => {
await page.goto('/configs');
await expect.soft(page).toHaveTitle('nf-core/configs');
// check if markdown is rendered correctly
await expect.soft(page.locator('.table')).toContainText('awsbatch');
// click on awsbatch link
await page.getByRole('link', { name: 'awsbatch' }).click();
await expect.soft(page).toHaveTitle('nf-core/configs: awsbatch');
});

test('config page', async ({ page }) => {
await page.goto('/configs/awsbatch');
await expect.soft(page).toHaveTitle('nf-core/configs: awsbatch');
// check if markdown is rendered correctly
await expect.soft(page.locator('.markdown-content')).toContainText('awsbatch Configuration');

// check if config file preview is correctly rendered as a code block
await expect.soft(page.locator('.config-code pre')).toContainText('AWSBATCH Cloud Profile');
});
80 changes: 0 additions & 80 deletions sites/configs/tests/nf-core.spec.ts

This file was deleted.

6 changes: 0 additions & 6 deletions sites/pipeline-results/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import { defineConfig, devices } from '@playwright/test';

import baseConfig from '../../playwright.config';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
Expand Down
6 changes: 0 additions & 6 deletions sites/pipelines/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import { defineConfig, devices } from '@playwright/test';

import baseConfig from '../../playwright.config';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
Expand Down

0 comments on commit 07d8c52

Please sign in to comment.