Skip to content

Commit

Permalink
test(ct): work with https enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sand4rt committed Dec 28, 2022
1 parent 253a4aa commit 83b8044
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@types/xml2js": "^0.4.9",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"@vitejs/plugin-basic-ssl": "^1.0.1",
"@vitejs/plugin-react": "^3.0.0",
"@zip.js/zip.js": "^2.4.2",
"ansi-to-html": "^0.7.2",
Expand Down
34 changes: 33 additions & 1 deletion tests/playwright-test/playwright.ct-build.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,36 @@ test('should not use global config for preview', async ({ runInlineTest }) => {
const result2 = await runInlineTest({}, { workers: 1 });
expect(result2.exitCode).toBe(0);
expect(result2.passed).toBe(1);
});
});

test('should work with https enabled', async ({ runInlineTest }) => {
const result = await runInlineTest({
'playwright/index.html': `<script type="module" src="./index.js"></script>`,
'playwright/index.js': `//@no-header`,
'playwright.config.js': `
//@no-header
import basicSsl from '@vitejs/plugin-basic-ssl';
export default {
use: {
ignoreHTTPSErrors: true,
ctViteConfig: {
plugins: [basicSsl()],
preview: {
https: true
}
}
},
};
`,
'http.test.tsx': `
//@no-header
import { test, expect } from '@playwright/experimental-ct-react';
test('pass', async ({ page }) => {
await expect(page).toHaveURL(/https:.*/);
});
`,
}, { workers: 1 });
expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1);
});

0 comments on commit 83b8044

Please sign in to comment.