Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ct): https #19697

Merged
merged 2 commits into from Dec 29, 2022
Merged

feat(ct): https #19697

merged 2 commits into from Dec 29, 2022

Conversation

sand4rt
Copy link
Collaborator

@sand4rt sand4rt commented Dec 25, 2022

fixes: #15651, #16460

Not sure how to test it. Tried it with the test below but i can't get it to work :(

test('works', async ({ runInlineTest }) => {
  const result1 = await runInlineTest({
    'playwright/index.html': `<script type="module" src="./index.js"></script>`,
    'playwright/index.js': ``,
    'playwright.config.js': `
      export default {
        use: {
          ignoreHTTPSErrors: true,
          ctViteConfig: {
            preview: {
              https: true
            }
          }
        },
      };
    `,
    'http.test.ts': `
      //@no-header
      import { test, expect } from '@playwright/experimental-ct-react';
      test('pass', async ({ page }) => {
        await expect(page).toHaveURL('https://localhost:3100');
      });
    `,
  }, { workers: 1 });
  expect(result1.exitCode).toBe(0);
  expect(result1.passed).toBe(1);
});

it throws (even with ignoreHTTPSErrors: true):

net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH at https://localhost:3100/
=========================== logs ===========================
navigating to "https://localhost:3100/", waiting until "load"
============================================================

any tips?

@pavelfeldman
Copy link
Member

I think you need some certificate for it to worker. The option that you are using will trust any certificate, but there should be some certificate... https://vitejs.dev/config/server-options.html#server-http

@sand4rt sand4rt force-pushed the ct-ssl branch 2 times, most recently from daec0b3 to 43cc895 Compare December 28, 2022 11:50
@pavelfeldman pavelfeldman merged commit b363902 into microsoft:main Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Component test does not respect https config from vite
2 participants