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

Move away from the karma test runner for browser tests #810

Closed
timostamm opened this issue Sep 1, 2023 · 3 comments · Fixed by #1232
Closed

Move away from the karma test runner for browser tests #810

timostamm opened this issue Sep 1, 2023 · 3 comments · Fixed by #1232
Labels
cleanup Cleanup tasks

Comments

@timostamm
Copy link
Member

timostamm commented Sep 1, 2023

We test web clients on browsers via browserstack with the jasmine test framework and karma, which has an integration with browserstack. (See here for details.)

Karma is deprecated since April 2023, and we should move to an alternative mechanism to ensure compatibility with old browser.

@timostamm
Copy link
Member Author

We started using webdriverio for conformance tests. It appears to support browserstack, which means that we're potentially able to run the conformance tests against older web browsers. This would be desirable because it gives us better coverage, and removes the need for handwritten tests specific for browserstack.

@timostamm
Copy link
Member Author

This ran successfully for me:

import {remote} from "webdriverio";

const browserstackUsername = process.env.BROWSERSTACK_USERNAME ?? "";
const browserstackAccessKey = process.env.BROWSERSTACK_ACCESS_KEY ?? "";
if (browserstackUsername.length == 0 || browserstackAccessKey.length == 0) {
  throw new Error(
    "The environment variables BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY are required to run tests on browserstack.",
  );
}

const browser = await remote({
  user: browserstackUsername,
  key: browserstackAccessKey,
  services: [
    ["browserstack", {
      // browserstackLocal: true
    }]
  ],
  capabilities: [
    {
      browserName: 'Chrome',
      'bstack:options': {
        browserVersion: '120.0',
        os: 'Windows',
        osVersion: '10'
      }
    },
  ],
  // Directory to store all test runner log files (including reporter logs and wdio logs).
  // If not set, all logs are streamed to stdout, which conflicts with the conformance runner I/O.
  // outputDir: new URL("logs", import.meta.url).pathname,
});

await browser.url("https://connectrpc.com");

await browser.deleteSession();

@timostamm
Copy link
Member Author

We started using webdriverio for conformance tests. It appears to support browserstack, which means that we're potentially able to run the conformance tests against older web browsers. This would be desirable because it gives us better coverage, and removes the need for handwritten tests specific for browserstack.

Tracking this separately in #1238.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Cleanup tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant