Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/playwright-ct.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
reporter: process.env.CI ? [['list', { printOnlyFailures: true }], ['html']] : 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
Expand Down
2 changes: 1 addition & 1 deletion assets/playwright-ct.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
reporter: process.env.CI ? [['list', { printOnlyFailures: true }], ['html']] : 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
Expand Down
2 changes: 1 addition & 1 deletion assets/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
reporter: process.env.CI ? [['list', { printOnlyFailures: true }], ['html']] : 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('')`. */
Expand Down
2 changes: 1 addition & 1 deletion assets/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
reporter: process.env.CI ? [['list', { printOnlyFailures: true }], ['html']] : 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('')`. */
Expand Down
19 changes: 19 additions & 0 deletions tests/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ const validGitignore = [
'/playwright/.auth/'
].join('\n');

for (const language of ['TypeScript', 'JavaScript'] as const) {
for (const componentTesting of [false, true]) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just remove component testing support from create-playwright.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill do that in a followup

test(`should configure failures-only CI reporting for ${language} ${componentTesting ? 'component' : 'end-to-end'} tests`, async ({ run, dir }) => {
await run(componentTesting ? ['--ct'] : [], {
language,
testDir: 'tests',
installGitHubActions: false,
installPlaywrightDependencies: false,
installPlaywrightBrowsers: false,
framework: componentTesting ? 'react' : undefined,
});
const extension = language === 'TypeScript' ? 'ts' : 'js';
const file = componentTesting ? `playwright-ct.config.${extension}` : `playwright.config.${extension}`;
const config = fs.readFileSync(path.join(dir, file), 'utf8');
expect(config).toContain("reporter: process.env.CI ? [['list', { printOnlyFailures: true }], ['html']] : 'html',");
});
}
}

test('should generate a project in the current directory', async ({ run, dir, packageManager }) => {
test.skip(packageManager === 'yarn-classic' || packageManager === 'yarn-berry');
test.slow();
Expand Down
Loading